WC_Gateway_COD::get_matching_rates()privateWC 3.4.0

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

Метод класса: WC_Gateway_COD{}

Хуков нет.

Возвращает

Массив.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->get_matching_rates( $rate_ids );
$rate_ids(массив) (обязательный)
Rate ids to check.

Список изменений

С версии 3.4.0 Введена.

Код WC_Gateway_COD::get_matching_rates() WC 8.7.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 ) ) ) ) );
}