wp_unique_term_slug_is_bad_slug WordPress Filter Hook

The wp_unique_term_slug_is_bad_slug hook is used to determine whether a given slug is bad for a term. This hook is important because it allows you to programmatically check if a given slug is likely to cause problems for a term. For example, you might use this hook to check if a slug is too long or if it contains invalid characters.

apply_filters( 'wp_unique_term_slug_is_bad_slug', bool $needs_suffix, string $slug, object $term ) #

Filters whether the proposed unique term slug is bad.


Parameters

$needs_suffix

(bool)Whether the slug needs to be made unique with a suffix.

$slug

(string)The slug.

$term

(object)Term object.


Top ↑

Source

File: wp-includes/taxonomy.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More