Make WordPress Core


Ignore:
Timestamp:
02/01/2023 03:00:19 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve documentation for block pattern properties.

Includes:

  • Adding the templateTypes property to the WP_Block_Patterns_Registry::register() DocBlock.
  • Adding @since notes for the postTypes and templateTypes properties to:
    • _register_theme_block_patterns()
    • WP_Block_Patterns_Registry::register()
  • Bringing some consistency to the order of properties between:
    • _register_theme_block_patterns()
    • WP_Block_Patterns_Registry::register()
    • WP_REST_Block_Patterns_Controller::prepare_item_for_response()
    • WP_REST_Block_Patterns_Controller::get_item_schema()

Follow-up to [52943], [53152], [54263], [55168].

See #56792.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/wpRestBlockPatternsController.php

    r55168 r55173  
    7979                        array(
    8080                                'title'         => 'Pattern One',
     81                                'content'       => '<!-- wp:heading {"level":1} --><h1>One</h1><!-- /wp:heading -->',
     82                                'viewportWidth' => 1440,
    8183                                'categories'    => array( 'test' ),
    82                                 'viewportWidth' => 1440,
    83                                 'content'       => '<!-- wp:heading {"level":1} --><h1>One</h1><!-- /wp:heading -->',
    8484                                'templateTypes' => array( 'page' ),
    8585                        )
    … …  
    9090                        array(
    9191                                'title'         => 'Pattern Two',
     92                                'content'       => '<!-- wp:paragraph --><p>Two</p><!-- /wp:paragraph -->',
    9293                                'categories'    => array( 'test' ),
    93                                 'content'       => '<!-- wp:paragraph --><p>Two</p><!-- /wp:paragraph -->',
    9494                                'templateTypes' => array( 'single' ),
    9595                        )
    … …  
    100100                        array(
    101101                                'title'      => 'Pattern Three',
     102                                'content'    => '<!-- wp:paragraph --><p>Three</p><!-- /wp:paragraph -->',
    102103                                'categories' => array( 'test', 'buttons', 'query' ),
    103                                 'content'    => '<!-- wp:paragraph --><p>Three</p><!-- /wp:paragraph -->',
    104104                        )
    105105                );
Note: See TracChangeset for help on using the changeset viewer.