mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-05-18 18:24:39 +00:00
Taxonomy: Take 'parent' into account when checking for terms with duplicate names.
Terms with duplicate names are not allowed at the same level of a taxonomy hierarchy. The name lookup introduced in [34809] did not properly account for the 'parent' parameter, with the result that the duplicate-name restriction was tighter than intended (terms with duplicate names could not be created at different levels of a single hierarchy). Props mikejolley. Fixes #39984. git-svn-id: https://develop.svn.wordpress.org/trunk@40145 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2040,6 +2040,7 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) {
|
||||
$name_matches = get_terms( $taxonomy, array(
|
||||
'name' => $name,
|
||||
'hide_empty' => false,
|
||||
'parent' => $args['parent'],
|
||||
) );
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user