WordPress.org

Make WordPress Core

Ticket #4702: 4702.001.diff

File 4702.001.diff, 760 bytes (added by markjaquith, 11 years ago)

Accept $parent as object or int

  • wp-includes/taxonomy.php

     
    616616        else
    617617                $slug = sanitize_title($slug);
    618618
     619        $parent = (int) ( is_object($parent) ) ? $parent->term_id : $parent;
     620
    619621        $term_group = 0;       
    620622        if ( $alias_of ) {
    621623                $alias = $wpdb->fetch_row("SELECT term_id, term_group FROM $wpdb->terms WHERE slug = '$alias_of'");
     
    741743        else
    742744                $slug = sanitize_title($slug);
    743745
     746        $parent = (int) ( is_object($parent) ) ? $parent->term_id : $parent;
     747
    744748        if ( $alias_of ) {
    745749                $alias = $wpdb->fetch_row("SELECT term_id, term_group FROM $wpdb->terms WHERE slug = '$alias_of'");
    746750                if ( $alias->term_group ) {