WordPress.org

Make WordPress Core

Changeset 44108


Ignore:
Timestamp:
12/13/2018 09:43:29 AM (2 years ago)
Author:
pento
Message:

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.

Location:
trunk
Files:
3 edited
5 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/wp-settings.php

    r44107 r44108  
    245245require( ABSPATH . WPINC . '/rest-api/search/class-wp-rest-search-handler.php' );
    246246require( ABSPATH . WPINC . '/rest-api/search/class-wp-rest-post-search-handler.php' );
     247require( ABSPATH . WPINC . '/class-wp-block-type.php' );
     248require( ABSPATH . WPINC . '/class-wp-block-type-registry.php' );
     249require( ABSPATH . WPINC . '/blocks.php' );
    247250
    248251$GLOBALS['wp_embed'] = new WP_Embed();
  • trunk/tests/phpunit/includes/bootstrap.php

    r44107 r44108  
    134134require dirname( __FILE__ ) . '/spy-rest-server.php';
    135135require dirname( __FILE__ ) . '/class-wp-rest-test-search-handler.php';
     136require dirname( __FILE__ ) . '/class-wp-fake-block-type.php';
    136137
    137138/**
Note: See TracChangeset for help on using the changeset viewer.