[wp-trac] [WordPress Trac] #28399: Allow WP_Query to query by comment_count column of CPT/posts table

WordPress Trac noreply at wordpress.org
Fri Jun 16 09:42:48 UTC 2017


#28399: Allow WP_Query to query by comment_count column of CPT/posts table
------------------------------------------+-----------------------------
 Reporter:  ramon fincken                 |       Owner:
     Type:  enhancement                   |      Status:  new
 Priority:  normal                        |   Milestone:  Future Release
Component:  Query                         |     Version:  4.0
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:
------------------------------------------+-----------------------------

Comment (by ramon fincken):

 Rewrote this on WordCamp Europe (Paris) to fit with WP 4.8

 Uploading the patch and unit tests now

 You can use it the integer way:

 {{{
 comment_count = INT
 }}}


 or array

 {{{
 comment_count = ARRAY ( value = INT [, compare = STRING ] )
 }}}


 for instance

 {{{#!php
 <?php
                                 'comment_count' => 1
 }}}


 or
 {{{#!php
 <?php
                                 'comment_count' => array(
                                         'value' => 6,
                                         'compare' => '<'
                                 )
 }}}

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


More information about the wp-trac mailing list