woocommerce_payment_gateway_get_new_payment_method_option_html_label

Displays a radio button for entering a new payment method (new CC details) instead of using a saved method.

Description

apply_filters( 'woocommerce_payment_gateway_get_new_payment_method_option_html_label', (unknown) $this_new_method_label, (unknown) $instance ); 

Only displayed when a gateway supports tokenization.

Parameters (2)

0. $this_new_method_label (unknown)
The this new method label this new method label use a new payment method woocommerce.
1. $instance (unknown)
The instance.

Usage

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

Defined (1)

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

/includes/abstracts/abstract-wc-payment-gateway.php  
  1. $label = apply_filters( 'woocommerce_payment_gateway_get_new_payment_method_option_html_label', $this->new_method_label ? $this->new_method_label : __( 'Use a new payment method', 'woocommerce' ), $this );