Editor: Add missing class WP_Block_Editor_Context

Follow-up for [50956].
See #52920.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
gziolo 2021-05-24 07:38:58 +00:00
parent 4ae98860b9
commit 3989828e0b
2 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,42 @@
<?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'];
}
}
}

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.8-alpha-50956';
$wp_version = '5.8-alpha-50957';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.