Making WordPress.org

Changeset 12301


Ignore:
Timestamp:
12/07/2022 06:33:40 AM (2 years ago)
Author:
dd32
Message:

Support Forums: Blocks: Whitelist the core/image and core/embed blocks server-side in addition to in the editor.

See #6608.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-blocks.php

    r12300 r12301  
    2828        add_filter( 'blocks_everywhere_editor_settings', [ $this, 'editor_settings' ] );
    2929
     30        // Enable the blocks on the server-side.
     31        add_filter( 'blocks_everywhere_allowed_blocks', [ $this, 'allowed_blocks' ] );
     32
    3033        // Allow the oEmbed proxy endpoint for any user who can publish a thread/reply..
    3134        add_filter( 'rest_api_init', [ $this, 'overwrite_oembed_10_proxy_permission' ], 20 );
     
    4548        // This will make embeds resize properly.
    4649        add_theme_support( 'responsive-embeds' );
     50    }
     51
     52    public function allowed_blocks( $blocks ) {
     53        // See ::editor_settings();
     54        $blocks[] = 'core/image';
     55        $blocks[] = 'core/embed';
     56
     57        return array_unique( $blocks );
    4758    }
    4859
Note: See TracChangeset for help on using the changeset viewer.