@@ -175,8 +175,10 @@ final class WP_Screen {
175175 /**
176176 * Stores the result of the public show_screen_options function.
177177 *
178+ * Set when calling {@see self::show_screen_options()} for the first time.
179+ *
178180 * @since 3.3.0
179- * @var bool
181+ * @var ? bool
180182 */
181183 private $ _show_screen_options ;
182184
@@ -545,7 +547,7 @@ public function get_options() {
545547 * @param string $option Option name.
546548 * @param string|false $key Optional. Specific array key for when the option is an array.
547549 * Default false.
548- * @return string The option value if set, null otherwise.
550+ * @return ? string The option value if set, null otherwise.
549551 */
550552 public function get_option ( $ option , $ key = false ) {
551553 if ( ! isset ( $ this ->_options [ $ option ] ) ) {
@@ -598,7 +600,7 @@ public function get_help_tabs() {
598600 * @since 3.4.0
599601 *
600602 * @param string $id Help Tab ID.
601- * @return array Help tab arguments.
603+ * @return ? array Help tab arguments, or null if no help tabs added .
602604 */
603605 public function get_help_tab ( $ id ) {
604606 if ( ! isset ( $ this ->_help_tabs [ $ id ] ) ) {
@@ -733,7 +735,7 @@ public function get_screen_reader_content() {
733735 * @since 4.4.0
734736 *
735737 * @param string $key Screen reader text array named key.
736- * @return string Screen reader text string.
738+ * @return ? string Screen reader text string, or null if no text is associated with the key .
737739 */
738740 public function get_screen_reader_text ( $ key ) {
739741 if ( ! isset ( $ this ->_screen_reader_content [ $ key ] ) ) {
@@ -949,8 +951,9 @@ public function render_screen_meta() {
949951 if ( $ this ->get_option ( 'layout_columns ' ) ) {
950952 $ this ->columns = (int ) get_user_option ( "screen_layout_ $ this ->id " );
951953
952- if ( ! $ this ->columns && $ this ->get_option ( 'layout_columns ' , 'default ' ) ) {
953- $ this ->columns = $ this ->get_option ( 'layout_columns ' , 'default ' );
954+ $ layout_columns = (int ) $ this ->get_option ( 'layout_columns ' , 'default ' );
955+ if ( ! $ this ->columns && $ layout_columns ) {
956+ $ this ->columns = $ layout_columns ;
954957 }
955958 }
956959 $ GLOBALS ['screen_layout_columns ' ] = $ this ->columns ; // Set the global for back-compat.
0 commit comments