wp_unique_post_slug_is_bad_hierarchical_slug хук-фильтр . WP 3.1.0
Filters whether the post slug would make a bad hierarchical post slug.
Использование
add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', 'filter_function_name_3935', 10, 4 ); function filter_function_name_3935( $bad_slug, $slug, $post_type, $post_parent ){ // filter... return $bad_slug; }
- $bad_slug(true/false)
- Whether the post slug would be bad in a hierarchical post context.
- $slug(строка)
- The post slug.
- $post_type(строка)
- Post type.
- $post_parent(число)
- Post parent ID.
Список изменений
С версии 3.1.0 | Введена. |
Где вызывается хук
wp_unique_post_slug_is_bad_hierarchical_slug
wp-includes/post.php 4625
$is_bad_hierarchical_slug = apply_filters( 'wp_unique_post_slug_is_bad_hierarchical_slug', false, $slug, $post_type, $post_parent );