woocommerce_paypal_args

The WooCommerce woocommerce paypal args hook.

Description

apply_filters( 'woocommerce_paypal_args', (array) $var, (unknown) $order ); 

Parameters (2)

0. $var — Optional. (array) => array_merge( array( 'cmd' => '_cart', 'business' => $this->gateway->get_option( 'email' ), 'no_note' => 1, 'currency_code' => get_woocommerce_currency(), 'charset' => 'utf-8', 'rm' => is_ssl() ? 2 : 1, 'upload' => 1, 'return' => esc_url_raw( add_query_arg( 'utm_nooverride', '1', $this->gateway->get_return_url( $order ) ) ), 'cancel_return' => esc_url_raw( $order->get_cancel_order_url_raw() ), 'page_style' => $this->gateway->get_option( 'page_style' ), 'image_url' => esc_url_raw( $this->gateway->get_option( 'image_url' ) ), 'paymentaction' => $this->gateway->get_option( 'paymentaction' ), 'bn' => 'WooThemes_Cart', 'invoice' => $this->limit_length( $this->gateway->get_option( 'invoice_prefix' ) . $order->get_order_number(), 127 ), 'custom' => json_encode( array( 'order_id' => $order->get_id(), 'order_key' => $order->get_order_key() ) ), 'notify_url' => $this->limit_length( $this->notify_url, 255 ), 'first_name' => $this->limit_length( $order->get_billing_first_name(), 32 ), 'last_name' => $this->limit_length( $order->get_billing_last_name(), 64 ), 'address1' => $this->limit_length( $order->get_billing_address_1(), 100 ), 'address2' => $this->limit_length( $order->get_billing_address_2(), 100 ), 'city' => $this->limit_length( $order->get_billing_city(), 40 ), 'state' => $this->get_paypal_state( $order->get_billing_country(), $order->get_billing_state() ), 'zip' => $this->limit_length( wc_format_postcode( $order->get_billing_postcode(), $order->get_billing_country() ), 32 ), 'country' => $this->limit_length( $order->get_billing_country(), 2 ), 'email' => $this->limit_length( $order->get_billing_email() ), ), $this->get_phone_number_args( $order ), $this->get_shipping_args( $order ), $this->get_line_item_args( $order ) )
The array.
1. $order (unknown)
The order.

Usage

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

Defined (1)

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

/includes/gateways/paypal/includes/class-wc-gateway-paypal-request.php  
  1. return apply_filters( 'woocommerce_paypal_args', array_merge(