mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@54263 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -124,6 +124,7 @@ class WP_REST_Block_Patterns_Controller extends WP_REST_Controller {
|
||||
'description' => 'description',
|
||||
'viewportWidth' => 'viewport_width',
|
||||
'blockTypes' => 'block_types',
|
||||
'postTypes' => 'post_types',
|
||||
'categories' => 'categories',
|
||||
'keywords' => 'keywords',
|
||||
'content' => 'content',
|
||||
@@ -185,6 +186,12 @@ class WP_REST_Block_Patterns_Controller extends WP_REST_Controller {
|
||||
'readonly' => true,
|
||||
'context' => array( 'view', 'edit', 'embed' ),
|
||||
),
|
||||
'post_types' => array(
|
||||
'description' => __( ' An array of post types that the pattern is restricted to be used with.' ),
|
||||
'type' => 'array',
|
||||
'readonly' => true,
|
||||
'context' => array( 'view', 'edit', 'embed' ),
|
||||
),
|
||||
'categories' => array(
|
||||
'description' => __( 'The pattern category slugs.' ),
|
||||
'type' => 'array',
|
||||
|
||||
Reference in New Issue
Block a user