Make WordPress Core


Ignore:
Timestamp:
05/17/2021 03:06:27 PM (4 years ago)
Author:
gziolo
Message:

Editor: Remove editor type specific filters for block editor configuration

Aligns with changes introduced in the Gutenberg plugin. The planned follow-up replace the editor name string with a context object to bring back an optional reference to the actual post.

Props youknowriad.
See #52920.

File:
1 edited

Legend:

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

    r50798 r50920  
    121121     */
    122122    $allowed_block_types = apply_filters( 'allowed_block_types_all', $allowed_block_types, $editor_name );
    123 
    124     /**
    125      * Filters the allowed block types for the given editor, defaulting to `true`
    126      * (all registered block types supported).
    127      *
    128      * The dynamic portion of the hook name, `$editor_name`, refers to the name
    129      * of the editor type, e.g. 'post-editor', 'site-editor', etc.
    130      *
    131      * @since 5.8.0
    132      *
    133      * @param bool|array $allowed_block_types Array of block type slugs, or
    134      *                                        boolean to enable/disable all.
    135      * @param string     $editor_name         The name of the editor, e.g. 'post-editor'.
    136      */
    137     $allowed_block_types = apply_filters( "allowed_block_types_{$editor_name}", $allowed_block_types, $editor_name );
    138123    if ( 'post-editor' === $editor_name ) {
    139124        $post = get_post();
     
    268253     */
    269254    $editor_settings = apply_filters( 'block_editor_settings_all', $editor_settings, $editor_name );
    270 
    271     /**
    272      * Filters the settings to pass to the block editor for a given editor type.
    273      *
    274      * The dynamic portion of the hook name, `$editor_name`, refers to the name
    275      * of the editor type, e.g. 'post-editor', 'site-editor', etc.
    276      *
    277      * @since 5.8.0
    278      *
    279      * @param array  $editor_settings Default editor settings.
    280      * @param string $editor_name     The name of the editor, e.g. 'post-editor'.
    281      */
    282     $editor_settings = apply_filters( "block_editor_settings_{$editor_name}", $editor_settings, $editor_name );
    283255    if ( 'post-editor' === $editor_name ) {
    284256        $post = get_post();
Note: See TracChangeset for help on using the changeset viewer.