mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 21:08:44 +01:00
REST API: Add inserter
field to the schema of Patterns endpoint
Backports changes from https://github.com/WordPress/gutenberg/pull/40416. Adds the missing `inserter` field to the Patterns item schema. This field was omitted from the response, and patterns that should be hidden in the inserter were visible. Props mamaduka, ndiego. See #55567. Follow-up [53152]. git-svn-id: https://develop.svn.wordpress.org/trunk@53210 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
699853bbc4
commit
e8df37e341
@ -127,6 +127,7 @@ class WP_REST_Block_Patterns_Controller extends WP_REST_Controller {
|
||||
'categories' => 'categories',
|
||||
'keywords' => 'keywords',
|
||||
'content' => 'content',
|
||||
'inserter' => 'inserter',
|
||||
);
|
||||
$data = array();
|
||||
foreach ( $keys as $item_key => $rest_key ) {
|
||||
@ -202,6 +203,12 @@ class WP_REST_Block_Patterns_Controller extends WP_REST_Controller {
|
||||
'readonly' => true,
|
||||
'context' => array( 'view', 'edit', 'embed' ),
|
||||
),
|
||||
'inserter' => array(
|
||||
'description' => __( 'Determines whether the pattern is visible in inserter.' ),
|
||||
'type' => 'boolean',
|
||||
'readonly' => true,
|
||||
'context' => array( 'view', 'edit', 'embed' ),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user