Automattic\WooCommerce\Admin\API

Options::update_options()publicWC 1.0

Updates an array of objects.

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

Хуков нет.

Возвращает

Массив. Options object with a boolean if the option was updated.

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

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

Код Options::update_options() WC 8.7.0

public function update_options( $request ) {
	$params  = $request->get_json_params();
	$updated = array();

	if ( ! is_array( $params ) ) {
		return array();
	}

	foreach ( $params as $key => $value ) {
		$updated[ $key ] = update_option( $key, $value );
	}

	return $updated;
}