Yoast\WP\SEO\Actions\Configuration

First_Time_Configuration_Action::set_person_social_profiles()publicYoast 1.0

Stores the values for the social profiles.

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

Хуков нет.

Возвращает

Объект. The response object.

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

$First_Time_Configuration_Action = new First_Time_Configuration_Action();
$First_Time_Configuration_Action->set_person_social_profiles( $params );
$params(массив) (обязательный)
The values to store.

Код First_Time_Configuration_Action::set_person_social_profiles() Yoast 19.2

public function set_person_social_profiles( $params ) {
	$social_profiles = \array_filter(
		$params,
		function ( $key ) {
			return $key !== 'user_id';
		},
		ARRAY_FILTER_USE_KEY
	);

	$failures = $this->social_profiles_helper->set_person_social_profiles( $params['user_id'], $social_profiles );

	if ( \count( $failures ) === 0 ) {
		return (object) [
			'success' => true,
			'status'  => 200,
		];
	}
	return (object) [
		'success'  => false,
		'status'   => 200,
		'error'    => 'Could not save some options in the database',
		'failures' => $failures,
	];
}