Support

Home Forums Event Espresso Premium All event editor text match search and replace?

All event editor text match search and replace?

Posted: October 11, 2019 at 2:41 pm


ICLE

October 11, 2019 at 2:41 pm

I have had a request to change a string (“Speakers”) which is on all my events in the editor to another string (“Presenters”).
I need a “Event editor only” search, replace then store loop?
Do you have any ideas as to how to do this? Any weird WP tricks?


Josh

  • Support Staff

October 11, 2019 at 2:54 pm

You could use this tool and do a find/replace on the posts table:

https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

Taking a database backup before using the above script is encouraged.

Or if you want to play it safe and avoid borking the database and do a WP trick that could qualify as weird, you could apply a filter function onto the WP the_content filter. e.g.

add_filter(
    'the_content', 
    'my_weird_wp_trick',
    999
);
function my_weird_wp_trick(
    $content
) {
    if ('espresso_events' == get_post_type()) {
        $content = str_replace('Speakers', 'Presenters', $content);
    }
    return $content;
}

Please note: The above code doesn’t change the text within the editor, it changes the text on-the-fly when the post content is displayed.


ICLE

October 14, 2019 at 11:30 am

That’s cool. Thank you!

I would rather bork on the database.
It’s a fetish and possibly confuses the half dozen event managers less.
but then again… the fun would be endless.

The support post ‘All event editor text match search and replace?’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  ICLE 1 month ago ago

Topic Tags

Notifications

This topic is:
pending
Do NOT follow this link or you will be banned from the site!
[for="input_96_5_3"]
[for="input_96_5_3"]
[gravityform id=96 title=false description=false]
  • This field is for validation purposes and should be left unchanged.
[i]
[i]
[gravityform id=69 title=false description=false]
  • This field is for validation purposes and should be left unchanged.