woocommerce_package_rates

woocommerce_package_rates

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

See hook in core

Displaying hooks found in version: woocommerce.9.9.5

apply_filters('woocommerce_package_rates') is found 1 times:

  • /includes/class-wc-shipping.php line 395
    			 * @since 2.0.0
    			 * @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();
    			}