Hello I am trying to insert custom string inside button Value, but I am facing a problem when I inster the string inside the value
parameter the string is appering like text instead as a valuer="" inside the button string. Here is my button code:
$buttons = '<input type="submit" name="Submit" style="width:110px;margin:0 auto;display:block;" value="'.pll_e('message','wpnotification').'" />' ;
So basicaly I need when this is rendered the result of the function to be shown inside the input button
not outside
Instead of the result of this to be <input type="submit" name="Submit" style="width:110px;margin:0 auto;display:block;" value="String Text">
The result is:
String Text
<input type="submit" name="Submit" style="width:110px;margin:0 auto;display:block;" value="">
So I need this text to apper inside the value tag.
Converting my comment into answer...
I think i know what the problem is. pll_e()
function must be echoing the output instead of returning
it.
Your function must look something similar to this:
function pll_e($paramA, $paramB) {
echo $paramA . " " . $paramB;
}
If that's the case, then you can deal with it by capturing the output buffer to a variable and use it on the button like this:
ob_start();
pll_e('message','wpnotification');
$funcValue = ob_get_clean();
$buttons = '<input type="submit" name="Submit" style="width:110px;margin:0 auto;display:block;" value="'. $funcValue .'" />';
Alternatively, if you have access to the pll_e
function... then just change it, so it return
the value instead of echo
it like this (example):
function pll_e($paramA, $paramB) {
return $paramA . " " . $paramB;
}
$buttons = '<input type="submit" name="Submit" style="width:110px;margin:0 auto;display:block;" value="'. pll_e('message','wpnotification') .'" />' ;