Yoast\WP\SEO\Routes

Integrations_Route::set_integration_active()publicYoast 1.0

Sets integration state.

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

Хуков нет.

Возвращает

WP_REST_Response.

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

$Integrations_Route = new Integrations_Route();
$Integrations_Route->set_integration_active( $request );
$request(WP_REST_Request) (обязательный)
The request.

Код Integrations_Route::set_integration_active() Yoast 22.7

public function set_integration_active( WP_REST_Request $request ) {
	$params           = $request->get_json_params();
	$integration_name = $params['integration'];
	$value            = $params['active'];

	$data = $this
		->integrations_action
		->set_integration_active( $integration_name, $value );

	return new WP_REST_Response(
		[ 'json' => $data ]
	);
}