wpseo_robots
Filter: wpseo_robots Allows filtering of the meta robots output of Yoast SEO.
Использование
add_filter( 'wpseo_robots', 'wp_kama_wpseo_robots_filter', 10, 2 ); /** * Function for `wpseo_robots` filter-hook. * * @param string $robots The meta robots directives to be echoed. * @param Indexable_Presentation $presentation The presentation of an indexable. * * @return string */ function wp_kama_wpseo_robots_filter( $robots, $presentation ){ // filter... return $robots; }
- $robots(строка)
- The meta robots directives to be echoed.
- $presentation(Indexable_Presentation)
- The presentation of an indexable.
Где вызывается хук
wpseo_robots
yoast/src/presentations/indexable-presentation.php 330
$robots_filtered = \apply_filters( 'wpseo_robots', $robots_string, $this );