Changeset 40790 for trunk/src/wp-includes/script-loader.php
- Timestamp:
- 05/19/2017 05:48:01 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/script-loader.php
r40776 r40790 1013 1013 require_once( ABSPATH . 'wp-admin/includes/class-wp-community-events.php' ); 1014 1014 1015 $user_id = get_current_user_id(); 1016 $user_location = get_user_option( 'community-events-location', $user_id ); 1017 $events_client = new WP_Community_Events( $user_id, $user_location ); 1015 $user_id = get_current_user_id(); 1016 $saved_location = get_user_option( 'community-events-location', $user_id ); 1017 $saved_ip_address = isset( $saved_location['ip'] ) ? $saved_location['ip'] : false; 1018 $current_ip_address = WP_Community_Events::get_unsafe_client_ip(); 1019 1020 /* 1021 * If the user's location is based on their IP address, then update their 1022 * location when their IP address changes. This allows them to see events 1023 * in their current city when travelling. Otherwise, they would always be 1024 * shown events in the city where they were when they first loaded the 1025 * Dashboard, which could have been months or years ago. 1026 */ 1027 if ( $saved_ip_address && $current_ip_address && $current_ip_address !== $saved_ip_address ) { 1028 $saved_location['ip'] = $current_ip_address; 1029 update_user_option( $user_id, 'community-events-location', $saved_location, true ); 1030 } 1031 1032 $events_client = new WP_Community_Events( $user_id, $saved_location ); 1018 1033 1019 1034 wp_localize_script( 'dashboard', 'communityEventsData', array( … … 1024 1039 'enter_closest_city' => __( 'Enter your closest city to find nearby events.' ), 1025 1040 'error_occurred_please_try_again' => __( 'An error occurred. Please try again.' ), 1041 'attend_event_near_generic' => __( 'Attend an upcoming event near you.' ), 1026 1042 1027 1043 /*
Note: See TracChangeset
for help on using the changeset viewer.