wp_unique_term_slug_is_bad_slug

wp_unique_term_slug_is_bad_slug

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('wp_unique_term_slug_is_bad_slug') is found 1 times:

  • /wp-includes/taxonomy.php line 3130
    3126
    3127
    3128
    3129
    3130
    3131
    3132
    3133
    3134
    3135
    3136
    * @param bool   $needs_suffix Whether the slug needs to be made unique with a suffix.
     * @param string $slug         The slug.
     * @param object $term         Term object.
     */
    if ( apply_filters( 'wp_unique_term_slug_is_bad_slug', $needs_suffix, $slug, $term ) ) {
        if ( $parent_suffix ) {
            $slug .= $parent_suffix;
        }
     
        if ( ! empty( $term->term_id ) ) {
            $query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s AND term_id != %d", $slug, $term->term_id );