wpcf7_admin_ajax_welcome_panel

The Contact Form 7 wpcf7 admin ajax welcome panel function.

Description

wpcf7_admin_ajax_welcome_panel(); 

Usage

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

Defined (1)

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

/admin/includes/welcome-panel.php  
  1. function wpcf7_admin_ajax_welcome_panel() { 
  2. check_ajax_referer( 'wpcf7-welcome-panel-nonce', 'welcomepanelnonce' ); 
  3.  
  4. $vers = get_user_meta( get_current_user_id(),  
  5. 'wpcf7_hide_welcome_panel_on', true ); 
  6.  
  7. if ( empty( $vers ) || ! is_array( $vers ) ) { 
  8. $vers = array(); 
  9.  
  10. if ( empty( $_POST['visible'] ) ) { 
  11. $vers[] = wpcf7_version( 'only_major=1' ); 
  12.  
  13. $vers = array_unique( $vers ); 
  14.  
  15. update_user_meta( get_current_user_id(), 'wpcf7_hide_welcome_panel_on', $vers ); 
  16.  
  17. wp_die( 1 );