Hi,
you can add the code below in your theme functions.php file, it will change the Ad status to pending after editing it from the page with [adverts_manage] shortcode
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"
) );
wp_mail( get_option( "admin_email" ), "Ad pending moderation", sprint( "Ad %d requires moderation", $post_id ) );
}
}, 10, 2 );
It will also send an email to the administrator to notify him about a pending Ad.
Works perfectly, thank you very much.
Hello,
I use OceanWP theme and I tried to add this code to functions.php but it does not work.
I do not know in which section should I paste it?
Fatal error: Uncaught Error: Call to undefined function sprint()
Thanks in advance.
Hi,
there is a typo in the code i posted, replace “sprint” with “sprintf” it should work fine then.
Hi,
Thank you! It works fine.
With best!