X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/bf5c68485ef07868ad0a91168ecd0092af7661ae..8f374b7233bc2815ccc387e448d208c5434eb961:/wp-includes/category.php?ds=sidebyside diff --git a/wp-includes/category.php b/wp-includes/category.php index 4d022774..17283d01 100644 --- a/wp-includes/category.php +++ b/wp-includes/category.php @@ -160,7 +160,6 @@ function get_category_by_slug( $slug ) { return $category; } - /** * Retrieve the ID of a category from its name. * @@ -176,7 +175,6 @@ function get_cat_ID( $cat_name='General' ) { return 0; } - /** * Retrieve the name of a category from its ID. * @@ -193,7 +191,6 @@ function get_cat_name( $cat_id ) { return $category->name; } - /** * Check if a category is an ancestor of another category. * @@ -207,20 +204,9 @@ function get_cat_name( $cat_id ) { * @return bool Whether $cat2 is child of $cat1 */ function cat_is_ancestor_of( $cat1, $cat2 ) { - if ( ! isset($cat1->term_id) ) - $cat1 = &get_category( $cat1 ); - if ( ! isset($cat2->parent) ) - $cat2 = &get_category( $cat2 ); - - if ( empty($cat1->term_id) || empty($cat2->parent) ) - return false; - if ( $cat2->parent == $cat1->term_id ) - return true; - - return cat_is_ancestor_of( $cat1, get_category( $cat2->parent ) ); + return term_is_ancestor_of( $cat1, $cat2, 'category' ); } - /** * Sanitizes category data based on context. * @@ -235,7 +221,6 @@ function sanitize_category( $category, $context = 'display' ) { return sanitize_term( $category, 'category', $context ); } - /** * Sanitizes data in single category key field. * @@ -254,7 +239,6 @@ function sanitize_category_field( $field, $value, $cat_id, $context ) { /* Tags */ - /** * Retrieves all post tags. * @@ -277,7 +261,6 @@ function &get_tags( $args = '' ) { return $tags; } - /** * Retrieve post tag by tag ID or tag object. * @@ -301,10 +284,8 @@ function &get_tag( $tag, $output = OBJECT, $filter = 'raw' ) { return get_term( $tag, 'post_tag', $output, $filter ); } - /* Cache */ - /** * Remove the category cache data based on ID. * @@ -317,7 +298,6 @@ function clean_category_cache( $id ) { clean_term_cache( $id, 'category' ); } - /** * Update category structure to old pre 2.3 from new taxonomy structure. * @@ -354,6 +334,3 @@ function _make_cat_compat( &$category ) { $category['category_parent'] = &$category['parent']; } } - - -?>