Make WordPress Core

Opened 7 weeks ago

Closed 6 weeks ago

Last modified 6 weeks ago

#54595 closed defect (bug) (fixed)

The get_theme_item method should respect fields param

Reported by: spacedmonkey Owned by: 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
7 weeks 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.

#3 @prbot
7 weeks ago

peterwilsoncc commented on PR #2027:

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
7 weeks ago

  • Keywords needs-unit-tests added

#5 @prbot
6 weeks ago

spacedmonkey commented on PR #2027:

Added unit tests.

#6 @prbot
6 weeks ago

hellofromtonya commented on PR #2027:

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

#7 @hellofromTonya
6 weeks ago

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

Marking PR 2027 for commit.

#8 @spacedmonkey
6 weeks 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.

#9 @prbot
6 weeks ago

spacedmonkey commented on PR #2027:

Merged!

Note: See TracTickets for help on using tickets.