has_category Wordpress function


Description:

Check if the current post has any of given category.


Syntax:


Arguments:

(string|int|array) $category Optional. The category name/term_id/slug or array of them to check for.
(int|object) $post Optional. Post to check instead of the current post.


Return Type:

(bool) True if the current post has any of the given categories (or any category, if no category specified).


Define At:

wp-includes/category-template.php


Wordpress Reference URL:

http://codex.wordpress.org/Function_Reference/has_category


0 Flares Facebook 0 Google+ 0 0 Flares ×
Posted in: Wordpress functions
0 Flares Facebook 0 Pin It Share 0 Google+ 0 0 Flares ×