Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7d192d8
Initial commit.
ramonjd Nov 23, 2023
d7b4c1c
Adding title to schema.
ramonjd Nov 23, 2023
41c98a5
Remove permissions checks and favour parent's
ramonjd Nov 23, 2023
59d6953
Remove duplicated tests
ramonjd Nov 23, 2023
dbcc3b5
Reverting post type registration changes as it assigns an autosave co…
ramonjd Nov 23, 2023
25cbe83
Regenerated fixture
ramonjd Nov 23, 2023
e9d1f10
Revert introducing title in schema
ramonjd Nov 23, 2023
ec4229f
Reinstating global styles revision controller tests that were duplica…
ramonjd Jan 3, 2024
ca524b2
Update src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles…
ramonjd Dec 22, 2023
93190ae
Excluding search, include and exclude from the collection query params
ramonjd Jan 3, 2024
b43344d
Now that https://github.com/WordPress/wordpress-develop/pull/5655 has…
ramonjd Jan 31, 2024
dac8e0b
Pulling across changes from https://github.com/WordPress/wordpress-de…
ramonjd Feb 7, 2024
acd2590
Implementing latest round of feedback:
ramonjd Feb 8, 2024
dfa02f8
Apply suggestions from code review
spacedmonkey Feb 13, 2024
f6f45e3
Fix lints
jonnynews Feb 13, 2024
038331b
Remove ideas
jonnynews Feb 13, 2024
6c7a149
Merge branch 'trunk' into update/global-styles-revision-extends-revis…
jonnynews Feb 13, 2024
95db1e9
Fix
jonnynews Feb 13, 2024
9fb3e30
Add allow_batch parameter.
jonnynews Feb 13, 2024
319bdff
Be overly safe with `__construct` method.
jonnynews Feb 13, 2024
095c7d0
Apply suggestions from code review
spacedmonkey Feb 13, 2024
1fef997
Add 'allow_batch' option to API endpoints in WP API
jonnynews Feb 13, 2024
70d68da
Update version annotations for wp_global_styles related changes
spacedmonkey May 20, 2024
c62fed9
Simplify unset function calls in global styles revisions controller
spacedmonkey May 20, 2024
cc916ac
Merge branch 'trunk' into update/global-styles-revision-extends-revis…
spacedmonkey May 23, 2024
7c526bd
Disable autosave for global styles in WordPress
spacedmonkey May 23, 2024
fe4fc65
Remove redundant comment in wp-post-type.php
spacedmonkey May 23, 2024
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
Prev Previous commit
Next Next commit
Adding title to schema.
  • Loading branch information
ramonjd committed Feb 7, 2024
commit d7b4c1ca9e148bb4d370f2a36c4d52d1eb35ae19
Original file line number Diff line number Diff line change
Expand Up @@ -391,24 +391,13 @@ public function get_item_schema() {
return $this->add_additional_fields_schema( $this->schema );
}

// Adds settings and styles from the WP_REST_Revisions_Controller item fields.
$schema = parent::get_item_schema();

// Adds settings and styles from the WP_REST_Global_Styles_Controller parent schema.
$schema['properties']['styles'] = array(
'description' => __( 'Global styles.' ),
'type' => array( 'object' ),
'context' => array( 'view', 'edit' ),
);

$schema['properties']['settings'] = array(
'description' => __( 'Global settings.' ),
'type' => array( 'object' ),
'context' => array( 'view', 'edit' ),
);
$schema = parent::get_item_schema();
$parent_schema = $this->parent_controller->get_item_schema();
$schema['properties'] = array_merge( $schema['properties'], $parent_schema['properties'] );

unset( $schema['properties']['guid'] );
unset( $schema['properties']['slug'] );
unset( $schema['properties']['meta'] );

$this->schema = $schema;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,10 @@ public function test_get_item_schema() {
$data = $response->get_data();
$properties = $data['schema']['properties'];

$this->assertCount( 9, $properties, 'Schema properties array has exactly 9 elements.' );
$this->assertCount( 10, $properties, 'Schema properties array has exactly 9 elements.' );
$this->assertArrayHasKey( 'id', $properties, 'Schema properties array has "id" key.' );
$this->assertArrayHasKey( 'styles', $properties, 'Schema properties array has "styles" key.' );
$this->assertArrayHasKey( 'title', $properties, 'Schema properties array has "title" key.' );
$this->assertArrayHasKey( 'settings', $properties, 'Schema properties array has "settings" key.' );
$this->assertArrayHasKey( 'parent', $properties, 'Schema properties array has "parent" key.' );
$this->assertArrayHasKey( 'author', $properties, 'Schema properties array has "author" key.' );
Expand Down