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.

git-svn-id: https://develop.svn.wordpress.org/trunk@44118 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers
2018-12-13 18:11:10 +00:00
parent 6aef7e1966
commit 93091fac36
71 changed files with 1419 additions and 24 deletions

View File

@@ -212,3 +212,17 @@ function _wp_rest_server_class_filter() {
// Skip `setcookie` calls in auth_cookie functions due to warning:
// Cannot modify header information - headers already sent by ...
tests_add_filter( 'send_auth_cookies', '__return_false' );
/**
* After the init action has been run once, trying to re-register block types can cause
* _doing_it_wrong warnings. To avoid this, unhook the block registration functions.
*
* @since 5.0.0
*/
function _unhook_block_registration() {
remove_action( 'init', 'register_block_core_archives' );
remove_action( 'init', 'register_block_core_categories' );
remove_action( 'init', 'register_block_core_latest_posts' );
remove_action( 'init', 'register_block_core_shortcode' );
}
tests_add_filter( 'init', '_unhook_block_registration', 1000 );