1. 首页
  2. WordPress钩子手册

get_canonical_url

apply_filters( ‘get_canonical_url’, string $canonical_url, WP_Post $post )

过滤器::过滤文章的规范URL。
Filter Hook: Filters the canonical URL for a post.

目录锚点:#参数#源码


参数(Parameters)

参数 类型 说明
$canonical_url (string) 帖子的规范URL。
$post (WP_Post) Post对象。

源码(Source)


更新版本 源码位置 使用 被使用
4.6.0 wp-includes/link-template.php:3806 1 0

get_canonical_url 为WP2原创文章,链接:https://www.wp2.cn/hook/get_canonical_url/