• Hi Greg, i like Wpadverts. Tell me please, how to make adverts pending moderation every time when any user (that is logged) does any changes in ad (i allready use [adverts_add moderate=”1″] )

    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    to change the Ad status to pending every time it is edited from page with [adverts_manage] shortcode just add the code below in your theme functions.php file

    
    add_filter( "adverts_sh_manage_list_statuses", function( $s ) {
        $s[] = "pending";
        return $s;
    } );
    add_action( "adverts_post_save", function( $form, $post_id ) {
        if( adverts_request( "_adverts_action" ) == "update" ) {
            wp_update_post( array( 
                "ID" => $post_id,
                "post_status" => "pending"
            ) );
        }
    }, 10, 2 );
    
Viewing 1 replies (of 1 total)

The topic ‘Moderation after editing’ is closed to new replies.