Make WordPress Core

Opened 5 years ago

Last modified 5 years ago

#49555 new enhancement

Reorder WP_Query methods for a more logical placement

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by:
Milestone: Future Release Priority: normal
Severity: trivial Version:
Component: Query Keywords:
Focuses: Cc:

Description

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 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.phpIn 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()

Change History (1)

#1 @SergeyBiryukov
5 years ago

Notes:

Note: See TracTickets for help on using tickets.