woocommerce_gateway_<id>_settings_values

The WooCommerce woocommerce gateway id settings values hook.

Description

apply_filters( 'woocommerce_gateway_<id>_settings_values', (unknown) $settings, (unknown) $gateway ); 

Parameters (2)

0. $settings (unknown)
The settings.
1. $gateway (unknown)
The gateway.

Usage

To run the hook, copy the example below.
  1. $settings = apply_filters( 'woocommerce_gateway_{$id}_settings_values', $settings, $gateway ); 
  2.  
  3. if ( !empty( $settings ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the woocommerce_gateway_<id>_settings_values callback 
  2. function filter_woocommerce_gateway_id_settings_values( $settings, $gateway ) { 
  3. // make filter magic happen here... 
  4. return $settings
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( "woocommerce_gateway_{$id}_settings_values", 'filter_woocommerce_gateway_id_settings_values', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( "woocommerce_gateway_{$id}_settings_values", 'filter_woocommerce_gateway_id_settings_values', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/includes/api/class-wc-rest-payment-gateways-controller.php  
  1. update_option( $gateway->get_option_key(), apply_filters( 'woocommerce_gateway_' . $gateway->id . '_settings_values', $settings, $gateway ) );