diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index 0f0058127f..922d2760b4 100644 --- a/src/wp-admin/includes/dashboard.php +++ b/src/wp-admin/includes/dashboard.php @@ -129,46 +129,6 @@ function wp_dashboard_setup() { do_action( 'do_meta_boxes', $screen->id, 'side', '' ); } -/** - * Gets the community events data that needs to be passed to dashboard.js. - * - * @since 4.8.0 - * - * @return array The script data. - */ -function wp_get_community_events_script_data() { - require_once( ABSPATH . 'wp-admin/includes/class-wp-community-events.php' ); - - $user_id = get_current_user_id(); - $user_location = get_user_option( 'community-events-location', $user_id ); - $events_client = new WP_Community_Events( $user_id, $user_location ); - - $script_data = array( - 'nonce' => wp_create_nonce( 'community_events' ), - 'cache' => $events_client->get_cached_events(), - - 'l10n' => array( - 'enter_closest_city' => __( 'Enter your closest city to find nearby events.' ), - 'error_occurred_please_try_again' => __( 'An error occured. Please try again.' ), - - /* - * These specific examples were chosen to highlight the fact that a - * state is not needed, even for cities whose name is not unique. - * It would be too cumbersome to include that in the instructions - * to the user, so it's left as an implication. - */ - /* translators: %s is the name of the city we couldn't locate. Replace the examples with cities in your locale, but test that they match the expected location before including them. Use endonyms (native locale names) whenever possible. */ - 'could_not_locate_city' => __( "We couldn't locate %s. Please try another nearby city. For example: Kansas City; Springfield; Portland." ), - - // This one is only used with wp.a11y.speak(), so it can/should be more brief. - /* translators: %s is the name of a city. */ - 'city_updated' => __( 'City updated. Listing events near %s.' ), - ) - ); - - return $script_data; -} - /** * Adds a new dashboard widget. * @@ -1170,24 +1130,22 @@ function wp_dashboard_events_news() { * @since 4.8.0 */ function wp_print_community_events_markup() { - $script_data = wp_get_community_events_script_data(); - ?>
-