Make WordPress Core


Ignore:
Timestamp:
04/21/2009 07:42:28 PM (17 years ago)
Author:
ryan
Message:

Fix typing in cat_is_ancestor_of(). Props filosofo. fixes #9614

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/category.php

    r10959 r11031  
    201201 */
    202202function cat_is_ancestor_of( $cat1, $cat2 ) {
    203         if ( is_int( $cat1 ) )
     203        if ( ! isset($cat1->term_id) )
    204204                $cat1 = &get_category( $cat1 );
    205         if ( is_int( $cat2 ) )
     205        if ( ! isset($cat2->parent) )
    206206                $cat2 = &get_category( $cat2 );
    207207
    208         if ( !$cat1->term_id || !$cat2->parent )
     208        if ( empty($cat1->term_id) || empty($cat2->parent) )
    209209                return false;
    210 
    211210        if ( $cat2->parent == $cat1->term_id )
    212211                return true;
Note: See TracChangeset for help on using the changeset viewer.