wpseo_adjacent_rel_url
Filter: wpseo_adjacent_rel_url Allow filtering of the rel prev URL put out by Yoast SEO.
Использование
add_filter( 'wpseo_adjacent_rel_url', 'wp_kama_wpseo_adjacent_rel_url_filter', 10, 3 );
/**
* Function for `wpseo_adjacent_rel_url` filter-hook.
*
* @param string $canonical The rel prev URL.
* @param string $rel Link relationship, prev or next.
* @param Indexable_Presentation $presentation The presentation of an indexable.
*
* @return string
*/
function wp_kama_wpseo_adjacent_rel_url_filter( $canonical, $rel, $presentation ){
// filter...
return $canonical;
}
- $canonical(строка)
- The rel prev URL.
- $rel(строка)
- Link relationship, prev or next.
- $presentation(Indexable_Presentation)
- The presentation of an indexable.
Где вызывается хук
wpseo_adjacent_rel_url
wpseo_adjacent_rel_url
yoast/src/presenters/rel-prev-presenter.php 70
return (string) \trim( \apply_filters( 'wpseo_adjacent_rel_url', $this->presentation->rel_prev, 'prev', $this->presentation ) );
yoast/src/presenters/rel-next-presenter.php 70
return (string) \trim( \apply_filters( 'wpseo_adjacent_rel_url', $this->presentation->rel_next, 'next', $this->presentation ) );