Yoast\WP\SEO\Integrations\Front_End
WP_Robots_Integration::get_robots_value() protected Yoast 1.0
Retrieves the robots key-value pairs.
{} Это метод класса: WP_Robots_Integration{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_robots_value();
Код WP_Robots_Integration::get_robots_value() WP Robots Integration::get robots value Yoast 16.1.1
protected function get_robots_value() {
global $wp_query;
$old_wp_query = $wp_query;
// phpcs:ignore WordPress.WP.DiscouragedFunctions.wp_reset_query_wp_reset_query -- Reason: The recommended function, wp_reset_postdata, doesn't reset wp_query.
\wp_reset_query();
$context = $this->context_memoizer->for_current_page();
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- Reason: we have to restore the query.
$GLOBALS['wp_query'] = $old_wp_query;
$robots_presenter = new Robots_Presenter();
$robots_presenter->presentation = $context->presentation;
return $this->format_robots( $robots_presenter->get() );
}