WordPress at Your Fingertips
function is not described

WP_Community_Events::coordinates_match() protected WP 4.8.0

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

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

No Hooks.

Return

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

Usage

// protected - for code of main (parent) or child class
$result = $this->coordinates_match( $a, $b );
$a(array) (required)
The first pair, with indexes 'latitude' and 'longitude'.
$b(array) (required)
The second pair, with indexes 'latitude' and 'longitude'.

Changelog

Since 4.8.0 Introduced.

Code of WP_Community_Events::coordinates_match() WP 5.8.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'];
}