Changeset 19678 for trunk/wp-includes/category.php
- Timestamp:
- 01/04/2012 10:44:19 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/category.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/category.php
r16412 r19678 208 208 */ 209 209 function cat_is_ancestor_of( $cat1, $cat2 ) { 210 if ( ! isset($cat1->term_id) ) 211 $cat1 = &get_category( $cat1 ); 212 if ( ! isset($cat2->parent) ) 213 $cat2 = &get_category( $cat2 ); 214 215 if ( empty($cat1->term_id) || empty($cat2->parent) ) 216 return false; 217 if ( $cat2->parent == $cat1->term_id ) 218 return true; 219 220 return cat_is_ancestor_of( $cat1, get_category( $cat2->parent ) ); 221 } 222 210 return term_is_ancestor_of( $cat1, $cat2, 'category' ); 211 } 223 212 224 213 /** … … 235 224 return sanitize_term( $category, 'category', $context ); 236 225 } 237 238 226 239 227 /** … … 255 243 /* Tags */ 256 244 257 258 245 /** 259 246 * Retrieves all post tags. … … 277 264 return $tags; 278 265 } 279 280 266 281 267 /** … … 302 288 } 303 289 304 305 290 /* Cache */ 306 307 291 308 292 /** … … 317 301 clean_term_cache( $id, 'category' ); 318 302 } 319 320 303 321 304 /** … … 356 339 } 357 340 358 359 341 ?>
Note: See TracChangeset
for help on using the changeset viewer.