WP_Screen::is_block_editor()publicWP 5.0.0

Sets or returns whether the block editor is loading on the current screen.

Method of the class: WP_Screen{}

No Hooks.

Return

true|false. True if the block editor is being loaded, false otherwise.

Usage

$WP_Screen = new WP_Screen();
$WP_Screen->is_block_editor( $set );
$set(true|false)
Sets whether the block editor is loading on the current screen or not.
Default: null

Changelog

Since 5.0.0 Introduced.

WP_Screen::is_block_editor() code WP 6.5.2

public function is_block_editor( $set = null ) {
	if ( null !== $set ) {
		$this->is_block_editor = (bool) $set;
	}

	return $this->is_block_editor;
}