Reputation: 311
I am using a theme that has a lot of tools I need for a project, the only issue is they have a really long company name and it is everywhere! The double lines are driving me mad.
I know how to replace a string on the frontend using the below code, but I dont know how to modify it for the admin area.
function replace_content($content)
{
$content = str_replace('##Replace Me##', '##With Something Else##',$content);
return $content;
}
add_filter('the_content','replace_content');
Upvotes: 1
Views: 93
Reputation: 1182
As far as I know the admin section doesn't have anything similar to the_content
to filter off of, since any plugin/theme/extension could be writing to the backend in any way they want. You could probably find a good number of hooks to filter it out in most places (maybe the theme itself provides such hooks?) like you do with the content, but probably couldn't get all of them.
Given the way theme authors like to write their c̶r̶a̶p̶ code. I'm guessing this is hard coded into the theme, in which case the most viable option is unfortunately to edit the theme. If you can ssh into the server, command line tools like sed should make this basically a one-liner like the answer to this question.
If they happened to be nice enough to put their name in the database, you can use a plugin like Search & Replace to change all instances of it in the db.
Upvotes: 1