A WordPress-centric search engine for devs and theme authors



wp_unique_post_slug_is_bad_hierarchical_slug ›

Since3.1.0
Deprecatedn/a
apply_filters( 'wp_unique_post_slug_is_bad_hierarchical_slug', false, $slug, $post_type, $post_parent )
Parameters: (4)
  • (bool) $bad_slug Whether the post slug would be bad in a hierarchical post context.
    Required: Yes
  • (string) $slug The post slug.
    Required: Yes
  • (string) $post_type Post type.
    Required: Yes
  • (int) $post_parent Post parent ID.
    Required: Yes
Defined at:
Codex:

Filters whether the post slug would make a bad hierarchical post slug.





Source

if ( $post_name_check || in_array( $slug, $feeds ) || 'embed' === $slug || preg_match( "@^($wp_rewrite->pagination_base)?\d+$@", $slug ) || apply_filters( 'wp_unique_post_slug_is_bad_hierarchical_slug', false, $slug, $post_type, $post_parent ) ) {