woocommerce_shipping_settings

Get settings array.

Description

(array) apply_filters( 'woocommerce_shipping_settings', (array) $array ); 

Returns (array)

Parameters (1)

0. $array — Optional. (array) => array(array( 'title' => __( 'Shipping options', 'woocommerce' ), 'type' => 'title', 'id' => 'shipping_options' ),array( 'title' => __( 'Calculations', 'woocommerce' ), 'desc' => __( 'Enable the shipping calculator on the cart page', 'woocommerce' ), 'id' => 'woocommerce_enable_shipping_calc', 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'start', 'autoload' => false, ),array( 'desc' => __( 'Hide shipping costs until an address is entered', 'woocommerce' ), 'id' => 'woocommerce_shipping_cost_requires_address', 'default' => 'no', 'type' => 'checkbox', 'checkboxgroup' => 'end', 'autoload' => false, ),array( 'title' => __( 'Shipping destination', 'woocommerce' ), 'desc' => __( 'This controls which shipping address is used by default.', 'woocommerce' ), 'id' => 'woocommerce_ship_to_destination', 'default' => 'billing', 'type' => 'radio', 'options' => array( 'shipping' => __( 'Default to customer shipping address', 'woocommerce' ), 'billing' => __( 'Default to customer billing address', 'woocommerce' ), 'billing_only' => __( 'Force shipping to the customer billing address', 'woocommerce' ), ), 'autoload' => false, 'desc_tip' => true, 'show_if_checked' => 'option', ),array( 'title' => __( 'Debug mode', 'woocommerce' ), 'desc' => __( 'Enable debug mode', 'woocommerce' ), 'desc_tip' => __( 'Enable shipping debug mode to show matching shipping zones and to bypass shipping rate cache.', 'woocommerce' ), 'id' => 'woocommerce_shipping_debug_mode', 'default' => 'no', 'type' => 'checkbox', 'autoload' => false, ),array( 'type' => 'sectionend', 'id' => 'shipping_options' ),)
The array.

Usage

To run the hook, copy the example below.
  1. $array = apply_filters( 'woocommerce_shipping_settings', $array ); 
  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_shipping_settings callback 
  2. function filter_woocommerce_shipping_settings( $array ) { 
  3. // make filter magic happen here... 
  4. return $array
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_shipping_settings', 'filter_woocommerce_shipping_settings', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_shipping_settings', 'filter_woocommerce_shipping_settings', 10, 1 ); 

Defined (1)

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

/includes/admin/settings/class-wc-settings-shipping.php  
  1. $settings = apply_filters( 'woocommerce_shipping_settings', array(