apply_filters( 'get_canonical_url', string $canonical_url, WP_Post $post )
- Since
- 4.6.0
Filters the canonical URL for a post.
Parameters
$canonical_urlstring- The post's canonical URL.
$postWP_Post- Post object.
Fired at · 1
wp-includes/link-template.php:4106wp_get_canonical_url()
Source
View on Trac ↗View on GitHub ↗
4100<?php4101 *4102 * @since 4.6.04103 *4104 * @param string $canonical_url The post's canonical URL.4105 * @param WP_Post $post Post object.4106 */4107 return apply_filters( 'get_canonical_url', $canonical_url, $post );4108}4109 4110/**4111 * Outputs rel=canonical for singular queries.4112 *4113 * @since 2.9.0
History
Introduced in 4.6.0. Unchanged from 6.7.7 through 7.1.0.
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.