php - Return a string that has a variable inside a WordPress Shortcode -


if have →

<input type="hidden" name="meta_adtracking" value="custom form" /> 

then can convert returnable string →

$output =  '<input type="hidden" name="meta_adtracking" value="custom form" />' 

of course output later returned:

return $output; 

but becomes challenging me when has jquery or wordpress localized function.

wordpress localized function

<input type="submit" class="one" name="aweber_submit" value="<?php _e("subscribe", 'text-domain');?>" /> 

how convert above returnable string? [p.s. → php tags not required because shortcode function in file .php extension], if remove php tag ok?

$output = '<input type="submit" class="one" name="aweber_submit" value="_e("subscribe", 'text-domain');" />' 

is ok?

almost. try this!

you need break out of string , concatenate whatever function returns.

$output = '<input type="submit" class="one" name="aweber_submit" value="'._e("subscribe", 'text-domain').'" />'; 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -