WPSEO_Taxonomy_Fields::get_social_fields()protectedYoast 1.0

Returning the fields for the social media tab.

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

Хуков нет.

Возвращает

Массив.

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

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

Код WPSEO_Taxonomy_Fields::get_social_fields() Yoast 23.5

protected function get_social_fields() {
	$fields = [];

	if ( WPSEO_Options::get( 'opengraph', false ) === true ) {
		$fields = [
			'opengraph-title'       => [
				'label'       => '',
				'description' => '',
				'type'        => 'hidden',
				'options'     => '',
				'hide'        => false,
			],
			'opengraph-description' => [
				'label'       => '',
				'description' => '',
				'type'        => 'hidden',
				'options'     => '',
				'hide'        => false,
			],
			'opengraph-image'       => [
				'label'       => '',
				'description' => '',
				'type'        => 'hidden',
				'options'     => '',
				'hide'        => false,
			],
			'opengraph-image-id'    => [
				'label'       => '',
				'description' => '',
				'type'        => 'hidden',
				'options'     => '',
				'hide'        => false,
			],
		];
	}

	if ( WPSEO_Options::get( 'twitter', false ) === true ) {
		$fields = array_merge(
			$fields,
			[
				'twitter-title'       => [
					'label'       => '',
					'description' => '',
					'type'        => 'hidden',
					'options'     => '',
					'hide'        => false,
				],
				'twitter-description' => [
					'label'       => '',
					'description' => '',
					'type'        => 'hidden',
					'options'     => '',
					'hide'        => false,
				],
				'twitter-image'       => [
					'label'       => '',
					'description' => '',
					'type'        => 'hidden',
					'options'     => '',
					'hide'        => false,
				],
				'twitter-image-id'    => [
					'label'       => '',
					'description' => '',
					'type'        => 'hidden',
					'options'     => '',
					'hide'        => false,
				],
			]
		);
	}

	return $fields;
}