Change Event Status to Pending after Community User Edit

Home Forums Calendar Products Community Events Change Event Status to Pending after Community User Edit

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #987473
    Kevin
    Participant

    We’ve discovered that after a user submits an event for the first time and it’s approved – the user can then go back and edit the event, LIVE on the site…. We really think the event should go back into PENDING after any community edits. This way we don’t have content we wouldn’t approve on the site.

    Any way to do this?

    #987747
    Nico
    Member

    Hi Kevin,

    Welcome to our support forums, and thanks for reaching out to us!

    Hopefully there’s a simple way of achieving this. Just add the following snippet to your theme’s function.php file (located at wp-content/themes/your_theme/):


    /* Set status to pending after community event edit */
    add_action( 'tribe_community_event_updated', function ( $event_id ) {
    $args['ID'] = $event_id;
    $args['post_type'] = Tribe__Events__Main::POSTTYPE;
    $args['post_status'] = 'pending';

    wp_update_post( $args );
    } );

    Please give this a try and let me know if it works,
    Best,
    Nico

    #993038
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Change Event Status to Pending after Community User Edit’ is closed to new replies.