[wp-trac] [WordPress Trac] #18636: is_tax() returns false when is_category() or is_tag() returns true

WordPress Trac noreply at wordpress.org
Sat Aug 13 22:15:14 UTC 2016


#18636: is_tax() returns false when is_category() or is_tag() returns true
--------------------------+----------------------
 Reporter:  Viper007Bond  |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Taxonomy      |     Version:  3.3
 Severity:  normal        |  Resolution:  wontfix
 Keywords:  has-patch     |     Focuses:
--------------------------+----------------------

Comment (by danieliser):

 Agree with @ericmann. Sorry @nacin but this is semantically and logically
 wrong as it stands now.

 Based on your reasoning, get_taxonomies() should also exclude category &
 post_tags by default, yet it doesn't.

 In reguards to all the plugins & themes out there that may break, I
 disagree. In fact sicne they are already checking for is_category nothing
 would break.

 Instead though this change would remove the requirement to check
 specifically for tag & categories.

 If you are looping through all taxnomies using the core get_taxonomies
 method you currently have to check all 3 is_ functions, rather than simply
 being able to run is_tax( $tax ).

 Just because its been that way for a long time is not a good excuse to not
 fix it for the future. This could easily be fixed in a backward compatible
 way, and still give plenty of notice to existing themes & plugins.

 I would also argue if they wrote their code properly in the first place
 they won't see any breakage at all. I know my code wouldn't break due to
 this, but it sure would get simpler & easier to understand.

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


More information about the wp-trac mailing list