[wp-trac] [WordPress Trac] #49555: Reorder WP_Query methods for a more logical placement

WordPress Trac noreply at wordpress.org
Sun Mar 1 18:03:02 UTC 2020


#49555: Reorder WP_Query methods for a more logical placement
----------------------------+----------------------------
 Reporter:  SergeyBiryukov  |      Owner:  (none)
     Type:  enhancement     |     Status:  new
 Priority:  normal          |  Milestone:  Future Release
Component:  Query           |    Version:
 Severity:  trivial         |   Keywords:
  Focuses:                  |
----------------------------+----------------------------
 Conditional tag functions were initially ordered alphabetically in the
 source files. With some changes over the years, new functions were
 introduced and placed next to the closest related function. Now the order
 is mixed, and the placement of some individual functions like `is_month()`
 makes no sense in the overall structure.

 It would be helpful if the methods were ordered in a more logical manner,
 perhaps based on the
 [https://developer.wordpress.org/reference/classes/wp_query/#parameters
 Parameters] section of the DevHub reference, though that could also use
 some improvement.

 For the record, the current order is as follows:

 ||=In `wp-includes/query.php`=||=In `wp-includes/class-wp-query.php`=||
 ||`is_archive()`||`::is_archive()`||
 ||`is_post_type_archive()`||`::is_post_type_archive()`||
 ||`is_attachment()`||`::is_attachment()`||
 ||`is_author()`||`::is_author()`||
 ||`is_category()`||`::is_category()`||
 ||`is_tag()`||`::is_tag()`||
 ||`is_tax()`||`::is_tax()`||
 ||(moved to `deprecated.php`)||`::is_comments_popup()`||
 ||`is_date()`||`::is_date()`||
 ||`is_day()`||`::is_day()`||
 ||`is_feed()`||`::is_feed()`||
 ||`is_comment_feed()`||`::is_comment_feed()`||
 ||`is_front_page()`||`::is_front_page()`||
 ||`is_home()`||`::is_home()`||
 ||`is_privacy_policy()`||`::is_privacy_policy()`||
 ||`is_month()`||`::is_month()`||
 ||`is_page()`||`::is_page()`||
 ||`is_paged()`||`::is_paged()`||
 ||`is_preview()`||`::is_preview()`||
 ||`is_robots()`||`::is_robots()`||
 ||`is_favicon()`||`::is_favicon()`||
 ||`is_search()`||`::is_search()`||
 ||`is_single()`||`::is_single()`||
 ||`is_singular()`||`::is_singular()`||
 ||`is_time()`||`::is_time()`||
 ||`is_trackback()`||`::is_trackback()`||
 ||`is_year()`||`::is_year()`||
 ||`is_404()`||`::is_404()`||
 ||`is_embed()`||`::is_embed()`||
 ||`is_main_query()`||`::is_main_query()`||

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


More information about the wp-trac mailing list