Make WordPress Core


Ignore:
Timestamp:
12/13/2018 06:11:10 PM (6 years ago)
Author:
desrosj
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.

Props pento.

Merges [43752] to trunk.

See #45109.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/tests/phpunit/includes/functions.php

    r43555 r44118  
    213213// Cannot modify header information - headers already sent by ...
    214214tests_add_filter( 'send_auth_cookies', '__return_false' );
     215
     216/**
     217 * After the init action has been run once, trying to re-register block types can cause
     218 * _doing_it_wrong warnings. To avoid this, unhook the block registration functions.
     219 *
     220 * @since 5.0.0
     221 */
     222function _unhook_block_registration() {
     223    remove_action( 'init', 'register_block_core_archives' );
     224    remove_action( 'init', 'register_block_core_categories' );
     225    remove_action( 'init', 'register_block_core_latest_posts' );
     226    remove_action( 'init', 'register_block_core_shortcode' );
     227}
     228tests_add_filter( 'init', '_unhook_block_registration', 1000 );
Note: See TracChangeset for help on using the changeset viewer.