WP_Community_Events::coordinates_match( array $a, array $b ): bool

In this article

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

Parameters

$aarrayrequired
The first pair, with indexes 'latitude' and 'longitude'.
$barrayrequired
The second pair, with indexes 'latitude' and 'longitude'.

Return

bool True if they match, false if they don’t.

Source

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'];
}

Changelog

VersionDescription
4.8.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.