WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WP_Community_Events::get_events_transient_key() protected WP 4.8.0

Generates a transient key based on user location.

This could be reduced to a one-liner in the calling functions, but it's intentionally a separate function because it's called from multiple functions, and having it abstracted keeps the logic consistent and DRY, which is less prone to errors.

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

Хуков нет.

Возвращает

true/false/Строку. false on failure, or a string on success.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_events_transient_key( $location );
$location(массив) (обязательный)
Should contain 'latitude' and 'longitude' indexes.

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

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

Код WP Community Events::get events transient key: wp-admin/includes/class-wp-community-events.php WP 5.5.1

<?php
protected function get_events_transient_key( $location ) {
	$key = false;

	if ( isset( $location['ip'] ) ) {
		$key = 'community-events-' . md5( $location['ip'] );
	} elseif ( isset( $location['latitude'], $location['longitude'] ) ) {
		$key = 'community-events-' . md5( $location['latitude'] . $location['longitude'] );
	}

	return $key;
}