Skip to content

Commit a03205b

Browse files
authored
Merge branch 'WordPress:trunk' into trunk
2 parents b965238 + 51a575c commit a03205b

8 files changed

Lines changed: 1958 additions & 147 deletions

File tree

src/wp-includes/class-wp-view-config-data.php

Lines changed: 625 additions & 0 deletions
Large diffs are not rendered by default.

src/wp-includes/default-filters.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -824,11 +824,13 @@
824824

825825
// View Config API.
826826
foreach ( array( 'page', 'wp_block', 'wp_template_part', 'wp_template' ) as $post_type ) {
827+
// Base definitions run before the default priority, so third-party
828+
// callbacks registered at the default compose on top of them
829+
// regardless of registration order.
827830
add_filter(
828831
"get_entity_view_config_postType_{$post_type}",
829832
"_wp_get_entity_view_config_post_type_{$post_type}",
830-
10,
831-
1
833+
5
832834
);
833835
}
834836

src/wp-includes/rest-api/endpoints/class-wp-rest-view-config-controller.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ public function get_items( $request ) {
154154
$response = array(
155155
'kind' => $kind,
156156
'name' => $name,
157+
'version' => WP_View_Config_Data::LATEST_VERSION,
157158
'default_view' => $this->cast_empty_objects( $config['default_view'], $schema['properties']['default_view'] ),
158159
'default_layouts' => $this->cast_empty_objects( $config['default_layouts'], $schema['properties']['default_layouts'] ),
159160
'view_list' => $this->cast_empty_objects( $config['view_list'], $schema['properties']['view_list'] ),
@@ -267,6 +268,11 @@ public function get_item_schema() {
267268
'type' => 'string',
268269
'readonly' => true,
269270
),
271+
'version' => array(
272+
'description' => __( 'The schema version of the configuration.' ),
273+
'type' => 'integer',
274+
'readonly' => true,
275+
),
270276
'default_view' => array(
271277
'description' => __( 'Default view configuration.' ),
272278
'type' => 'object',

0 commit comments

Comments
 (0)