[wp-trac] [WordPress Trac] #45800: Add short circuits for WP_Comment_Query

WordPress Trac noreply at wordpress.org
Wed Jun 12 12:38:52 UTC 2019


#45800: Add short circuits for WP_Comment_Query
--------------------------------------+------------------------------
 Reporter:  spacedmonkey              |       Owner:  adamsilverstein
     Type:  enhancement               |      Status:  assigned
 Priority:  normal                    |   Milestone:  5.3
Component:  Comments                  |     Version:  3.1
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------------------

Comment (by felipeelia):

 Hi @spacedmonkey!

 I gave a look at your patch (trying to understand the differences between
 mine and yours) and there are some database queries running even when the
 filter is used, probably because it's caching the results.

 Also, it looks like as it's always getting only an array of ints -- due to
 that `$comment_ids = array_map( 'intval', $comment_ids );` -- the user
 will be forced to hook again into the_comments to pass the correct
 comments. I don't know if that is intentional or if I'm missing something
 here though.

 Just to clarify and make things easier to @adamsilverstein (or whoever
 will review this ticket), my patch was made based on #44169 solution :)

 Thanks!

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45800#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list