W3cubDocs

/WordPress

WP_Block_Editor_Context::__construct( array $settings = array() )

Constructor.

Description

Populates optional properties for a given block editor context.

Parameters

$settingsarrayoptional
The list of optional settings to expose in a given context.

Default:array()

Source

public function __construct( array $settings = array() ) {
	if ( isset( $settings['name'] ) ) {
		$this->name = $settings['name'];
	}
	if ( isset( $settings['post'] ) ) {
		$this->post = $settings['post'];
	}
}

Changelog

Version Description
5.8.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_block_editor_context/__construct