Make WordPress Core

Ticket #19205: 19205.diff

File 19205.diff, 625 bytes (added by dlh, 11 years ago)
  • wp-includes/taxonomy.php

     
    20592059
    20602060        $defaults = array( 'alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => '');
    20612061        $args = wp_parse_args($args, $defaults);
     2062
     2063        if ( $args['parent'] > 0 && ! term_exists( intval( $args['parent'] ) ) )
     2064                return new WP_Error('missing_parent', __('The selected parent term no longer exists'));
     2065
    20622066        $args['name'] = $term;
    20632067        $args['taxonomy'] = $taxonomy;
    20642068        $args = sanitize_term($args, $taxonomy, 'db');