WP_Community_Events::coordinates_match()protectedWP 4.8.0

Test if two pairs of latitude/longitude coordinates match each other.

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

Хуков нет.

Возвращает

true|false. True if they match, false if they don't.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->coordinates_match( $a, $b );
$a(массив) (обязательный)
The first pair, with indexes 'latitude' and 'longitude'.
$b(массив) (обязательный)
The second pair, with indexes 'latitude' and 'longitude'.

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

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

Код WP_Community_Events::coordinates_match() WP 6.5.2

protected function coordinates_match( $a, $b ) {
	if ( ! isset( $a['latitude'], $a['longitude'], $b['latitude'], $b['longitude'] ) ) {
		return false;
	}

	return $a['latitude'] === $b['latitude'] && $a['longitude'] === $b['longitude'];
}