• Resolved mengeco

    (@mengeco)


    Hello,

    This plugin is really great but is it possible to exclude forms?

    And I propose a submenu or a breadcrumb to return to the list of forms

    Thanks !!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Arshid

    (@arshidkv12)

    Add following code to theme > functions.php

    $cfdb_exclude_ids = array( 4465,5515); //change by form ids 
    add_action( 'wpcf7_before_send_mail', 'exclude_wpcf7_before_send_mail',9);
    
    function exclude_wpcf7_before_send_mail( $form ){
    
     	global $cfdb_exclude_ids;
        $id  = $form->id();
     	if( in_array($id , $cfdb_exclude_ids) ){
     	 	remove_action( 'wpcf7_before_send_mail', 'cfdb7_before_send_mail');
     	}
    
    }

    Then go to plugins > contact-form-cfdb7 > inc > admin-mainpage.php change 145th line as follows.

    `$cfdb_exclude_ids = array( 4465,5515);
    $args = array(
    ‘post_type’=> ‘wpcf7_contact_form’,
    ‘order’ => ‘ASC’,
    ‘post__not_in’ => $cfdb_exclude_ids
    );`

    • This reply was modified 7 years, 11 months ago by Arshid.
    Thread Starter mengeco

    (@mengeco)

    Ok,
    Thank you very much Arshid !!!
    I hope you can keep this plugin update, it’s really a good job;)
    Pierre

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Is it possible to exclude forms?’ is closed to new replies.