WP_Screen::get_columns() WordPress Method

The WP_Screen::get_columns() method is used to get the columns for a screen. This is typically used to add columns for a custom post type.

WP_Screen::get_columns() #

Gets the number of layout columns the user has selected.


Description

The layout_columns option controls the max number and default number of columns. This method returns the number of columns within that range selected by the user via Screen Options. If no selection has been made, the default provisioned in layout_columns is returned. If the screen does not support selecting the number of layout columns, 0 is returned.


Top ↑

Return

(int) Number of columns to display.


Top ↑

Source

File: wp-admin/includes/class-wp-screen.php

	public function get_columns() {
		return $this->columns;
	}


Top ↑

Changelog

Changelog
VersionDescription
3.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.