Make WordPress Core

Changeset 40651


Ignore:
Timestamp:
05/12/2017 03:52:09 PM (7 years ago)
Author:
obenland
Message:

Dashboard: Persist location for community events

Fixes a bug where cached events & location data was not accessible because the
cache key could not be regenerated without latitude and longitude information.

Discovered and fixed during #wcber contributor day.

Props soean, kubik-rubik, obenland.
See #40702.

Location:
trunk/src/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ajax-actions.php

    r40607 r40651  
    320320    } else {
    321321        if ( isset( $events['location'] ) ) {
    322             // Send only the data that the client will use.
    323             $events['location'] = $events['location']['description'];
    324 
    325322            // Store the location network-wide, so the user doesn't have to set it on each site.
    326323            update_user_option( $user_id, 'community-events-location', $events['location'], true );
  • trunk/src/wp-admin/includes/dashboard.php

    r40643 r40651  
    12441244            /* translators: %s is a placeholder for the name of a city. */
    12451245            __( 'Attend an upcoming event near %s.' ),
    1246             '<strong>{{ data.location }}</strong>'
     1246            '<strong>{{ data.location.description }}</strong>'
    12471247        ); ?>
    12481248    </script>
     
    12811281                /* translators: 1: the city the user searched for, 2: meetup organization documentation URL */
    12821282                __( 'There aren&#8217;t any events scheduled near %1$s at the moment. Would you like to <a href="%2$s">organize one</a>?' ),
    1283                 '{{data.location}}',
     1283                '{{ data.location.description }}',
    12841284                __( 'https://make.wordpress.org/community/handbook/meetup-organizer/welcome/' )
    12851285            ); ?>
Note: See TracChangeset for help on using the changeset viewer.