post_link

过滤钩子


apply_filters( 'post_link', $permalink, $post, $leavename )
参数
  • (string)
    $permalink
    The post’s permalink.
    Required:
  • (WP_Post)
    $post
    The post in question.
    Required:
  • (bool)
    $leavename
    Whether to keep the post name.
    Required:
定义位置
  • wp-includes/link-template.php
    , line 304
引入
1.5.0
弃用

Filters the permalink for a post.

Only applies to posts with post_type of ‘post’.

return apply_filters( 'post_link', $permalink, $post, $leavename );