wpseek.com
WordPress开发者和主题制作者的搜索引擎



pre_wp_unique_post_slug › WordPress过滤钩子

Since5.1.0
已弃用n/a
› apply_filters( 'pre_wp_unique_post_slug', null, $slug, $post_id, $post_status, $post_type, $post_parent )
参数: (6)
  • () override_slug Short-circuit return value.
    Required: Yes
  • () slug The desired slug (post_name).
    Required: Yes
  • () post_id Post ID.
    Required: Yes
  • () post_status The post status.
    Required: Yes
  • () post_type Post type.
    Required: Yes
  • () post_parent Post parent ID.
    Required: Yes
定义在:
文档:

Filters the post slug before it is generated to be unique.

Returning a non-null value will short-circuit the unique slug generation, returning the passed value instead.




源码

$override_slug = apply_filters( 'pre_wp_unique_post_slug', null, $slug, $post_id, $post_status, $post_type, $post_parent );