diff --git src/wp-admin/includes/ajax-actions.php src/wp-admin/includes/ajax-actions.php
index 029e20e62b..634713b195 100644
|
|
function wp_ajax_get_community_events() { |
319 | 319 | ) ); |
320 | 320 | } else { |
321 | 321 | if ( isset( $events['location'] ) ) { |
322 | | // Send only the data that the client will use. |
323 | | $events['location'] = $events['location']['description']; |
324 | | |
325 | 322 | // Store the location network-wide, so the user doesn't have to set it on each site. |
326 | 323 | update_user_option( $user_id, 'community-events-location', $events['location'], true ); |
| 324 | |
| 325 | // Send only the data that the client will use. |
| 326 | $events['location'] = $events['location']['description']; |
327 | 327 | } |
328 | 328 | |
329 | 329 | wp_send_json_success( $events ); |
diff --git src/wp-admin/includes/dashboard.php src/wp-admin/includes/dashboard.php
index b25426e753..f3de00e32b 100644
|
|
function wp_get_community_events_script_data() { |
142 | 142 | $user_id = get_current_user_id(); |
143 | 143 | $user_location = get_user_option( 'community-events-location', $user_id ); |
144 | 144 | $events_client = new WP_Community_Events( $user_id, $user_location ); |
| 145 | $cached_data = $events_client->get_cached_events(); |
| 146 | |
| 147 | // Send only the data that the client will use. |
| 148 | $cached_data['location'] = $cached_data['location']['description']; |
145 | 149 | |
146 | 150 | $script_data = array( |
147 | 151 | 'nonce' => wp_create_nonce( 'community_events' ), |
148 | | 'cache' => $events_client->get_cached_events(), |
| 152 | 'cache' => $cached_data, |
149 | 153 | |
150 | 154 | 'l10n' => array( |
151 | 155 | 'enter_closest_city' => __( 'Enter your closest city to find nearby events.' ), |