0

In plugin, I have following code in function:

$return_string .= '<li class="wpc-category ' . $class . '"><a href="'. get_option('catalogue_page_url') .'">All Products</a></li>'; 

Now I want to put following condition :

<?php $currentlang = get_bloginfo('language');
      if($currentlang=="en-US"): ?>
     All Products 
<?php else: ?>Dummy Text
<?php endif;?>

I want to replace All products . Can anyone help me please?

1
  • Just as a heads up, If this is a Plugin downloaded from WordPress and you edit code in the plugin folder that code will be overwritten whenever the plugin updates.
    – Howdy_McGee
    Commented Sep 17, 2014 at 14:32

1 Answer 1

0
<?php 
$currentlang = get_bloginfo('language');
if($currentlang=="en-US") 
    $link_text = 'All Products'; 
else
    $link_text = 'Dummy Text';
?>

$return_string .= '<li class="wpc-category ' . $class . '"><a href="'. get_option('catalogue_page_url') .'">' . $link_text . '</a></li>';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.