Yoast\WP\SEO\Services\Importing\Aioseo

Aioseo_Social_Images_Provider_Service::get_social_defaults()publicYoast 1.0

Retrieves social defaults, be it Default Post Image Source or Default Post Image.

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

Хуков нет.

Возвращает

Строку. The social default.

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

$Aioseo_Social_Images_Provider_Service = new Aioseo_Social_Images_Provider_Service();
$Aioseo_Social_Images_Provider_Service->get_social_defaults( $setting, $social_setting );
$setting(строка) (обязательный)
The setting we want, eg. source or custom image.
$social_setting(строка) (обязательный)
The social settings we're working with, eg. open-graph or twitter.

Код Aioseo_Social_Images_Provider_Service::get_social_defaults() Yoast 19.2

public function get_social_defaults( $setting, $social_setting ) {
	switch ( $setting ) {
		case 'source':
			$setting_key = 'defaultImageSourcePosts';
			break;
		case 'custom_image':
			$setting_key = 'defaultImagePosts';
			break;
		default:
			return '';
	}

	$aioseo_settings = $this->aioseo_helper->get_global_option();

	if ( $social_setting === 'og' ) {
		$social_setting = 'facebook';
	}

	if ( ! isset( $aioseo_settings['social'][ $social_setting ]['general'][ $setting_key ] ) ) {
		return '';
	}

	return $aioseo_settings['social'][ $social_setting ]['general'][ $setting_key ];
}