If you have a Custom Fields extension or can add a new field to [adverts_add] using Forms API and enabling/disabling the contact options on per Ad basis would work for you then you can use the code below to do that
add_action( "init", "my_contact_form_init", 1000 );
function my_contact_form_init() {
if ( ! is_singular( 'advert' ) ) {
return;
}
$post = get_post( get_the_ID() );
if ( get_post_meta( $post->ID, "show_contact_options", true ) != "1" ) {
remove_all_actions( "adverts_tpl_single_bottom" );
add_action( "adverts_tpl_single_bottom", "contact_form_disabled_info" );
}
}
function contact_form_disabled_info() {
echo "User disabled contact form options for this Ad.";
}
Additionally, if you have the Authors extension you can add the “show_contact_options” custom field to the Author form and then it will be possible to enable/disable the contact options on per user basis (instead of per Ad basis).
You would just need to change the line
$post = get_post( get_the_ID() );
to
$post_author_id = get_post_field( 'post_author', get_the_ID() );
$args = array(
'author' => $post_author_id,
'post_type' => 'advert-author',
'posts_per_page' => 1,
'post_status' => array( 'publish', 'advert-hidden' ),
);
$author_page = get_posts( $args );
$post = $author_page[0];