I have an extension 99% written - it works if I hardcode an id into a string. If someone can offer a little assistance with one line, then I can release this into the wild.
I need a regular expression that will find any number (because each textarea has a unique ID, it appears). I think I need to do a preg_replace. Let’s say I’m looking for this:
onclick="showhide_smileys('3');"
That number change depending on your custom fields, etc. I need a line that looks for that, but replaces that ‘3’ (or ‘2’ or whatever it happens to be) with a regexp that says “any number”. I tried something like this:
onclick="showhide_smileys('\[\d+\]');
but I couldn’t seem to get it working this morning, and I have some paying work to get to.
I’m very close, I think! If anyone can help straighten out this line, then I think it might be good to go:
$out = preg_replace("#<a href=\"jscript:void(0);\" onclick=\"showhide_smileys('\[\d+\]');return false;\"><b>Smileys</b></a> \| #", '', $out);
Click thumbnail to see full-size image