Help with str_replace + wordpress?
Posted: Fri Sep 19, 2008 12:46 am
I have a wordpress site that is using a plugin which manages users' ratings of posts. The plugin adds preformatted XHTML elements (li's) to the string that gets stored in the database. Unfortunately, due to the design of the site, we must add an additional element inside of these list items. I can do a str_replace directly in the plugin's function contained in one of the plugin files, but I know for certain that this developer releases regular updates, and I'd rather not have this get blasted every time an update comes down the pipe. I am wondering if I can do a str_replace when I call a function in my template file, for instance, something like this:
This particular example doesn't work, but something of this nature would be extremely helpful, as this could be managed entirely from my template file instead of a dependency which I have much less control over.
Thanks for any ideas!
Code: Select all
$replaceElement = get_highest_rated();
str_replace("<li>", "<li><div>", $replaceElement);
Thanks for any ideas!