wp_ajax_update_welcome_panel

Ajax handler for updating whether to display the welcome panel.

Description

wp_ajax_update_welcome_panel(); 

Usage

  1. if ( !function_exists( 'wp_ajax_update_welcome_panel' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/ajax-actions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_ajax_update_welcome_panel(); 
  7.  

Defined (1)

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

/wp-admin/includes/ajax-actions.php  
  1. function wp_ajax_update_welcome_panel() { 
  2. check_ajax_referer( 'welcome-panel-nonce', 'welcomepanelnonce' ); 
  3.  
  4. if ( ! current_user_can( 'edit_theme_options' ) ) 
  5. wp_die( -1 ); 
  6.  
  7. update_user_meta( get_current_user_id(), 'show_welcome_panel', empty( $_POST['visible'] ) ? 0 : 1 ); 
  8.  
  9. wp_die( 1 );