WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Получай пассивный доход от сайта с помощью браузерных PUSH уведомлений
функция не описана

WPSEO_Metabox_Formatter::get_defaults() private Yoast 1.0

Returns array with all the values always needed by a scraper object.

{} Это метод класса: WPSEO_Metabox_Formatter{}

Возвращает

Массив. Default settings for the metabox.

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

// private - только в коде основоного (родительского) класса
$result = $this->get_defaults();

Код WPSEO_Metabox_Formatter::get_defaults() Yoast 16.2

<?php
private function get_defaults() {
	$analysis_seo         = new WPSEO_Metabox_Analysis_SEO();
	$analysis_readability = new WPSEO_Metabox_Analysis_Readability();
	$schema_types         = new Schema_Types();

	return [
		'author_name'                 => get_the_author_meta( 'display_name' ),
		'site_name'                   => get_bloginfo( 'name' ),
		'sitewide_social_image'       => WPSEO_Options::get( 'og_default_image' ),
		'search_url'                  => '',
		'post_edit_url'               => '',
		'base_url'                    => '',
		'contentTab'                  => __( 'Readability', 'wordpress-seo' ),
		'keywordTab'                  => __( 'Keyphrase:', 'wordpress-seo' ),
		'removeKeyword'               => __( 'Remove keyphrase', 'wordpress-seo' ),
		'contentLocale'               => get_locale(),
		'userLocale'                  => \get_user_locale(),
		'translations'                => $this->get_translations(),
		'keyword_usage'               => [],
		'title_template'              => '',
		'metadesc_template'           => '',
		'contentAnalysisActive'       => $analysis_readability->is_enabled() ? 1 : 0,
		'keywordAnalysisActive'       => $analysis_seo->is_enabled() ? 1 : 0,
		'cornerstoneActive'           => WPSEO_Options::get( 'enable_cornerstone_content', false ) ? 1 : 0,
		'semrushIntegrationActive'    => WPSEO_Options::get( 'semrush_integration_active', true ) ? 1 : 0,
		'intl'                        => $this->get_content_analysis_component_translations(),
		'isRtl'                       => is_rtl(),
		'isPremium'                   => YoastSEO()->helpers->product->is_premium(),
		'wordFormRecognitionActive'   => YoastSEO()->helpers->language->is_word_form_recognition_active( WPSEO_Language_Utils::get_language( get_locale() ) ),
		'siteIconUrl'                 => get_site_icon_url(),
		'countryCode'                 => WPSEO_Options::get( 'semrush_country_code', false ),
		'SEMrushLoginStatus'          => WPSEO_Options::get( 'semrush_integration_active', true ) ? $this->get_semrush_login_status() : false,
		'showSocial'                  => [
			'facebook' => WPSEO_Options::get( 'opengraph', false ),
			'twitter'  => WPSEO_Options::get( 'twitter', false ),
		],
		'schema'                      => [
			'displayFooter'      => WPSEO_Capability_Utils::current_user_can( 'wpseo_manage_options' ),
			'pageTypeOptions'    => $schema_types->get_page_type_options(),
			'articleTypeOptions' => $schema_types->get_article_type_options(),
		],
		'twitterCardType'             => YoastSEO()->helpers->options->get( 'twitter_card_type' ),

		/**
		 * Filter to determine if the markers should be enabled or not.
		 *
		 * @param bool $showMarkers Should the markers being enabled. Default = true.
		 */
		'show_markers'                => apply_filters( 'wpseo_enable_assessment_markers', true ),
		'publish_box'                 => [
			'labels' => [
				'content' => [
					'na'   => sprintf(
						/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the readability score. */
						__( '%1$sReadability%2$s: %3$s', 'wordpress-seo' ),
						'<a href="#yoast-readability-analysis-collapsible-metabox">',
						'</a>',
						'<strong>' . __( 'Not available', 'wordpress-seo' ) . '</strong>'
					),
					'bad'  => sprintf(
						/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the readability score. */
						__( '%1$sReadability%2$s: %3$s', 'wordpress-seo' ),
						'<a href="#yoast-readability-analysis-collapsible-metabox">',
						'</a>',
						'<strong>' . __( 'Needs improvement', 'wordpress-seo' ) . '</strong>'
					),
					'ok'   => sprintf(
						/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the readability score. */
						__( '%1$sReadability%2$s: %3$s', 'wordpress-seo' ),
						'<a href="#yoast-readability-analysis-collapsible-metabox">',
						'</a>',
						'<strong>' . __( 'OK', 'wordpress-seo' ) . '</strong>'
					),
					'good' => sprintf(
						/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the readability score. */
						__( '%1$sReadability%2$s: %3$s', 'wordpress-seo' ),
						'<a href="#yoast-readability-analysis-collapsible-metabox">',
						'</a>',
						'<strong>' . __( 'Good', 'wordpress-seo' ) . '</strong>'
					),
				],
				'keyword' => [
					'na'   => sprintf(
						/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the SEO score. */
						__( '%1$sSEO%2$s: %3$s', 'wordpress-seo' ),
						'<a href="#yoast-seo-analysis-collapsible-metabox">',
						'</a>',
						'<strong>' . __( 'Not available', 'wordpress-seo' ) . '</strong>'
					),
					'bad'  => sprintf(
						/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the SEO score. */
						__( '%1$sSEO%2$s: %3$s', 'wordpress-seo' ),
						'<a href="#yoast-seo-analysis-collapsible-metabox">',
						'</a>',
						'<strong>' . __( 'Needs improvement', 'wordpress-seo' ) . '</strong>'
					),
					'ok'   => sprintf(
						/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the SEO score. */
						__( '%1$sSEO%2$s: %3$s', 'wordpress-seo' ),
						'<a href="#yoast-seo-analysis-collapsible-metabox">',
						'</a>',
						'<strong>' . __( 'OK', 'wordpress-seo' ) . '</strong>'
					),
					'good' => sprintf(
						/* translators: %1$s expands to the opening anchor tag, %2$s to the closing anchor tag, %3$s to the SEO score. */
						__( '%1$sSEO%2$s: %3$s', 'wordpress-seo' ),
						'<a href="#yoast-seo-analysis-collapsible-metabox">',
						'</a>',
						'<strong>' . __( 'Good', 'wordpress-seo' ) . '</strong>'
					),
				],
			],
		],
		'markdownEnabled'             => $this->is_markdown_enabled(),
		'analysisHeadingTitle'        => __( 'Analysis', 'wordpress-seo' ),
		'zapierIntegrationActive'     => WPSEO_Options::get( 'zapier_integration_active', false ) ? 1 : 0,
		'zapierConnectedStatus'       => ! empty( WPSEO_Options::get( 'zapier_subscription', [] ) ) ? 1 : 0,

		/**
		 * Filter to determine whether the PreviouslyUsedKeyword assessment should run.
		 *
		 * @param bool $previouslyUsedKeywordActive Whether the PreviouslyUsedKeyword assessment should run.
		 */
		'previouslyUsedKeywordActive' => apply_filters( 'wpseo_previously_used_keyword_active', true ),
	];
}