Go to file
Boone Gorges 8a2341335b Taxonomy: Improve precision of duplicate name checks when inserting terms.
`wp_insert_term()` does not allow for terms with the same name to exist
at the same hierarchy level, unless the second term has a unique slug.
When this logic was refactored in [31792] and [34809], a bug was
introduced whereby it was possible to bypass the no-same-named-sibling
check in cases where the first term had a non-auto-generated slug
(ie, where the name was 'Foo' but the slug something other than 'foo',
such that the second term would get the non-matching slug 'foo').

This changeset fixes this issue by ensuring that the duplicate name
check runs both in cases where there's an actual slug clash *and* in
cases where no explicit `slug` has been provided to `wp_insert_term()`.
The result is a more reliable error condition:
`wp_insert_term( 'Foo' ... )` will always fail if there's a sibling
'Foo', regardless of the sibling's slug.

Props mikejolley.
See #39984.

git-svn-id: https://develop.svn.wordpress.org/trunk@40144 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-03 02:39:09 +00:00
src Taxonomy: Improve precision of duplicate name checks when inserting terms. 2017-03-03 02:39:09 +00:00
tests Taxonomy: Improve precision of duplicate name checks when inserting terms. 2017-03-03 02:39:09 +00:00
tools/i18n DOCS: Replace HTTP links with HTTPS. 2016-06-10 04:49:09 +00:00
.editorconfig
.gitignore Build/Test Tools: Facilitate SVN and Git being co-located in the same directory. 2016-12-12 05:11:27 +00:00
.jshintrc Build/Test Tools: After [29858], update `.jsintrc` to use spaces, not tabs. 2017-01-13 04:44:53 +00:00
.travis.yml Build/Test Tools: Only attempt to disable Xdebug on stable builds of PHP. 2017-02-28 00:03:18 +00:00
Gruntfile.js REST API: improve test fixture generation, normalizing data. 2017-02-15 17:58:14 +00:00
package.json Build/Test Tools: Specify exact node version in package.json. 2016-12-04 17:29:26 +00:00
phpunit.xml.dist oEmbed: Remove the oEmbed provider unit tests. 2016-10-20 09:15:10 +00:00
wp-cli.yml
wp-config-sample.php
wp-tests-config-sample.php Tests: Use a minimal theme for tests. 2016-10-21 11:02:37 +00:00