From bd5457487a9a9f60eef533701f72cd1107e99c86 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 21 Apr 2009 19:42:28 +0000 Subject: [PATCH] Fix typing in cat_is_ancestor_of(). Props filosofo. fixes #9614 git-svn-id: http://svn.automattic.com/wordpress/trunk@11031 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/category.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/wp-includes/category.php b/wp-includes/category.php index 5df4d27e0..372c4c70c 100644 --- a/wp-includes/category.php +++ b/wp-includes/category.php @@ -200,14 +200,13 @@ function get_cat_name( $cat_id ) { * @return bool Whether $cat2 is child of $cat1 */ function cat_is_ancestor_of( $cat1, $cat2 ) { - if ( is_int( $cat1 ) ) + if ( ! isset($cat1->term_id) ) $cat1 = &get_category( $cat1 ); - if ( is_int( $cat2 ) ) + if ( ! isset($cat2->parent) ) $cat2 = &get_category( $cat2 ); - if ( !$cat1->term_id || !$cat2->parent ) + if ( empty($cat1->term_id) || empty($cat2->parent) ) return false; - if ( $cat2->parent == $cat1->term_id ) return true;