get_hidden_meta_boxes

Get Hidden Meta Boxes.

Description

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

Returns (array)

Hidden Meta Boxes

Parameters (1)

0. $screen (string|WP_Screen)
Screen identifier

Usage

  1. if ( !function_exists( 'get_hidden_meta_boxes' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/screen.php'; 
  3.  
  4. // Screen identifier 
  5. $screen = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = get_hidden_meta_boxes($screen); 
  9.  

Defined (1)

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

/wp-admin/includes/screen.php  
  1. function get_hidden_meta_boxes( $screen ) { 
  2. if ( is_string( $screen ) ) 
  3. $screen = convert_to_screen( $screen ); 
  4.  
  5. $hidden = get_user_option( "metaboxhidden_{$screen->id}" ); 
  6.  
  7. $use_defaults = ! is_array( $hidden ); 
  8.  
  9. // Hide slug boxes by default 
  10. if ( $use_defaults ) { 
  11. $hidden = array(); 
  12. if ( 'post' == $screen->base ) { 
  13. if ( 'post' == $screen->post_type || 'page' == $screen->post_type || 'attachment' == $screen->post_type ) 
  14. $hidden = array('slugdiv', 'trackbacksdiv', 'postcustom', 'postexcerpt', 'commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv'); 
  15. else 
  16. $hidden = array( 'slugdiv' ); 
  17.  
  18. /** 
  19. * Filters the default list of hidden meta boxes. 
  20. * @since 3.1.0 
  21. * @param array $hidden An array of meta boxes hidden by default. 
  22. * @param WP_Screen $screen WP_Screen object of the current screen. 
  23. */ 
  24. $hidden = apply_filters( 'default_hidden_meta_boxes', $hidden, $screen ); 
  25.  
  26. /** 
  27. * Filters the list of hidden meta boxes. 
  28. * @since 3.3.0 
  29. * @param array $hidden An array of hidden meta boxes. 
  30. * @param WP_Screen $screen WP_Screen object of the current screen. 
  31. * @param bool $use_defaults Whether to show the default meta boxes. 
  32. * Default true. 
  33. */ 
  34. return apply_filters( 'hidden_meta_boxes', $hidden, $screen, $use_defaults );