Blocks: Introduce WP_Block_Type and WP_Block_Type_Registry classes.

These are the foundational classes allowing blocks to be registered and used throughout WordPress.

This commit also includes the `has_block()` and `has_blocks()` functions, which are required for unit testing these classes.

Merges [43742] from the 5.0 branch to trunk.

Props adamsilverstein, danielbachhuber, desrosj.
Fixes #45097.
See #45109.


git-svn-id: https://develop.svn.wordpress.org/trunk@44108 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast
2018-12-13 09:43:29 +00:00
parent 5c9c54239d
commit 9254ae4a72
8 changed files with 974 additions and 0 deletions

View File

@@ -244,6 +244,9 @@ require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-term-meta-fields.php'
require( ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-user-meta-fields.php' );
require( ABSPATH . WPINC . '/rest-api/search/class-wp-rest-search-handler.php' );
require( ABSPATH . WPINC . '/rest-api/search/class-wp-rest-post-search-handler.php' );
require( ABSPATH . WPINC . '/class-wp-block-type.php' );
require( ABSPATH . WPINC . '/class-wp-block-type-registry.php' );
require( ABSPATH . WPINC . '/blocks.php' );
$GLOBALS['wp_embed'] = new WP_Embed();