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.
Метод класса: PaymentsController{}
Хуков нет.
Возвращает
Массив
. Settings array with additional settings added.
Использование
$PaymentsController = new PaymentsController(); $PaymentsController->preload_settings( $settings ): array;
- $settings(массив) (обязательный)
- The settings array.
Код PaymentsController::preload_settings() PaymentsController::preload settings WC 9.6.1
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::USER_PAYMENTS_NOX_PROFILE_KEY ] ) ) { $settings[ Payments::USER_PAYMENTS_NOX_PROFILE_KEY ] = array(); } $settings[ Payments::USER_PAYMENTS_NOX_PROFILE_KEY ]['business_country_code'] = $this->payments->get_country(); return $settings; }