### Eclipse Workspace Patch 1.0
#P wordpress
|
|
|
248 | 248 | * |
249 | 249 | * @since 1.2.0 |
250 | 250 | * |
251 | | * @uses has_term() |
252 | | * |
253 | 251 | * @param int|string|array $category Category ID, name or slug, or array of said. |
254 | 252 | * @param int|object $_post Optional. Post to check instead of the current post. (since 2.7.0) |
255 | 253 | * @return bool True if the current post is in any of the given categories. |
256 | 254 | */ |
257 | 255 | function in_category( $category, $post = null ) { |
258 | | return has_term( $category, 'category', $post ); |
| 256 | return has_term( 'category', $category, $post ); |
259 | 257 | } |
260 | 258 | |
261 | 259 | /** |
… |
… |
|
962 | 960 | * |
963 | 961 | * @since 3.1.0 |
964 | 962 | * |
965 | | * @uses has_term() |
966 | | * |
967 | 963 | * @param string|int|array $tag Optional. The category name/term_id/slug or array of them to check for. |
968 | 964 | * @param int|object $post Optional. Post to check instead of the current post. |
969 | 965 | * @return bool True if the current post has any of the given categories (or any category, if no category specified). |
970 | 966 | */ |
971 | 967 | function has_category( $category = '', $post = null ) { |
972 | | return has_term( $category, 'category', $post ); |
| 968 | return has_term( 'category', $category, $post ); |
973 | 969 | } |
974 | 970 | |
975 | 971 | /** |
… |
… |
|
985 | 981 | * |
986 | 982 | * @since 2.6.0 |
987 | 983 | * |
988 | | * @uses has_term() |
989 | | * |
990 | 984 | * @param string|int|array $tag Optional. The tag name/term_id/slug or array of them to check for. |
991 | 985 | * @param int|object $post Optional. Post to check instead of the current post. (since 2.7.0) |
992 | 986 | * @return bool True if the current post has any of the given tags (or any tag, if no tag specified). |
993 | 987 | */ |
994 | 988 | function has_tag( $tag = '', $post = null ) { |
995 | | return has_term( $tag, 'post_tag', $post ); |
| 989 | return has_term( 'post_tag', $tag, $post ); |
996 | 990 | } |
997 | 991 | |
998 | 992 | /** |
999 | | * Check if the current post has any of given terms. |
| 993 | * Check if the current post has one of given term(s). |
1000 | 994 | * |
1001 | | * The given terms are checked against the post's terms' term_ids, names and slugs. |
1002 | | * Terms given as integers will only be checked against the post's terms' term_ids. |
1003 | | * If no terms are given, determines if post has any terms. |
1004 | | * |
| 995 | * this function wrap is_object_in_term() and maps the arguments |
| 996 | * accordingly. {@see is_object_in_term} for parameter details. |
| 997 | * |
1005 | 998 | * @since 3.1.0 |
1006 | 999 | * |
1007 | | * @uses is_object_in_term() |
1008 | | * |
1009 | | * @param string|int|array $term Optional. The term name/term_id/slug or array of them to check for. |
| 1000 | * @param string $taxonomy |
| 1001 | * @param string|int|array $term The term name/term_id/slug or array of them to check for. |
1010 | 1002 | * @param int|post object Optional. Post to check instead of the current post. |
1011 | | * @since 2.7.0 |
1012 | 1003 | * @return bool True if the current post has any of the given tags (or any tag, if no tag specified). |
1013 | 1004 | */ |
1014 | | function has_term( $term = '', $taxonomy = '', $post = null ) { |
1015 | | $post = get_post($post); |
| 1005 | function has_term( $taxonomy, $term, $post = null ) { |
| 1006 | $post = get_post( $post ); |
1016 | 1007 | |
1017 | 1008 | if ( !$post ) |
1018 | 1009 | return false; |