Changeset 6026 for trunk/wp-includes/category.php
- Timestamp:
- 09/03/2007 11:32:58 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/category.php
r6000 r6026 103 103 } 104 104 105 function cat_is_ancestor_of($cat1, $cat2) { 106 if ( is_int($cat1) ) 107 $cat1 = & get_category($cat1); 108 if ( is_int($cat2) ) 109 $cat2 = & get_category($cat2); 105 function cat_is_ancestor_of($cat1, $cat2) { 106 if ( is_int($cat1) ) 107 $cat1 = & get_category($cat1); 108 if ( is_int($cat2) ) 109 $cat2 = & get_category($cat2); 110 110 111 if ( !$cat1->term_id || !$cat2->parent ) 112 return false; 111 if ( !$cat1->term_id || !$cat2->parent ) 112 return false; 113 113 114 if ( $cat2->parent == $cat1->term_id ) 115 return true; 114 if ( $cat2->parent == $cat1->term_id ) 115 return true; 116 116 117 return cat_is_ancestor_of($cat1, get_category($cat2->parent)); 118 } 117 return cat_is_ancestor_of($cat1, get_category($cat2->parent)); 118 } 119 119 120 120 function sanitize_category($category, $context = 'display') {
Note: See TracChangeset
for help on using the changeset viewer.