Automattic\WooCommerce\Internal\RestApi\Routes\V4\Settings\Account

Controller::get_itempublicWC 1.0

Get account settings.

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

Хуков нет.

Возвращает

WP_REST_Response|WP_Error.

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

$Controller = new Controller();
$Controller->get_item( $request );
$request(WP_REST_Request) (обязательный)
Full details about the request.

Код Controller::get_item() WC 10.5.2

public function get_item( $request ) {
	try {
		$settings = $this->get_all_settings();
	} catch ( \Exception $e ) {
		return new WP_Error(
			'woocommerce_rest_account_settings_error',
			$e->getMessage(),
			array( 'status' => 500 )
		);
	}

	$response = $this->get_item_response( $settings, $request );
	return rest_ensure_response( $response );
}