get_hidden_columns

Get a list of hidden columns.

Description

(array) get_hidden_columns( (string|WP_Screen) $screen ); 

Returns (array)

Parameters (1)

0. $screen (string|WP_Screen)
The screen you want the hidden columns for

Usage

  1. if ( !function_exists( 'get_hidden_columns' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/screen.php'; 
  3.  
  4. // The screen you want the hidden columns for 
  5. $screen = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = get_hidden_columns($screen); 
  9.  

Defined (1)

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

/wp-admin/includes/screen.php  
  1. function get_hidden_columns( $screen ) { 
  2. if ( is_string( $screen ) ) { 
  3. $screen = convert_to_screen( $screen ); 
  4.  
  5. $hidden = get_user_option( 'manage' . $screen->id . 'columnshidden' ); 
  6.  
  7. $use_defaults = ! is_array( $hidden ); 
  8.  
  9. if ( $use_defaults ) { 
  10. $hidden = array(); 
  11.  
  12. /** 
  13. * Filters the default list of hidden columns. 
  14. * @since 4.4.0 
  15. * @param array $hidden An array of columns hidden by default. 
  16. * @param WP_Screen $screen WP_Screen object of the current screen. 
  17. */ 
  18. $hidden = apply_filters( 'default_hidden_columns', $hidden, $screen ); 
  19.  
  20. /** 
  21. * Filters the list of hidden columns. 
  22. * @since 4.4.0 
  23. * @since 4.4.1 Added the `use_defaults` parameter. 
  24. * @param array $hidden An array of hidden columns. 
  25. * @param WP_Screen $screen WP_Screen object of the current screen. 
  26. * @param bool $use_defaults Whether to show the default columns. 
  27. */ 
  28. return apply_filters( 'hidden_columns', $hidden, $screen, $use_defaults );