[wp-trac] [WordPress Trac] #56272: REST API: Prime post caches in comments in endpoint.

WordPress Trac noreply at wordpress.org
Fri Jul 22 17:55:43 UTC 2022


#56272: REST API: Prime post caches in comments in endpoint.
--------------------------+----------------------------
 Reporter:  spacedmonkey  |      Owner:  (none)
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  Future Release
Component:  REST API      |    Version:  4.7
 Severity:  normal        |   Keywords:
  Focuses:  performance   |
--------------------------+----------------------------
 In the `WP_REST_Comments_Controller` class, there are multiple calls to
 the comment's post, why calling get_post like this,

 {{{#!php
    $post = get_post( (int) $comment->comment_post_ID );
 }}}

 Post caches should be primed using the `update_comment_post_cache` param.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56272>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list