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
This commit is contained in:
iandunn 2021-02-02 00:43:06 +00:00
parent faa29f5716
commit 683e767517
2 changed files with 14 additions and 1 deletions

View File

@ -1398,6 +1398,19 @@ function wp_print_community_events_templates() {
</div>
</li>
<# } ) #>
<# if ( data.events.length <= 2 ) { #>
<li class="event-none">
<?php
printf(
/* translators: 1: Localized meetup organization documentation URL. */
__( 'Want more events? <a href="%1$s">Help organize the next one</a>!' ),
__( 'https://make.wordpress.org/community/organize-event-landing-page/' )
);
?>
</li>
<# } #>
</script>
<script id="tmpl-community-events-no-upcoming-events" type="text/template">

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.7-alpha-50132';
$wp_version = '5.7-alpha-50133';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.