From 683e767517b1f9d7a8e97a3214026af2471c56ce Mon Sep 17 00:00:00 2001 From: iandunn Date: Tue, 2 Feb 2021 00:43:06 +0000 Subject: [PATCH] Community Events: Show organizer CTA when less than 3 events. When no events are available in the Events Widget, people have always been shown a message encouraging them to help organize one (see `tmpl-community-events-no-upcoming-events`). Now that it's common for online WordCamps and Learn discussion groups to be pinned to the Events API, it's rare that there are no events in the widget, even if there are no _local_ events. Because of that, users are rarely encouraged to join their local community and help organize. This commit adds an additional call-to-action message, which is shown when there are only 1 or 2 events available. Props anyssa, sippis, AmethystAnswers. Fixes #51664. Built from https://develop.svn.wordpress.org/trunk@50133 git-svn-id: http://core.svn.wordpress.org/trunk@49812 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/dashboard.php | 13 +++++++++++++ wp-includes/version.php | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index b8550b4c8a..b475900fac 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -1398,6 +1398,19 @@ function wp_print_community_events_templates() { <# } ) #> + + <# if ( data.events.length <= 2 ) { #> +
  • + Help organize the next one!' ), + __( 'https://make.wordpress.org/community/organize-event-landing-page/' ) + ); + ?> +
  • + <# } #> +