Automattic\WooCommerce\Internal\Admin\Settings
PaymentProviders::update_payment_providers_order_map()
Update the payment providers order map.
This has effects both on the Payments settings page and the checkout page since registered payment gateways (enabled or not) are among the providers.
Метод класса: PaymentProviders{}
Хуков нет.
Возвращает
true|false
. True if the payment providers ordering was successfully updated, false otherwise.
Использование
$PaymentProviders = new PaymentProviders(); $PaymentProviders->update_payment_providers_order_map( $order_map ): bool;
- $order_map(массив) (обязательный)
- The new order for payment providers. The order map should be an associative array where the keys are the payment provider IDs and the values are the new integer order for the payment provider. This can be a partial list of payment providers and their orders. It can also contain new IDs and their orders.
Код PaymentProviders::update_payment_providers_order_map() PaymentProviders::update payment providers order map WC 9.6.0
public function update_payment_providers_order_map( array $order_map ): bool { $existing_order_map = get_option( self::PROVIDERS_ORDER_OPTION, array() ); $new_order_map = $this->payment_providers_order_map_apply_mappings( $existing_order_map, $order_map ); // This will also handle backwards compatibility. $new_order_map = $this->enhance_order_map( $new_order_map ); // Save the new order map to the DB. $result = $this->save_order_map( $new_order_map ); return $result; }