Support » Plugin: Events Manager » Remove meta tags on duplicate events (to make Publicize work again)

  • Gnaag

    (@gnaag)


    Hello, there is an issue with duplicating events while using jetpack Publicize feature. On duplicated events jetpack Publicize is not working, while it thinks the post was already published to social networks. There is a simple fix. It is necessary to remove post meta that contains _wpas_ on duplicating. (The issue is being reffered to by publicize devloper here: https://wordpress.org/support/topic/duplicate-posts-publicize/ )

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support caimin_nwl

    (@caimin_nwl)

    Hi,

    Which version of Events Manager and Jetpack are you using?

    Gnaag

    (@gnaag)

    Hi, it is jetpack 5.0 and Events manager 5.7.3

    Plugin Support caimin_nwl

    (@caimin_nwl)

    Thanks. I’ve passed this on to the Dev team.

    Plugin Author Marcus

    (@netweblogic)

    NetWebLogic Support

    Thanks for spotting this and giving the background info on that meta key.

    I haven’t tested this out with JetPack but when duplicating events the _wpas_ key isn’t copied anymore.

    The fix, as you said, is easy. In events-manager/classes/em-event.php search for this (around line 1000):

    foreach($event_meta as $event_meta_key => $event_meta_vals){

    and under that line add this new line:

    if( $event_meta_key == '_wpas_' ) continue;

    This fix will be out in the next update.

    Thank you @netweblogic for pointing at right direction, but your solution didn’t work. It is not just one _wpas_ meta_key, but a bunch of them that starts with _wpas_. The correct line should be:

    if( strpos($event_meta_key, '_wpas_' ) !== false) continue;

    Now everything works as expected.

    Plugin Author Marcus

    (@netweblogic)

    NetWebLogic Support

    I’ll need to set up a test environment for this… or would you be willing to let me test it out on your site?

    I would rather use this instead:
    if( preg_match('/^_wpas_/', $event_meta_key ) continue;

    since your suggestion might also remove other legit meta tags from another plugin like _some_other_plugin_wpas_something (unlikely but better to consider the possibilities!)

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.