diff --git a/wp-admin/includes/class-wp-screen.php b/wp-admin/includes/class-wp-screen.php index f8e63554ca..f96430984d 100644 --- a/wp-admin/includes/class-wp-screen.php +++ b/wp-admin/includes/class-wp-screen.php @@ -178,6 +178,14 @@ final class WP_Screen { */ private $_screen_settings; + /** + * Whether the screen is using the block editor. + * + * @since 5.0.0 + * @var bool + */ + public $is_block_editor = false; + /** * Fetches a screen object. * @@ -412,6 +420,22 @@ final class WP_Screen { return ( $admin == $this->in_admin ); } + /** + * Sets or returns whether the block editor is loading on the current screen. + * + * @since 5.0.0 + * + * @param bool $set Optional. Sets whether the block editor is loading on the current screen or not. + * @return bool True if the block editor is being loaded, false otherwise. + */ + public function is_block_editor( $set = null ) { + if ( $set !== null ) { + $this->is_block_editor = (bool) $set; + } + + return $this->is_block_editor; + } + /** * Sets the old string-based contextual help for the screen for backward compatibility. * diff --git a/wp-includes/version.php b/wp-includes/version.php index fbfc9039cb..3e9c9ba8d0 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.1-alpha-44129'; +$wp_version = '5.1-alpha-44130'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.