PluginProbe
Gutenberg / 12.1.0
Gutenberg v12.1.0
23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 7.4.0 All 402 releases
gutenberg / lib / compat / wordpress-5.8 / class-wp-block-editor-context.php

class-wp-block-editor-context.php in Gutenberg 12.1.0, at lib/compat/wordpress-5.8/class-wp-block-editor-context.php

36 lines 813 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Blocks API: WP_Block_Editor_Context class
4 *
5 * @package Gutenberg
6 */
7
8 /**
9 * Class representing a current block editor context.
10 *
11 * The expectation is that block editor can have a different set
12 * of requirements on every screen where it is used. This class
13 * allows to define supporting settings that can be used with filters.
14 */
15 final class WP_Block_Editor_Context {
16 /**
17 * Post being edited. Optional.
18 *
19 * @var WP_Post|null
20 */
21 public $post = null;
22
23 /**
24 * Constructor.
25 *
26 * Populates optional properties for a given block editor context.
27 *
28 * @param array $settings The list of optional settings to expose in a given context.
29 */
30 public function __construct( array $settings = array() ) {
31 if ( isset( $settings['post'] ) ) {
32 $this->post = $settings['post'];
33 }
34 }
35 }
36