wp_ajax_hidden_columns

Ajax handler for hidden columns.

Description

wp_ajax_hidden_columns(); 

Usage

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

Defined (1)

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

/wp-admin/includes/ajax-actions.php  
  1. function wp_ajax_hidden_columns() { 
  2. check_ajax_referer( 'screen-options-nonce', 'screenoptionnonce' ); 
  3. $page = isset( $_POST['page'] ) ? $_POST['page'] : ''; 
  4.  
  5. if ( $page != sanitize_key( $page ) ) 
  6. wp_die( 0 ); 
  7.  
  8. if ( ! $user = wp_get_current_user() ) 
  9. wp_die( -1 ); 
  10.  
  11. $hidden = ! empty( $_POST['hidden'] ) ? explode( ', ', $_POST['hidden'] ) : array(); 
  12. update_user_option( $user->ID, "manage{$page}columnshidden", $hidden, true ); 
  13.  
  14. wp_die( 1 );