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:4098wp_get_canonical_url()
Source
View on Trac ↗View on GitHub ↗
4092<?php4093 *4094 * @since 4.6.04095 *4096 * @param string $canonical_url The post's canonical URL.4097 * @param WP_Post $post Post object.4098 */4099 return apply_filters( 'get_canonical_url', $canonical_url, $post );4100}4101 4102/**4103 * Outputs rel=canonical for singular queries.4104 *4105 * @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 6.7.7 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.