get_canonical_url

过滤钩子


apply_filters( 'get_canonical_url', $canonical_url, $post )
参数
  • (string)
    $canonical_url
    The post’s canonical URL.
    Required:
  • (WP_Post)
    $post
    Post object.
    Required:
定义位置
  • wp-includes/link-template.php
    , line 3984
引入
4.6.0
弃用

Filters the canonical URL for a post.

return apply_filters( 'get_canonical_url', $canonical_url, $post );