Commit 893f17b4b1 for wordpress.org

commit 893f17b4b14d09f216b47a282bff3e4c9a5a88e8
Author: Weston Ruter <weston@xwp.co>
Date:   Tue Nov 25 02:20:32 2025 +0000

    Docs: Improve docblocks and types for `WP_Screen` properties.

    * Correctly hint that `WP_Screen::$_show_screen_options` is null before being instantiated.
    * Correctly hint that `::get_option()`, `get_help_tab()` and `get_screen_reader_text()` can return null.
    * Ensure `$this->columns` is an `int`, by casting `$this->get_option( 'layout_columns', 'default' )` from its numeric string.

    Developed in https://github.com/WordPress/wordpress-develop/pull/8860

    Props justlevine, peterwilsoncc, westonruter.
    See #64238, #64224.

    Built from https://develop.svn.wordpress.org/trunk@61300


    git-svn-id: http://core.svn.wordpress.org/trunk@60612 1a063a9b-81f0-0310-95a4-ce76da25c4cd

diff --git a/wp-admin/includes/class-wp-screen.php b/wp-admin/includes/class-wp-screen.php
index 60a82476c1..c1f4a1be04 100644
--- a/wp-admin/includes/class-wp-screen.php
+++ b/wp-admin/includes/class-wp-screen.php
@@ -175,8 +175,10 @@ final class WP_Screen {
 	/**
 	 * Stores the result of the public show_screen_options function.
 	 *
+	 * Set when calling {@see self::show_screen_options()} for the first time.
+	 *
 	 * @since 3.3.0
-	 * @var bool
+	 * @var ?bool
 	 */
 	private $_show_screen_options;

@@ -545,7 +547,7 @@ final class WP_Screen {
 	 * @param string       $option Option name.
 	 * @param string|false $key    Optional. Specific array key for when the option is an array.
 	 *                             Default false.
-	 * @return string The option value if set, null otherwise.
+	 * @return ?string The option value if set, null otherwise.
 	 */
 	public function get_option( $option, $key = false ) {
 		if ( ! isset( $this->_options[ $option ] ) ) {
@@ -598,7 +600,7 @@ final class WP_Screen {
 	 * @since 3.4.0
 	 *
 	 * @param string $id Help Tab ID.
-	 * @return array Help tab arguments.
+	 * @return ?array Help tab arguments, or null if no help tabs added.
 	 */
 	public function get_help_tab( $id ) {
 		if ( ! isset( $this->_help_tabs[ $id ] ) ) {
@@ -733,7 +735,7 @@ final class WP_Screen {
 	 * @since 4.4.0
 	 *
 	 * @param string $key Screen reader text array named key.
-	 * @return string Screen reader text string.
+	 * @return ?string Screen reader text string, or null if no text is associated with the key.
 	 */
 	public function get_screen_reader_text( $key ) {
 		if ( ! isset( $this->_screen_reader_content[ $key ] ) ) {
@@ -949,8 +951,9 @@ final class WP_Screen {
 		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' );
+			$layout_columns = (int) $this->get_option( 'layout_columns', 'default' );
+			if ( ! $this->columns && $layout_columns ) {
+				$this->columns = $layout_columns;
 			}
 		}
 		$GLOBALS['screen_layout_columns'] = $this->columns; // Set the global for back-compat.
diff --git a/wp-includes/version.php b/wp-includes/version.php
index c3b6f89817..282f058298 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
  *
  * @global string $wp_version
  */
-$wp_version = '7.0-alpha-61299';
+$wp_version = '7.0-alpha-61300';

 /**
  * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.