apply_filters( 'get_canonical_url', string $canonical_url, WP_Post $post )

Filters the canonical URL for a post.

Parameters

$canonical_url

(string) The post's canonical URL.

$post

(WP_Post) Post object.

Source

File: wp-includes/link-template.php

View on Trac

Changelog

Version Description
4.6.0 Introduced.

© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/get_canonical_url