+ // Setup layout columns
+
+ // Back compat for plugins using the filter instead of add_screen_option()
+ $columns = apply_filters( 'screen_layout_columns', array(), $this->id, $this );
+
+ if ( ! empty( $columns ) && isset( $columns[ $this->id ] ) )
+ $this->add_option( 'layout_columns', array('max' => $columns[ $this->id ] ) );
+
+ if ( $this->get_option( 'layout_columns' ) ) {
+ $this->columns = (int) get_user_option("screen_layout_$this->id");
+
+ if ( ! $this->columns && $this->get_option( 'layout_columns', 'default' ) )
+ $this->columns = $this->get_option( 'layout_columns', 'default' );
+ }
+ $GLOBALS[ 'screen_layout_columns' ] = $this->columns; // Set the global for back-compat.
+