wp_print_community_events_templates

The timeline below displays how wordpress function wp_print_community_events_templates has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.4

/**
 * Renders the events templates for the Event and News widget.
 *
 * @since 4.8.0
 */
function wp_print_community_events_templates()
{
    ?>

	<script id="tmpl-community-events-attend-event-near" type="text/template">
		<?php 
    printf(
        /* translators: %s: The name of a city. */
        __('Attend an upcoming event near %s.'),
        '<strong>{{ data.location.description }}</strong>'
    );
    ?>
	</script>

	<script id="tmpl-community-events-could-not-locate" type="text/template">
		<?php 
    printf(
        /* 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.
         */
        __('%s could not be located. Please try another nearby city. For example: Kansas City; Springfield; Portland.'),
        '<em>{{data.unknownCity}}</em>'
    );
    ?>
	</script>

	<script id="tmpl-community-events-event-list" type="text/template">
		<# _.each( data.events, function( event ) { #>
			<li class="event event-{{ event.type }} wp-clearfix">
				<div class="event-info">
					<div class="dashicons event-icon" aria-hidden="true"></div>
					<div class="event-info-inner">
						<a class="event-title" href="{{ event.url }}">{{ event.title }}</a>
						<# if ( event.type ) {
							const titleCaseEventType = event.type.replace(
								/\w\S*/g,
								function ( type ) { return type.charAt(0).toUpperCase() + type.substr(1).toLowerCase(); }
							);
						#>
							{{ 'wordcamp' === event.type ? 'WordCamp' : titleCaseEventType }}
							<span class="ce-separator"></span>
						<# } #>
						<span class="event-city">{{ event.location.location }}</span>
					</div>
				</div>

				<div class="event-date-time">
					<span class="event-date">{{ event.user_formatted_date }}</span>
					<# if ( 'meetup' === event.type ) { #>
						<span class="event-time">
							{{ event.user_formatted_time }} {{ event.timeZoneAbbreviation }}
						</span>
					<# } #>
				</div>
			</li>
		<# } ) #>

		<# if ( data.events.length <= 2 ) { #>
			<li class="event-none">
				<?php 
    printf(
        /* translators: %s: Localized meetup organization documentation URL. */
        __('Want more events? <a href="%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">
		<li class="event-none">
			<# if ( data.location.description ) { #>
				<?php 
    printf(
        /* translators: 1: The city the user searched for, 2: Meetup organization documentation URL. */
        __('There are no events scheduled near %1$s at the moment. Would you like to <a href="%2$s">organize a WordPress event</a>?'),
        '{{ data.location.description }}',
        __('https://make.wordpress.org/community/handbook/meetup-organizer/welcome/')
    );
    ?>

			<# } else { #>
				<?php 
    printf(
        /* translators: %s: Meetup organization documentation URL. */
        __('There are no events scheduled near you at the moment. Would you like to <a href="%s">organize a WordPress event</a>?'),
        __('https://make.wordpress.org/community/handbook/meetup-organizer/welcome/')
    );
    ?>
			<# } #>
		</li>
	</script>
	<?php 
}

WordPress Version: 6.1

/**
 * Renders the events templates for the Event and News widget.
 *
 * @since 4.8.0
 */
function wp_print_community_events_templates()
{
    ?>

	<script id="tmpl-community-events-attend-event-near" type="text/template">
		<?php 
    printf(
        /* translators: %s: The name of a city. */
        __('Attend an upcoming event near %s.'),
        '<strong>{{ data.location.description }}</strong>'
    );
    ?>
	</script>

	<script id="tmpl-community-events-could-not-locate" type="text/template">
		<?php 
    printf(
        /* 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.
         */
        __('%s could not be located. Please try another nearby city. For example: Kansas City; Springfield; Portland.'),
        '<em>{{data.unknownCity}}</em>'
    );
    ?>
	</script>

	<script id="tmpl-community-events-event-list" type="text/template">
		<# _.each( data.events, function( event ) { #>
			<li class="event event-{{ event.type }} wp-clearfix">
				<div class="event-info">
					<div class="dashicons event-icon" aria-hidden="true"></div>
					<div class="event-info-inner">
						<a class="event-title" href="{{ event.url }}">{{ event.title }}</a>
						<span class="event-city">{{ event.location.location }}</span>
					</div>
				</div>

				<div class="event-date-time">
					<span class="event-date">{{ event.user_formatted_date }}</span>
					<# if ( 'meetup' === event.type ) { #>
						<span class="event-time">
							{{ event.user_formatted_time }} {{ event.timeZoneAbbreviation }}
						</span>
					<# } #>
				</div>
			</li>
		<# } ) #>

		<# if ( data.events.length <= 2 ) { #>
			<li class="event-none">
				<?php 
    printf(
        /* translators: %s: Localized meetup organization documentation URL. */
        __('Want more events? <a href="%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">
		<li class="event-none">
			<# if ( data.location.description ) { #>
				<?php 
    printf(
        /* translators: 1: The city the user searched for, 2: Meetup organization documentation URL. */
        __('There are no events scheduled near %1$s at the moment. Would you like to <a href="%2$s">organize a WordPress event</a>?'),
        '{{ data.location.description }}',
        __('https://make.wordpress.org/community/handbook/meetup-organizer/welcome/')
    );
    ?>

			<# } else { #>
				<?php 
    printf(
        /* translators: %s: Meetup organization documentation URL. */
        __('There are no events scheduled near you at the moment. Would you like to <a href="%s">organize a WordPress event</a>?'),
        __('https://make.wordpress.org/community/handbook/meetup-organizer/welcome/')
    );
    ?>
			<# } #>
		</li>
	</script>
	<?php 
}

WordPress Version: 5.7

/**
 * Renders the events templates for the Event and News widget.
 *
 * @since 4.8.0
 */
function wp_print_community_events_templates()
{
    ?>

	<script id="tmpl-community-events-attend-event-near" type="text/template">
		<?php 
    printf(
        /* translators: %s: The name of a city. */
        __('Attend an upcoming event near %s.'),
        '<strong>{{ data.location.description }}</strong>'
    );
    ?>
	</script>

	<script id="tmpl-community-events-could-not-locate" type="text/template">
		<?php 
    printf(
        /* 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.
         */
        __('We couldn&#8217;t locate %s. Please try another nearby city. For example: Kansas City; Springfield; Portland.'),
        '<em>{{data.unknownCity}}</em>'
    );
    ?>
	</script>

	<script id="tmpl-community-events-event-list" type="text/template">
		<# _.each( data.events, function( event ) { #>
			<li class="event event-{{ event.type }} wp-clearfix">
				<div class="event-info">
					<div class="dashicons event-icon" aria-hidden="true"></div>
					<div class="event-info-inner">
						<a class="event-title" href="{{ event.url }}">{{ event.title }}</a>
						<span class="event-city">{{ event.location.location }}</span>
					</div>
				</div>

				<div class="event-date-time">
					<span class="event-date">{{ event.user_formatted_date }}</span>
					<# if ( 'meetup' === event.type ) { #>
						<span class="event-time">
							{{ event.user_formatted_time }} {{ event.timeZoneAbbreviation }}
						</span>
					<# } #>
				</div>
			</li>
		<# } ) #>

		<# if ( data.events.length <= 2 ) { #>
			<li class="event-none">
				<?php 
    printf(
        /* translators: %s: Localized meetup organization documentation URL. */
        __('Want more events? <a href="%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">
		<li class="event-none">
			<# if ( data.location.description ) { #>
				<?php 
    printf(
        /* translators: 1: The city the user searched for, 2: Meetup organization documentation URL. */
        __('There aren&#8217;t any events scheduled near %1$s at the moment. Would you like to <a href="%2$s">organize a WordPress event</a>?'),
        '{{ data.location.description }}',
        __('https://make.wordpress.org/community/handbook/meetup-organizer/welcome/')
    );
    ?>

			<# } else { #>
				<?php 
    printf(
        /* translators: %s: Meetup organization documentation URL. */
        __('There aren&#8217;t any events scheduled near you at the moment. Would you like to <a href="%s">organize a WordPress event</a>?'),
        __('https://make.wordpress.org/community/handbook/meetup-organizer/welcome/')
    );
    ?>
			<# } #>
		</li>
	</script>
	<?php 
}

WordPress Version: .10

/**
 * Renders the events templates for the Event and News widget.
 *
 * @since 4.8.0
 */
function wp_print_community_events_templates()
{
    ?>

	<script id="tmpl-community-events-attend-event-near" type="text/template">
		<?php 
    printf(
        /* translators: %s: The name of a city. */
        __('Attend an upcoming event near %s.'),
        '<strong>{{ data.location.description }}</strong>'
    );
    ?>
	</script>

	<script id="tmpl-community-events-could-not-locate" type="text/template">
		<?php 
    printf(
        /* 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.
         */
        __('We couldn&#8217;t locate %s. Please try another nearby city. For example: Kansas City; Springfield; Portland.'),
        '<em>{{data.unknownCity}}</em>'
    );
    ?>
	</script>

	<script id="tmpl-community-events-event-list" type="text/template">
		<# _.each( data.events, function( event ) { #>
			<li class="event event-{{ event.type }} wp-clearfix">
				<div class="event-info">
					<div class="dashicons event-icon" aria-hidden="true"></div>
					<div class="event-info-inner">
						<a class="event-title" href="{{ event.url }}">{{ event.title }}</a>
						<span class="event-city">{{ event.location.location }}</span>
					</div>
				</div>

				<div class="event-date-time">
					<span class="event-date">{{ event.user_formatted_date }}</span>
					<# if ( 'meetup' === event.type ) { #>
						<span class="event-time">
							{{ event.user_formatted_time }} {{ event.timeZoneAbbreviation }}
						</span>
					<# } #>
				</div>
			</li>
		<# } ) #>
	</script>

	<script id="tmpl-community-events-no-upcoming-events" type="text/template">
		<li class="event-none">
			<# if ( data.location.description ) { #>
				<?php 
    printf(
        /* translators: 1: The city the user searched for, 2: Meetup organization documentation URL. */
        __('There aren&#8217;t any events scheduled near %1$s at the moment. Would you like to <a href="%2$s">organize a WordPress event</a>?'),
        '{{ data.location.description }}',
        __('https://make.wordpress.org/community/handbook/meetup-organizer/welcome/')
    );
    ?>

			<# } else { #>
				<?php 
    printf(
        /* translators: %s: Meetup organization documentation URL. */
        __('There aren&#8217;t any events scheduled near you at the moment. Would you like to <a href="%s">organize a WordPress event</a>?'),
        __('https://make.wordpress.org/community/handbook/meetup-organizer/welcome/')
    );
    ?>
			<# } #>
		</li>
	</script>
	<?php 
}

WordPress Version: 5.5

/**
 * Renders the events templates for the Event and News widget.
 *
 * @since 4.8.0
 */
function wp_print_community_events_templates()
{
    ?>

	<script id="tmpl-community-events-attend-event-near" type="text/template">
		<?php 
    printf(
        /* translators: %s: The name of a city. */
        __('Attend an upcoming event near %s.'),
        '<strong>{{ data.location.description }}</strong>'
    );
    ?>
	</script>

	<script id="tmpl-community-events-could-not-locate" type="text/template">
		<?php 
    printf(
        /* 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.
         */
        __('We couldn&#8217;t locate %s. Please try another nearby city. For example: Kansas City; Springfield; Portland.'),
        '<em>{{data.unknownCity}}</em>'
    );
    ?>
	</script>

	<script id="tmpl-community-events-event-list" type="text/template">
		<# _.each( data.events, function( event ) { #>
			<li class="event event-{{ event.type }} wp-clearfix">
				<div class="event-info">
					<div class="dashicons event-icon" aria-hidden="true"></div>
					<div class="event-info-inner">
						<a class="event-title" href="{{ event.url }}">{{ event.title }}</a>
						<span class="event-city">{{ event.location.location }}</span>
					</div>
				</div>

				<div class="event-date-time">
					<span class="event-date">{{ event.formatted_date }}</span>
					<# if ( 'meetup' === event.type ) { #>
						<span class="event-time">{{ event.formatted_time }}</span>
					<# } #>
				</div>
			</li>
		<# } ) #>
	</script>

	<script id="tmpl-community-events-no-upcoming-events" type="text/template">
		<li class="event-none">
			<# if ( data.location.description ) { #>
				<?php 
    printf(
        /* translators: 1: The city the user searched for, 2: Meetup organization documentation URL. */
        __('There aren&#8217;t any events scheduled near %1$s at the moment. Would you like to <a href="%2$s">organize a WordPress event</a>?'),
        '{{ data.location.description }}',
        __('https://make.wordpress.org/community/handbook/meetup-organizer/welcome/')
    );
    ?>

			<# } else { #>
				<?php 
    printf(
        /* translators: %s: Meetup organization documentation URL. */
        __('There aren&#8217;t any events scheduled near you at the moment. Would you like to <a href="%s">organize a WordPress event</a>?'),
        __('https://make.wordpress.org/community/handbook/meetup-organizer/welcome/')
    );
    ?>
			<# } #>
		</li>
	</script>
	<?php 
}

WordPress Version: 5.3

/**
 * Renders the events templates for the Event and News widget.
 *
 * @since 4.8.0
 */
function wp_print_community_events_templates()
{
    ?>

	<script id="tmpl-community-events-attend-event-near" type="text/template">
		<?php 
    printf(
        /* translators: %s: The name of a city. */
        __('Attend an upcoming event near %s.'),
        '<strong>{{ data.location.description }}</strong>'
    );
    ?>
	</script>

	<script id="tmpl-community-events-could-not-locate" type="text/template">
		<?php 
    printf(
        /* 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.
         */
        __('We couldn&#8217;t locate %s. Please try another nearby city. For example: Kansas City; Springfield; Portland.'),
        '<em>{{data.unknownCity}}</em>'
    );
    ?>
	</script>

	<script id="tmpl-community-events-event-list" type="text/template">
		<# _.each( data.events, function( event ) { #>
			<li class="event event-{{ event.type }} wp-clearfix">
				<div class="event-info">
					<div class="dashicons event-icon" aria-hidden="true"></div>
					<div class="event-info-inner">
						<a class="event-title" href="{{ event.url }}">{{ event.title }}</a>
						<span class="event-city">{{ event.location.location }}</span>
					</div>
				</div>

				<div class="event-date-time">
					<span class="event-date">{{ event.formatted_date }}</span>
					<# if ( 'meetup' === event.type ) { #>
						<span class="event-time">{{ event.formatted_time }}</span>
					<# } #>
				</div>
			</li>
		<# } ) #>
	</script>

	<script id="tmpl-community-events-no-upcoming-events" type="text/template">
		<li class="event-none">
			<# if ( data.location.description ) { #>
				<?php 
    printf(
        /* translators: 1: The city the user searched for, 2: Meetup organization documentation URL. */
        __('There aren&#8217;t any events scheduled near %1$s at the moment. Would you like to <a href="%2$s">organize one</a>?'),
        '{{ data.location.description }}',
        __('https://make.wordpress.org/community/handbook/meetup-organizer/welcome/')
    );
    ?>

			<# } else { #>
				<?php 
    printf(
        /* translators: %s: Meetup organization documentation URL. */
        __('There aren&#8217;t any events scheduled near you at the moment. Would you like to <a href="%s">organize one</a>?'),
        __('https://make.wordpress.org/community/handbook/meetup-organizer/welcome/')
    );
    ?>
			<# } #>
		</li>
	</script>
	<?php 
}

WordPress Version: 4.9

/**
 * Renders the events templates for the Event and News widget.
 *
 * @since 4.8.0
 */
function wp_print_community_events_templates()
{
    ?>

	<script id="tmpl-community-events-attend-event-near" type="text/template">
		<?php 
    printf(
        /* translators: %s: the name of a city */
        __('Attend an upcoming event near %s.'),
        '<strong>{{ data.location.description }}</strong>'
    );
    ?>
	</script>

	<script id="tmpl-community-events-could-not-locate" type="text/template">
		<?php 
    printf(
        /* 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.
         */
        __('We couldn&#8217;t locate %s. Please try another nearby city. For example: Kansas City; Springfield; Portland.'),
        '<em>{{data.unknownCity}}</em>'
    );
    ?>
	</script>

	<script id="tmpl-community-events-event-list" type="text/template">
		<# _.each( data.events, function( event ) { #>
			<li class="event event-{{ event.type }} wp-clearfix">
				<div class="event-info">
					<div class="dashicons event-icon" aria-hidden="true"></div>
					<div class="event-info-inner">
						<a class="event-title" href="{{ event.url }}">{{ event.title }}</a>
						<span class="event-city">{{ event.location.location }}</span>
					</div>
				</div>

				<div class="event-date-time">
					<span class="event-date">{{ event.formatted_date }}</span>
					<# if ( 'meetup' === event.type ) { #>
						<span class="event-time">{{ event.formatted_time }}</span>
					<# } #>
				</div>
			</li>
		<# } ) #>
	</script>

	<script id="tmpl-community-events-no-upcoming-events" type="text/template">
		<li class="event-none">
			<# if ( data.location.description ) { #>
				<?php 
    printf(
        /* translators: 1: the city the user searched for, 2: meetup organization documentation URL */
        __('There aren&#8217;t any events scheduled near %1$s at the moment. Would you like to <a href="%2$s">organize one</a>?'),
        '{{ data.location.description }}',
        __('https://make.wordpress.org/community/handbook/meetup-organizer/welcome/')
    );
    ?>

			<# } else { #>
				<?php 
    printf(
        /* translators: %s: meetup organization documentation URL */
        __('There aren&#8217;t any events scheduled near you at the moment. Would you like to <a href="%s">organize one</a>?'),
        __('https://make.wordpress.org/community/handbook/meetup-organizer/welcome/')
    );
    ?>
			<# } #>
		</li>
	</script>
	<?php 
}

WordPress Version: 4.8

/**
 * Renders the events templates for the Event and News widget.
 *
 * @since 4.8.0
 */
function wp_print_community_events_templates()
{
    ?>

	<script id="tmpl-community-events-attend-event-near" type="text/template">
		<?php 
    printf(
        /* translators: %s is a placeholder for the name of a city. */
        __('Attend an upcoming event near %s.'),
        '<strong>{{ data.location.description }}</strong>'
    );
    ?>
	</script>

	<script id="tmpl-community-events-could-not-locate" type="text/template">
		<?php 
    printf(
        /* 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.
         */
        __('We couldn&#8217;t locate %s. Please try another nearby city. For example: Kansas City; Springfield; Portland.'),
        '<em>{{data.unknownCity}}</em>'
    );
    ?>
	</script>

	<script id="tmpl-community-events-event-list" type="text/template">
		<# _.each( data.events, function( event ) { #>
			<li class="event event-{{ event.type }} wp-clearfix">
				<div class="event-info">
					<div class="dashicons event-icon" aria-hidden="true"></div>
					<div class="event-info-inner">
						<a class="event-title" href="{{ event.url }}">{{ event.title }}</a>
						<span class="event-city">{{ event.location.location }}</span>
					</div>
				</div>

				<div class="event-date-time">
					<span class="event-date">{{ event.formatted_date }}</span>
					<# if ( 'meetup' === event.type ) { #>
						<span class="event-time">{{ event.formatted_time }}</span>
					<# } #>
				</div>
			</li>
		<# } ) #>
	</script>

	<script id="tmpl-community-events-no-upcoming-events" type="text/template">
		<li class="event-none">
			<# if ( data.location.description ) { #>
				<?php 
    printf(
        /* translators: 1: the city the user searched for, 2: meetup organization documentation URL */
        __('There aren&#8217;t any events scheduled near %1$s at the moment. Would you like to <a href="%2$s">organize one</a>?'),
        '{{ data.location.description }}',
        __('https://make.wordpress.org/community/handbook/meetup-organizer/welcome/')
    );
    ?>

			<# } else { #>
				<?php 
    printf(
        /* translators: meetup organization documentation URL. */
        __('There aren&#8217;t any events scheduled near you at the moment. Would you like to <a href="%s">organize one</a>?'),
        __('https://make.wordpress.org/community/handbook/meetup-organizer/welcome/')
    );
    ?>
			<# } #>
		</li>
	</script>
	<?php 
}