Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#56019 closed defect (bug) (fixed)

Add prepare_links method to WP_REST_Post_Types_Controller

Reported by: spacedmonkey's profile spacedmonkey Owned by: spacedmonkey's profile spacedmonkey
Milestone: 6.1 Priority: normal
Severity: normal Version: 4.7
Component: REST API Keywords: good-first-bug has-patch commit add-to-field-guide
Focuses: rest-api Cc:

Description (last modified by spacedmonkey)

Move link logic to prepare_links method in WP_REST_Post_Types_Controller to bring this controller inline with other controllers.

Change History (14)

#1 @spacedmonkey
2 years ago

  • Description modified (diff)

This ticket was mentioned in PR #2883 on WordPress/wordpress-develop by dlh01.


2 years ago
#2

  • Keywords has-patch added; needs-patch removed

spacedmonkey commented on PR #2883:


2 years ago
#3

@dlh01 Let's keep these as they own tickets.
Can you add some unit tests as well please.

dlh01 commented on PR #2883:


2 years ago
#4

@spacedmonkey Are you saying you want separate PRs for each ticket?

spacedmonkey commented on PR #2883:


2 years ago
#5

@spacedmonkey Are you saying you want separate PRs for each ticket?

Yes please.

This ticket was mentioned in PR #2965 on WordPress/wordpress-develop by dlh01.


2 years ago
#6

dlh01 commented on PR #2883:


2 years ago
#7

@spacedmonkey I've opened #2965 and #2966 for the separate tickets and will close this PR.

I see that post type and taxonomy links are currently being tested in `WP_Test_REST_Post_Types_Controller::check_post_type_obj()` and `WP_Test_REST_Taxonomies_Controller::check_taxonomy_object()`, respectively. Could you elaborate on what kind of test coverage you'd like added?

#8 @spacedmonkey
2 years ago

  • Milestone changed from Future Release to 6.1
  • Owner set to spacedmonkey
  • Status changed from new to assigned

#9 @spacedmonkey
2 years ago

  • Keywords commit added

#10 @spacedmonkey
2 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 53721:

REST API: Add prepare_links method to WP_REST_Post_Types_Controller class.

Move logic to from prepare_item_for_response to prepare_links method to bring WP_REST_Post_Types_Controller class inline with other REST API controllers.

Props Spacedmonkey, timothyblynjacobs, dlh.
Fixes #56019.

spacedmonkey commented on PR #2965:


2 years ago
#11

Committed

This ticket was mentioned in Slack in #core-restapi by spacedmonkey. View the logs.


2 years ago

#13 @milana_cap
2 years ago

  • Keywords add-to-field-guide added

#14 @spacedmonkey
2 years ago

Early draft of a dev note can be found here.

Note: See TracTickets for help on using tickets.