wpseo_canonical хук-фильтр . Yoast 1.0
Filter: 'wpseo_canonical' - Allow filtering of the canonical URL put out by Yoast SEO.
Использование
add_filter( 'wpseo_canonical', 'filter_function_name_3432', 10, 2 ); function filter_function_name_3432( $canonical, $presentation ){ // filter... return $canonical; }
- $canonical(строка)
- The canonical URL.
- $presentation(Indexable_Presentation)
- The presentation of an indexable.
Где вызывается хук
wpseo_canonical
yoast/src/presenters/canonical-presenter.php 43
return \urldecode( (string) \trim( \apply_filters( 'wpseo_canonical', $this->presentation->canonical, $this->presentation ) ) );
Где используется хук в ядре Yoast SEO
yoast/src/integrations/third-party/woocommerce.php 101
\add_filter( 'wpseo_canonical', [ $this, 'canonical' ], 10, 2 );