Changeset 7130 for trunk/wp-includes/category-template.php
- Timestamp:
- 03/02/2008 08:17:30 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/category-template.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/category-template.php
r7064 r7130 168 168 } 169 169 170 /* 170 /* 171 171 * in_category() - Checks whether the current post is within a particular category 172 * 172 * 173 173 * This function checks to see if the post is within the supplied category. The categoy 174 174 * can be specified by number or name and will be checked as a name first to allow for categories with numeric names. 175 175 * Note: Prior to v2.5 of WordPress category names where not supported. 176 * 177 * @since 1.2.0 178 * 179 * @param int|string $category 176 * 177 * @since 1.2.0 178 * 179 * @param int|string $category 180 180 * @return bool true if the post is in the supplied category 181 */ 181 */ 182 182 function in_category( $category ) { // Check if the current post is in the given category 183 183 global $post; … … 186 186 if (0 != $cat_ID) 187 187 $category = $cat_ID; 188 188 189 189 $categories = get_object_term_cache($post->ID, 'category'); 190 190 if ( false === $categories )
Note: See TracChangeset
for help on using the changeset viewer.