WordPress at Your Fingertips
function is not described

WC_Gateway_COD::get_matching_rates() private WC 3.4.0

Indicates whether a rate exists in an array of canonically-formatted rate IDs that activates this gateway.

{} It's a method of the class: WC_Gateway_COD{}

No Hooks.




// private - for code of main (parent) class only
$result = $this->get_matching_rates( $rate_ids );
$rate_ids(array) (required)
Rate ids to check.


Since 3.4.0 Introduced.

Code of WC_Gateway_COD::get_matching_rates() WC 5.6.0

private function get_matching_rates( $rate_ids ) {
	// First, match entries in 'method_id:instance_id' format. Then, match entries in 'method_id' format by stripping off the instance ID from the candidates.
	return array_unique( array_merge( array_intersect( $this->enable_for_methods, $rate_ids ), array_intersect( $this->enable_for_methods, array_unique( array_map( 'wc_get_string_before_colon', $rate_ids ) ) ) ) );