woocommerce_pay_order_button_html

The WooCommerce woocommerce pay order button html hook.

Description

Parameters (1)

0. $input_type_submit_class_button_alt_id_place_order_value_esc_attr_order_button_text_data_value_esc_attr_order_button_text — Optional. (string) => ''
The input type submit class button alt id place order value esc attr order button text data value esc attr order button text.

Usage

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

Defined (1)

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

/templates/checkout/form-pay.php  
  1. <?php echo apply_filters( 'woocommerce_pay_order_button_html', '<input type="submit" class="button alt" id="place_order" value="' . esc_attr( $order_button_text ) . '" data-value="' . esc_attr( $order_button_text ) . '" />' ); ?>