#56272 closed enhancement (fixed)
REST API: Prime post caches in comments in endpoint.
| Reported by: | spacedmonkey | Owned by: | peterwilsoncc |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.1 |
| Component: | REST API | Version: | 4.7 |
| Severity: | normal | Keywords: | has-patch commit has-dev-note |
| Cc: | Focuses: | performance |
Description
In the WP_REST_Comments_Controller class, there are multiple calls to the comment's post, why calling get_post like this,
$post = get_post( (int) $comment->comment_post_ID );
Post caches should be primed using the update_comment_post_cache param.
Attachments (2)
Change History (13)
This ticket was mentioned in PR #3014 on WordPress/wordpress-develop by spacedmonkey.
4 years ago
#1
- Keywords has-patch added
Trac ticket: https://core.trac.wordpress.org/ticket/56272
TimothyBJacobs commented on PR #3014:
4 years ago
#2
Aside from the CS issue, looks good to merge to me.
#4
@
4 years ago
- Milestone Future Release → 6.1
- Owner changed from to
I think this can go in 6.1.
I've self assigned it for commit as Jonny is AFK for the next few weeks.
peterwilsoncc commented on PR #3014:
4 years ago
#6
Committed in https://core.trac.wordpress.org/changeset/53772 (c1cf07e4e30cf0a2fde3f2be0a6983025b3d2062)
#7
@
4 years ago
There are a lot of caching API related changes in 6.1 and a dev note should be written collecting them all. Marking this for inclusion.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Before