screen_layout_columns

Filters the array of screen layout columns.

Description

apply_filters( 'screen_layout_columns', (array) $array, (string) $this_id, (WP_Screen) $instance ); 

This hook provides back-compat for plugins using the back-compat Filters instead of add_screen_option().

Parameters (3)

0. $array (array) => array()
Empty array.
1. $this_id (string)
The this id.
2. $instance (WP_Screen)
Current WP_Screen instance.

Usage

To run the hook, copy the example below.
  1. $array = apply_filters( 'screen_layout_columns', $array, $this_id, $instance ); 
  2.  
  3. if ( !empty( $array ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the screen_layout_columns callback 
  2. function filter_screen_layout_columns( $array, $this_id, $instance ) { 
  3. // make filter magic happen here... 
  4. return $array
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'screen_layout_columns', 'filter_screen_layout_columns', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'screen_layout_columns', 'filter_screen_layout_columns', 10, 3 ); 

Defined (1)

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

/wp-admin/includes/class-wp-screen.php  
  1. $columns = apply_filters( 'screen_layout_columns', array(), $this->id, $this );