mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-06 23:58:03 +00:00
Editor: rename sync_status and move it to top level.
Renames sync_status to wp_pattern_sync_status and moves it to top level field of wp_block post type. Props glendaviesnz, aaronrobertshaw, mukesh27, peterwilsoncc. Fixes 58677. git-svn-id: https://develop.svn.wordpress.org/trunk@56160 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -40,6 +40,7 @@ class WP_REST_Blocks_Controller extends WP_REST_Posts_Controller {
|
||||
* Filters a response based on the context defined in the schema.
|
||||
*
|
||||
* @since 5.0.0
|
||||
* @since 6.3 Adds the `wp_pattern_sync_status` postmeta property to the top level of response.
|
||||
*
|
||||
* @param array $data Response data to filter.
|
||||
* @param string $context Context defined in the schema.
|
||||
@@ -56,6 +57,9 @@ class WP_REST_Blocks_Controller extends WP_REST_Posts_Controller {
|
||||
unset( $data['title']['rendered'] );
|
||||
unset( $data['content']['rendered'] );
|
||||
|
||||
// Add the core wp_pattern_sync_status meta as top level property to the response.
|
||||
$data['wp_pattern_sync_status'] = isset( $data['meta']['wp_pattern_sync_status'] ) ? $data['meta']['wp_pattern_sync_status'] : '';
|
||||
unset( $data['meta']['wp_pattern_sync_status'] );
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user