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

@@ -133,6 +133,7 @@ require dirname( __FILE__ ) . '/exceptions.php';
require dirname( __FILE__ ) . '/utils.php';
require dirname( __FILE__ ) . '/spy-rest-server.php';
require dirname( __FILE__ ) . '/class-wp-rest-test-search-handler.php';
require dirname( __FILE__ ) . '/class-wp-fake-block-type.php';
/**
* A child class of the PHP test runner.