WordPress at a glance
filter is not described

get_canonical_url filter-hook . WP 4.6.0

Filters the canonical URL for a post.


add_filter( 'get_canonical_url', 'filter_function_name_2344', 10, 2 );
function filter_function_name_2344( $canonical_url, $post ){
	// filter...

	return $canonical_url;
The post's canonical URL.
Post object.

Where the hook is called

wp-includes/link-template.php 3549
return apply_filters( 'get_canonical_url', $canonical_url, $post );

Where the hook is used (in WP core)

Does not used.