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

Viewing 2 reply threads


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.

Viewing 2 reply threads

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.

Event Espresso