Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: screen_layout_columns

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
916            * This hook provides back-compat for plugins using the back-compat
917            * filter instead of add_screen_option().
918            *
919            * @since 2.8.0
920            *
921            * @param array     $empty_columns Empty array.
922            * @param string    $screen_id     Screen ID.
923            * @param WP_Screen $this          Current WP_Screen instance.
924            */
925           $columns = apply_filters( 'screen_layout_columns', array(), $this->id, $this );
926
927           if ( ! empty( $columns ) && isset( $columns[ $this->id ] ) )
928                $this->add_option( 'layout_columns', array('max' => $columns[ $this->id ] ) );
929
930           if ( $this->get_option( 'layout_columns' ) ) {
931                $this->columns = (int) get_user_option("screen_layout_$this->id");
932
933                if ( ! $this->columns && $this->get_option( 'layout_columns', 'default' ) )
934                     $this->columns = $this->get_option( 'layout_columns', 'default' );