woocommerce_package_rates

woocommerce_package_rates

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

apply_filters('woocommerce_package_rates') is found 1 times:

  • /includes/class-wc-shipping.php line 368
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    * @see https://gist.github.com/woogists/271654709e1d27648546e83253c1a813 for cache invalidation methods.
     * @param array $package['rates'] Package rates.
     * @param array $package Package of cart items.
     */
    $package['rates'] = apply_filters( 'woocommerce_package_rates', $package['rates'], $package );
     
    // Package rates should be an array, if it was filtered into a non-array, reset it. Don't reset to the
    // unfiltered value, as e.g. a 3pd could have set it to "false" to remove rates.
    if ( ! is_array( $package['rates'] ) ) {
        $package['rates'] = array();
    }