woocommerce_paypal_line_item
Usage
add_filter( 'woocommerce_paypal_line_item', 'wp_kama_woocommerce_paypal_line_item_filter', 10, 5 ); /** * Function for `woocommerce_paypal_line_item` filter-hook. * * @param $array * @param $item_name * @param $quantity * @param $amount * @param $item_number * * @return */ function wp_kama_woocommerce_paypal_line_item_filter( $array, $item_name, $quantity, $amount, $item_number ){ // filter... return $array; }
- $array
- -
- $item_name
- -
- $quantity
- -
- $amount
- -
- $item_number
- -
Where the hook is called
woocommerce_paypal_line_item
woocommerce/includes/gateways/paypal/includes/class-wc-gateway-paypal-request.php 492-504
$item = apply_filters( 'woocommerce_paypal_line_item', array( 'item_name' => html_entity_decode( wc_trim_string( $item_name ? wp_strip_all_tags( $item_name ) : __( 'Item', 'woocommerce' ), 127 ), ENT_NOQUOTES, 'UTF-8' ), 'quantity' => (int) $quantity, 'amount' => wc_float_to_string( (float) $amount ), 'item_number' => $item_number, ), $item_name, $quantity, $amount, $item_number );