Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#54595 closed defect (bug) (fixed)

The get_theme_item method should respect fields param

Reported by: spacedmonkey's profile spacedmonkey Owned by: spacedmonkey's profile spacedmonkey
Milestone: 5.9 Priority: normal
Severity: normal Version: 5.9
Component: REST API Keywords: has-patch has-unit-tests commit
Focuses: rest-api Cc:

Description

The get_theme_item method in the WP_REST_Global_Styles_Controller does not respect the fields param context filtering.

Change History (9)

#2 @hellofromTonya
3 years ago

  • Milestone changed from Awaiting Review to 5.9

As WP_REST_Global_Styles_Controller is introduced in 5.9, moving this into the 5.9 milestone.

peterwilsoncc commented on PR #2027:


3 years ago
#3

The test Tests_Rewrite::test_url_to_postid_custom_post_type failed in PHP 7.2 only, so I have re-run them to see if it was a random error/time based.

Would it be possible to put in some unit tests to ensure the change is working as expected?

#4 @hellofromTonya
3 years ago

  • Keywords needs-unit-tests added

spacedmonkey commented on PR #2027:


3 years ago
#5

Added unit tests.

hellofromtonya commented on PR #2027:


3 years ago
#6

@spacedmonkey These same changes will be needed in Gutenberg to avoid these changes from being overwritten during a backport update.

#7 @hellofromTonya
3 years ago

  • Keywords has-unit-tests commit added; needs-unit-tests removed

Marking PR 2027 for commit.

#8 @spacedmonkey
3 years ago

  • Owner set to spacedmonkey
  • Resolution set to fixed
  • Status changed from new to closed

In 52374:

REST API: Ensure that the get_theme_item method should respect fields param.

Fix the get_theme_item method in the WP_REST_Global_Styles_Controller class to respect the fields param context filtering and to return links.

Props spacedmonkey, hellofromtonya, peterwilsoncc, costdev.
Fixes #54595.

spacedmonkey commented on PR #2027:


3 years ago
#9

Merged!

Note: See TracTickets for help on using tickets.