woocommerce_pay4pay_<id>_amount

The WordPress Core woocommerce pay4pay id amount hook.

Description

apply_filters( 'woocommerce_pay4pay_<id>_amount', (unknown) $cost, (unknown) $calculation_base, (unknown) $current_gateway, (unknown) $taxable, (unknown) $include_taxes, (unknown) $tax_class ); 

Parameters (6)

0. $cost (unknown)
The cost.
1. $calculation_base (unknown)
The calculation base.
2. $current_gateway (unknown)
The current gateway.
3. $taxable (unknown)
The taxable.
4. $include_taxes (unknown)
The include taxes.
5. $tax_class (unknown)
The tax class.

Usage

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

Defined (1)

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

/woocommerce-payforpayment.php  
  1. $cost = apply_filters( "woocommerce_pay4pay_{$current_gateway->id}_amount" , $cost , $calculation_base , $current_gateway , $taxable , $include_taxes , $tax_class );