On this page
WP_Community_Events::__construct( int $user_id, false|array $user_location = false )
Constructor for WP_Community_Events.
Parameters
$user_idint Required-
WP user ID.
$user_locationfalse|array Optional-
Stored location data for the user. false to pass no location.
descriptionstringThe name of the locationlatitudestringThe latitude in decimal degrees notation, without the degree symbol. e.g.: 47.615200.longitudestringThe longitude in decimal degrees notation, without the degree symbol. e.g.: -122.341100.countrystringThe ISO 3166-1 alpha-2 country code. e.g.: BR
Default:
false
Source
File: wp-admin/includes/class-wp-community-events.php. View all references
public function __construct( $user_id, $user_location = false ) {
$this->user_id = absint( $user_id );
$this->user_location = $user_location;
}
Related
Uses
| Uses | Description |
|---|---|
| absint() wp-includes/functions.php | Converts a value to non-negative integer. |
Used By
| Used By | Description |
|---|---|
| wp_localize_community_events() wp-includes/script-loader.php | Localizes community events data that needs to be passed to dashboard.js. |
| wp_ajax_get_community_events() wp-admin/includes/ajax-actions.php | Handles Ajax requests for community events |
Changelog
| Version | Description |
|---|---|
| 4.8.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_community_events/__construct