woocommerce_correios_shipping_args

The WooCommerce Correios woocommerce correios shipping args hook.

Description

apply_filters( 'woocommerce_correios_shipping_args', (callback) $array, (unknown) $this_id, (unknown) $this_instance_id, (unknown) $this_package ); 

Parameters (4)

0. $array — Optional. (callback) => array( 'nCdServico' => $this->service, 'nCdEmpresa' => $this->get_login(), 'sDsSenha' => $this->get_password(), 'sCepDestino' => wc_correios_sanitize_postcode( $this->destination_postcode ), 'sCepOrigem' => wc_correios_sanitize_postcode( $this->get_origin_postcode() ), 'nVlAltura' => $this->get_height(), 'nVlLargura' => $this->get_width(), 'nVlDiametro' => $this->get_diameter(), 'nVlComprimento' => $this->get_length(), 'nVlPeso' => $this->get_weight(), 'nCdFormato' => $this->format, 'sCdMaoPropria' => $this->own_hands, 'nVlValorDeclarado' => round( number_format( $this->declared_value, 2, '.', '' ) ), 'sCdAvisoRecebimento' => $this->receipt_notice, 'StrRetorno' => 'xml', )
The array.
1. $this_id (unknown)
The this id.
2. $this_instance_id (unknown)
The this instance id.
3. $this_package (unknown)
The this package.

Usage

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

Defined (1)

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

/includes/class-wc-correios-webservice.php  
  1. $args = apply_filters( 'woocommerce_correios_shipping_args', array(