get_cost(); } ); $has_free_shipping = (bool) array_filter( $free, static function ( $rate ) { return 'free_shipping' === $rate->get_method_id(); } ); return $has_free_shipping ? $free : $rates; } }