diff --git a/wp-admin/includes/screen.php b/wp-admin/includes/screen.php
index 48e44c55d4..612eccc52e 100644
--- a/wp-admin/includes/screen.php
+++ b/wp-admin/includes/screen.php
@@ -225,6 +225,15 @@ final class WP_Screen {
*/
public $base;
+ /**
+ * The number of columns to display. Access with get_columns().
+ *
+ * @since 3.4.0
+ * @var int
+ * @access private
+ */
+ private $columns = 0;
+
/**
* The unique ID of the screen.
*
@@ -665,7 +674,7 @@ final class WP_Screen {
public function get_help_sidebar() {
return $this->_help_sidebar;
}
-
+
/**
* Add a sidebar to the contextual help for the screen.
* Call this in template files after admin.php is loaded and before admin-header.php is loaded to add a sidebar to the contextual help.
@@ -678,6 +687,23 @@ final class WP_Screen {
$this->_help_sidebar = $content;
}
+ /**
+ * Gets the number of layout columns the user has selected.
+ *
+ * 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.
+ *
+ * @since 3.4.0
+ *
+ * @return int Number of columns to display.
+ */
+ public function get_columns() {
+ return $this->columns;
+ }
+
/**
* Render the screen's help section.
*
@@ -773,6 +799,22 @@ final class WP_Screen {