wpseo_robots_array хук-фильтр . Yoast 1.0
Filter: 'wpseo_robots_array' - Allows filtering of the meta robots output array of Yoast SEO.
Использование
add_filter( 'wpseo_robots_array', 'filter_function_name_7294', 10, 2 ); function filter_function_name_7294( $robots, $presentation ){ // filter... return $robots; }
- $robots(массив)
- The meta robots directives to be used.
- $presentation(Indexable_Presentation)
- The presentation of an indexable.
Где вызывается хук
wpseo_robots_array
yoast/src/presentations/indexable-presentation.php 339
return \apply_filters( 'wpseo_robots_array', \array_filter( $robots ), $this );
Где используется хук в ядре Yoast SEO
yoast/src/integrations/front-end/comment-link-fixer.php 68
\add_filter( 'wpseo_robots_array', [ $this->robots, 'set_robots_no_index' ] );
yoast/src/integrations/front-end/indexing-controls.php 53
\add_filter( 'wpseo_robots_array', [ $this->robots, 'set_robots_no_index' ] );