Thread Starter
acub
(@acub)
I have made myself a temporary solution. In your plugin file, I have added this code to far_ob_call function, after the is_array check:
if (function_exists('far_get_extra')) {
$far_extra_replaces = far_get_extra();
if (is_array($far_extra_replaces))
foreach ($far_extra_replaces as $extra_find => $extra_replace) {
$farsettings['farfind'][] = $extra_find;
$farsettings['farreplace'][] = $extra_replace;
}
}
And in functions.php I declared my far_get_extra function which returns the array of replacements without the worry that html chars will get converted into their meanings by WP. Not sure if the $find => $replace type of array for extra replaces will work in all cases (maybe some chars aren’t allowed in keys), but it does in mine.
Thread Starter
acub
(@acub)
I found the solution for this.
In the end, it turns out WP has a function that prevents textarea from replacing html entities into their result: http://codex.wordpress.org/Function_Reference/esc_textarea
Therefore, both $find and $replace vars need to be wrapped in esc_textarea() on line 115 of $real-time-find-and-replace.php, resulting in:
echo "<p id='row$i'><label for='farfind$i'>Find: </label><textarea rows='3' cols='30' name='farfind[$i]' id='farfind$i'>".esc_textarea( $find )."</textarea> <label for='farregex$i'>RegEx?: </label><input type='checkbox' name='farregex[$i]' id='farregex$i' $regex /> <label for='farreplace$i'>Replace: </label><textarea rows='3' cols='30' name='farreplace[$i]' id='farreplace$i'>".esc_textarea( $replace )."</textarea>   <a href='#' onClick='removeFormField(\"#row$i\"); return false;'>Remove</a></p>\n";
Please include this in the next release, if it’s not too much trouble.
Thank you!
Thanks for the code to fix this issue. The latest version includes it.