Automattic\WooCommerce\Admin\API

Options::update_options()publicWC 1.0

Updates an array of objects.

Method of the class: Options{}

No Hooks.

Return

Array. Options object with a boolean if the option was updated.

Usage

$Options = new Options();
$Options->update_options( $request );
$request(WP_REST_Request) (required)
Full details about the request.

Options::update_options() code WC 8.6.1

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;
}