Yoast\WP\SEO\Presenters

Meta_Description_Presenter::present()publicYoast 1.0

Returns the meta description for a post.

Метод класса: Meta_Description_Presenter{}

Хуков нет.

Возвращает

Строку. The meta description tag.

Использование

$Meta_Description_Presenter = new Meta_Description_Presenter();
$Meta_Description_Presenter->present();

Код Meta_Description_Presenter::present() Yoast 22.3

public function present() {
	$output = parent::present();

	if ( ! empty( $output ) ) {
		return $output;
	}

	if ( \current_user_can( 'wpseo_manage_options' ) ) {
		return '<!-- '
			. \sprintf(
				/* translators: %1$s resolves to Yoast SEO, %2$s resolves to the Settings submenu item. */
				\esc_html__( 'Admin only notice: this page does not show a meta description because it does not have one, either write it for this page specifically or go into the [%1$s - %2$s] menu and set up a template.', 'wordpress-seo' ),
				\esc_html__( 'Yoast SEO', 'wordpress-seo' ),
				\esc_html__( 'Settings', 'wordpress-seo' )
			)
			. ' -->';
	}

	return '';
}