Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#14495 closed enhancement (invalid)

Why was is_term() deprecated?

Reported by: acondiff Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0.1
Component: Taxonomy Keywords: is_term()
Focuses: Cc:


Why was is_term() deprecated? I think it could be a very useful conditional statement. In the WP codex it says to replace it with term_exists() but that only checks if it is in existence. Any thoughts on this?

Change History (1)

comment:1 nacin4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

is_term() was not a conditional statement. It was a check to see whether a term existed. Thus, it was renamed to term_exists().

The same goes for is_post_type() and is_taxonomy(). They were not conditionals, and were renamed post_type_exists() and taxonomy_exists().

For conditional statements, you'll want is_singular( $post_type ) and is_tax( $taxonomy, $term = optional ).

Note: See TracTickets for help on using tickets.