wp_robots_noindex_embeds

函数


wp_robots_noindex_embeds ( $robots )
参数
  • (array)
    $robots
    Associative array of robots directives.
    Required:
返回值
  • (array) Filtered robots directives.
相关
  • wp_robots_no_robots()
定义位置
  • wp-includes/robots-template.php
    , line 92
引入
5.7.0
弃用

Adds `noindex` to the robots meta tag for embeds.

Typical usage is as a {@see ‘wp_robots’} callback:

add_filter( ‘wp_robots’, ‘wp_robots_noindex_embeds’ );

function wp_robots_noindex_embeds( array $robots ) {
	if ( is_embed() ) {
		return wp_robots_no_robots( $robots );
	}

	return $robots;
}