Yoast\WP\SEO\Actions\Configuration

First_Time_Configuration_Action::set_enable_tracking()publicYoast 1.0

Stores the values to enable/disable tracking.

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

Хуков нет.

Возвращает

Объект. The response object.

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

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

Код First_Time_Configuration_Action::set_enable_tracking() Yoast 19.2

public function set_enable_tracking( $params ) {
	$success      = true;
	$option_value = $this->options_helper->get( 'tracking' );

	if ( $option_value !== $params['tracking'] ) {
		$success = $this->options_helper->set( 'tracking', $params['tracking'] );
	}

	if ( $success ) {
		return (object) [
			'success' => true,
			'status'  => 200,
		];
	}
	return (object) [
		'success' => false,
		'status'  => 500,
		'error'   => 'Could not save the option in the database',
	];
}