Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
625 changes: 625 additions & 0 deletions src/wp-includes/class-wp-view-config-data.php

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/wp-includes/default-filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -824,11 +824,13 @@

// View Config API.
foreach ( array( 'page', 'wp_block', 'wp_template_part', 'wp_template' ) as $post_type ) {
// Base definitions run before the default priority, so third-party
// callbacks registered at the default compose on top of them
// regardless of registration order.
add_filter(
"get_entity_view_config_postType_{$post_type}",
"_wp_get_entity_view_config_post_type_{$post_type}",
10,
1
5
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ public function get_items( $request ) {
$response = array(
'kind' => $kind,
'name' => $name,
'version' => WP_View_Config_Data::LATEST_VERSION,
'default_view' => $this->cast_empty_objects( $config['default_view'], $schema['properties']['default_view'] ),
'default_layouts' => $this->cast_empty_objects( $config['default_layouts'], $schema['properties']['default_layouts'] ),
'view_list' => $this->cast_empty_objects( $config['view_list'], $schema['properties']['view_list'] ),
Expand Down Expand Up @@ -267,6 +268,11 @@ public function get_item_schema() {
'type' => 'string',
'readonly' => true,
),
'version' => array(
'description' => __( 'The schema version of the configuration.' ),
'type' => 'integer',
'readonly' => true,
),
'default_view' => array(
'description' => __( 'Default view configuration.' ),
'type' => 'object',
Expand Down
Loading
Loading