Core Class
View Source on Trac ↗
Core Class
WP_Community_Events
class WP_Community_Events
// Constructor: function Object() { [native code] } Class WP_Community_Events.
Methods 11 methods
| Method / Return | Description |
|---|---|
| __construct() void | Constructor for WP_Community_Events.
Parameters: $user_id: mixed, $user_location: mixed |
| get_events() (array | Gets data about events near a particular location.
Parameters: $location_search: mixed, $timezone: mixed |
| get_request_args() array | Builds an array of args to use in an HTTP request to the w.org Events API.
Parameters: $search: mixed, $timezone: mixed |
| get_unsafe_client_ip() (string | Determines the user's actual IP address and attempts to partially |
| coordinates_match() bool | Test if two pairs of latitude/longitude coordinates match each other.
Parameters: $a: mixed, $b: mixed |
| get_events_transient_key() (string | Generates a transient key based on user location.
Parameters: $location: mixed |
| cache_events() bool | Caches an array of events data from the Events API.
Parameters: $events: mixed, $expiration: mixed |
| get_cached_events() (array | Gets cached events. |
| format_event_data_time() array | Adds formatted date and time items for each event in an API response.
Parameters: $response_body: mixed |
| trim_events() array | Prepares the event list for presentation.
Parameters: $events: array |
| maybe_log_events_response() void | Logs responses to Events API requests.
Parameters: $message: mixed, $details: mixed |
Properties
| Property / Type | Description |
|---|---|
| $user_id mixed public | No description available. |
| $user_location mixed public | No description available. |
Class Information
Since Version
4.8.0
Source File
wp-admin/includes/class-wp-community-events.php
Advertisement