CoreFiles by mySites.guru
class-wp-block-editor-context.php42 lines, 890 bytes, from wordpress-5.9.zip
Raw History Compare with 5.8.19
md5
1f55cd1ef6bc6917b6fd8aab8995f133
sha1
7adf151f973c7cc6363059fcfccd914557920f9e
sha256
0942d327c35cbd6e806d55f9257b319fc20df21488133cdf530e0cf958b6ee4e
<?php
/**
 * Blocks API: WP_Block_Editor_Context class
 *
 * @package WordPress
 * @since 5.8.0
 */

/**
 * Class representing a current block editor context.
 *
 * The expectation is that block editor can have a different set
 * of requirements on every screen where it is used. This class
 * allows to define supporting settings that can be used with filters.
 *
 * @since 5.8.0
 */
final class WP_Block_Editor_Context {
	/**
	 * Post being edited. Optional.
	 *
	 * @since 5.8.0
	 *
	 * @var WP_Post|null
	 */
	public $post = null;

	/**
	 * Constructor.
	 *
	 * Populates optional properties for a given block editor context.
	 *
	 * @since 5.8.0
	 *
	 * @param array $settings The list of optional settings to expose in a given context.
	 */
	public function __construct( array $settings = array() ) {
		if ( isset( $settings['post'] ) ) {
			$this->post = $settings['post'];
		}
	}
}

The same content is in 61 releases, WordPress 5.8-beta1 to 5.9.20. See them all, or every version of this file.