get_canonical_url хук-фильтр . WP 4.6.0
Filters the canonical URL for a post.
Использование
add_filter( 'get_canonical_url', 'filter_function_name_3922', 10, 2 ); function filter_function_name_3922( $canonical_url, $post ){ // filter... return $canonical_url; }
- $canonical_url(строка)
- The post's canonical URL.
- $post(WP_Post)
- Post object.
Список изменений
С версии 4.6.0 | Введена. |
Где вызывается хук
get_canonical_url
wp-includes/link-template.php 3835
return apply_filters( 'get_canonical_url', $canonical_url, $post );