WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/18/2018 11:53:49 AM (2 years ago)
Author:
pento
Message:

Blocks: Parse blocks when displaying posts.

Posts containing blocks are now correctly handled when displaying on the front end, including dynamic blocks and nested blocks.

See #45109.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/tests/phpunit/includes/functions.php

    r41966 r43752  
    183183// Cannot modify header information - headers already sent by ...
    184184tests_add_filter( 'send_auth_cookies', '__return_false' );
     185
     186/**
     187 * After the init action has been run once, trying to re-register block types can cause
     188 * _doing_it_wrong warnings. To avoid this, unhook the block registration functions.
     189 *
     190 * @since 5.0.0
     191 */
     192function _unhook_block_registration() {
     193    remove_action( 'init', 'register_block_core_archives' );
     194    remove_action( 'init', 'register_block_core_categories' );
     195    remove_action( 'init', 'register_block_core_latest_posts' );
     196    remove_action( 'init', 'register_block_core_shortcode' );
     197}
     198tests_add_filter( 'init', '_unhook_block_registration', 1000 );
Note: See TracChangeset for help on using the changeset viewer.