Make WordPress Core


Ignore:
Timestamp:
09/20/2022 04:27:44 PM (3 years ago)
Author:
jorgefilipecosta
Message:

Editor: Add post types property to wp-rest-block-patterns-controller.php.

Backports PHP changes in WordPress/gutenberg#41791 to the core. Adds the post types property to the rest API patterns endpoint.

Props mcsf, ntsekouras, matveb.
See #56467.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-block-patterns-controller.php

    r53302 r54263  
    125125            'viewportWidth' => 'viewport_width',
    126126            'blockTypes'    => 'block_types',
     127            'postTypes'     => 'post_types',
    127128            'categories'    => 'categories',
    128129            'keywords'      => 'keywords',
     
    186187                    'context'     => array( 'view', 'edit', 'embed' ),
    187188                ),
     189                'post_types'     => array(
     190                    'description' => __( ' An array of post types that the pattern is restricted to be used with.' ),
     191                    'type'        => 'array',
     192                    'readonly'    => true,
     193                    'context'     => array( 'view', 'edit', 'embed' ),
     194                ),
    188195                'categories'     => array(
    189196                    'description' => __( 'The pattern category slugs.' ),
Note: See TracChangeset for help on using the changeset viewer.