Ticket #23378: 23378.diff
| File 23378.diff, 1.1 KB (added by danielbachhuber, 5 months ago) |
|---|
-
wp-includes/taxonomy.php
2056 2056 2057 2057 $defaults = array( 'alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => ''); 2058 2058 $args = wp_parse_args($args, $defaults); 2059 2060 // 'parent' argument could be a slug too 2061 if ( ! is_numeric( $args['parent'] ) ) { 2062 $term_parent = get_term_by( 'slug', $args['parent'], $taxonomy ); 2063 if ( $term_parent ) 2064 $args['parent'] = $term_parent->term_id; 2065 } 2066 2059 2067 $args['name'] = $term; 2060 2068 $args['taxonomy'] = $taxonomy; 2061 2069 $args = sanitize_term($args, $taxonomy, 'db'); … … 2368 2376 2369 2377 $defaults = array( 'alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => ''); 2370 2378 $args = wp_parse_args($args, $defaults); 2379 2380 // 'parent' argument could be a slug too 2381 if ( ! is_numeric( $args['parent'] ) ) { 2382 $term_parent = get_term_by( 'slug', $args['parent'], $taxonomy ); 2383 if ( $term_parent ) 2384 $args['parent'] = $term_parent->term_id; 2385 } 2386 2371 2387 $args = sanitize_term($args, $taxonomy, 'db'); 2372 2388 extract($args, EXTR_SKIP); 2373 2389