WC_Settings_Payment_Gateways::render_classic_gateway_settings_page
Render the classic gateway settings page.
Method of the class: WC_Settings_Payment_Gateways{}
No Hooks.
Returns
null. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->render_classic_gateway_settings_page( $payment_gateways, $current_section );
- $payment_gateways(array) (required)
- The payment gateways.
- $current_section(string) (required)
- The current section.
WC_Settings_Payment_Gateways::render_classic_gateway_settings_page() WC Settings Payment Gateways::render classic gateway settings page code WC 10.7.0
private function render_classic_gateway_settings_page( array $payment_gateways, string $current_section ) {
foreach ( $payment_gateways as $gateway ) {
if ( in_array( $current_section, array( $gateway->id, sanitize_title( get_class( $gateway ) ) ), true ) ) {
if ( isset( $_GET['toggle_enabled'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
$enabled = $gateway->get_option( 'enabled' );
if ( $enabled ) {
$gateway->settings['enabled'] = wc_string_to_bool( $enabled ) ? 'no' : 'yes';
}
}
$this->run_gateway_admin_options( $gateway );
break;
}
}
}