Automattic\WooCommerce\Internal\Admin\Settings
PaymentsController::preload_settings
Preload settings to make them available to the Payments settings page frontend logic.
Added keys will be available in the window.wcSettings.admin object.
Method of the class: PaymentsController{}
No Hooks.
Returns
Array
. Settings array with additional settings added.
Usage
$PaymentsController = new PaymentsController(); $PaymentsController->preload_settings( $settings ): array;
- $settings(array) (required)
- The settings array.
PaymentsController::preload_settings() PaymentsController::preload settings code WC 9.9.3
public function preload_settings( array $settings ): array { // We only preload settings in the WP admin. if ( ! is_admin() ) { return $settings; } // Add the business location country to the settings. if ( ! isset( $settings[ Payments::PAYMENTS_NOX_PROFILE_KEY ] ) ) { $settings[ Payments::PAYMENTS_NOX_PROFILE_KEY ] = array(); } $settings[ Payments::PAYMENTS_NOX_PROFILE_KEY ]['business_country_code'] = $this->payments->get_country(); return $settings; }