wpcf7_install

The Contact Form 7 wpcf7 install function.

Description

wpcf7_install(); 

Usage

  1. if ( !function_exists( 'wpcf7_install' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'contact-form-7/settings.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wpcf7_install(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/settings.php  
  1. function wpcf7_install() { 
  2. if ( $opt = get_option( wpcf7 ) ) { 
  3. return; 
  4.  
  5.  
  6. if ( get_posts( array( 'post_type' => 'wpcf7_contact_form' ) ) ) { 
  7. return; 
  8.  
  9. $contact_form = WPCF7_ContactForm::get_template( 
  10. array( 
  11. 'title' => sprintf( __( 'Contact form %d', 'contact-form-7' ), 1 ),  
  12. ); 
  13.  
  14. $contact_form->save(); 
  15.  
  16. WPCF7::update_option( 'bulk_validate',  
  17. array( 
  18. 'timestamp' => current_time( 'timestamp' ),  
  19. 'version' => WPCF7_VERSION,  
  20. 'count_valid' => 1,  
  21. 'count_invalid' => 0,  
  22. );