mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-27 14:53:08 +02:00
Check term_id
against the $term
object, not the non-existent var $args
. Props rboren. Fixes #12729.
Built from https://develop.svn.wordpress.org/trunk@25106 git-svn-id: http://core.svn.wordpress.org/trunk@25088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
688ecb9fcc
commit
22c59d9c45
@ -2380,8 +2380,8 @@ function wp_unique_term_slug($slug, $term) {
|
||||
}
|
||||
|
||||
// If we didn't get a unique slug, try appending a number to make it unique.
|
||||
if ( !empty($args['term_id']) )
|
||||
$query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s AND term_id != %d", $slug, $args['term_id'] );
|
||||
if ( ! empty( $term->term_id ) )
|
||||
$query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s AND term_id != %d", $slug, $term->term_id );
|
||||
else
|
||||
$query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s", $slug );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user