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