[wp-trac] [WordPress Trac] #22110: Check for current conditional
WordPress Trac
wp-trac at lists.automattic.com
Fri Oct 5 17:41:45 UTC 2012
#22110: Check for current conditional
-------------------------+------------------------------
Reporter: mintindeed | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: trunk
Severity: normal | Resolution:
Keywords: |
-------------------------+------------------------------
Comment (by nacin):
Off the top of my head, I can think of four supersets of other flags:
is_time, is_date, is_archive, is_singular. So, is_time is true when
is_hour, is_minute, or is_second is true. is_date is true when is_day,
is_month, or is_year. is_singular when is_single or is_page. (Also
is_attachment, but when is_attachment is true, is_single XOR is_page is
always true.) is_archive is a superset of a whole bunch of conditionals,
such as is_tag, is_category, is_tax, is_post_type_archive, etc.
I would probably just code around those supersets. It can probably be much
saner than a giant if/elseif/elseif/... statement.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22110#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list