| | 974 | return has_taxonomy( $tag, 'post_tag', $_post ); |
| | 975 | } |
| | 976 | |
| | 977 | /** |
| | 978 | * Check if the current post has any of given taxonomies. |
| | 979 | * |
| | 980 | * The given tags are checked against the post's tags' term_ids, names and slugs. |
| | 981 | * Taxonomies given as integers will only be checked against the post's taxonomies' term_ids. |
| | 982 | * If no tags are given, determines if post has any taxonomies. |
| | 983 | * |
| | 984 | * Prior to v2.7 of WordPress, tags given as integers would also be checked against the post's tags' names and slugs (in addition to term_ids) |
| | 985 | * Prior to v2.7, this function could only be used in the WordPress Loop. |
| | 986 | * As of 2.7, the function can be used anywhere if it is provided a post ID or post object. |
| | 987 | * |
| | 988 | * @since 3.0.0 |
| | 989 | * |
| | 990 | * @uses is_object_in_term() |
| | 991 | * |
| | 992 | * @param string|int|array $tag Optional. The tag name/term_id/slug or array of them to check for. |
| | 993 | * @param string $taxonomy Optional. The taxonomy to check for. |
| | 994 | * @param int|post object Optional. Post to check instead of the current post. |
| | 995 | * @return bool True if the current post has any of the the given tags (or any tag, if no tag specified). |
| | 996 | */ |
| | 997 | function has_taxonomy( $tag = '', $taxonomy = '', $_post = null ) { |