diff options
author | Greg Ziółkowski <gziolo@git.wordpress.org> | 2022-04-19 09:39:42 +0000 |
---|---|---|
committer | Greg Ziółkowski <gziolo@git.wordpress.org> | 2022-04-19 09:39:42 +0000 |
commit | e8df37e34125a58996bbcd45e3b2eab201908dc5 (patch) | |
tree | 689f6c35713bd8852c7840a49f8aefe0342cc22c /src/wp-includes/rest-api/endpoints/class-wp-rest-block-patterns-controller.php | |
parent | 699853bbc485f8ddcb7fce21f4f5245ee599c6d8 (diff) | |
download | wordpress-e8df37e34125a58996bbcd45e3b2eab201908dc5.tar.gz wordpress-e8df37e34125a58996bbcd45e3b2eab201908dc5.zip |
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
Diffstat (limited to 'src/wp-includes/rest-api/endpoints/class-wp-rest-block-patterns-controller.php')
-rw-r--r-- | src/wp-includes/rest-api/endpoints/class-wp-rest-block-patterns-controller.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-block-patterns-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-block-patterns-controller.php index 1f1bf679c8..99fb67a06a 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-block-patterns-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-block-patterns-controller.php @@ -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' ), + ), ), ); |