WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/22/2020 10:24:42 AM (18 months ago)
Author:
gziolo
Message:

Blocks: Add context fields to WP_Block_Type

New block context related fields were added as part of https://github.com/WordPress/gutenberg/pull/22686. This changest backports them to WP_Block_Type class.

Props aduth, spacedmonkey, mcsf, epiqueras.
Fixes #47656.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-block-type.php

    r48110 r48117  
    7575    /**
    7676     * @since 5.5.0
     77     * @var array|null
     78     */
     79    public $supports = null;
     80
     81    /**
     82     * @since 5.5.0
     83     * @var array|null
     84     */
     85    public $example = null;
     86
     87    /**
     88     * Block type render callback.
     89     *
     90     * @since 5.0.0
     91     * @var callable
     92     */
     93    public $render_callback = null;
     94
     95    /**
     96     * Block type attributes property schemas.
     97     *
     98     * @since 5.0.0
     99     * @var array|null
     100     */
     101    public $attributes = null;
     102
     103    /**
     104     * Context values inherited by blocks of this type.
     105     *
     106     * @since 5.5.0
    77107     * @var array
    78108     */
    79     public $supports = array();
    80 
    81     /**
    82      * @since 5.5.0
    83      * @var array|null
    84      */
    85     public $example = null;
    86 
    87     /**
    88      * Block type render callback.
    89      *
    90      * @since 5.0.0
    91      * @var callable
    92      */
    93     public $render_callback = null;
    94 
    95     /**
    96      * Block type attributes property schemas.
    97      *
    98      * @since 5.0.0
    99      * @var array|null
    100      */
    101     public $attributes = null;
     109    public $uses_context = array();
     110
     111    /**
     112     * Context provided by blocks of this type.
     113     *
     114     * @since 5.5.0
     115     * @var array|null
     116     */
     117    public $provides_context = null;
    102118
    103119    /**
Note: See TracChangeset for help on using the changeset viewer.