wp_print_community_events_markup

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

WordPress Version: 6.4

/**
 * Prints the markup for the Community Events section of the Events and News Dashboard widget.
 *
 * @since 4.8.0
 */
function wp_print_community_events_markup()
{
    $community_events_notice = '<p class="hide-if-js">' . 'This widget requires JavaScript.' . '</p>';
    $community_events_notice .= '<p class="community-events-error-occurred" aria-hidden="true">' . __('An error occurred. Please try again.') . '</p>';
    $community_events_notice .= '<p class="community-events-could-not-locate" aria-hidden="true"></p>';
    wp_admin_notice($community_events_notice, array('type' => 'error', 'additional_classes' => array('community-events-errors', 'inline', 'hide-if-js'), 'paragraph_wrap' => false));
    /*
     * Hide the main element when the page first loads, because the content
     * won't be ready until wp.communityEvents.renderEventsTemplate() has run.
     */
    ?>
	<div id="community-events" class="community-events" aria-hidden="true">
		<div class="activity-block">
			<p>
				<span id="community-events-location-message"></span>

				<button class="button-link community-events-toggle-location" aria-expanded="false">
					<span class="dashicons dashicons-location" aria-hidden="true"></span>
					<span class="community-events-location-edit"><?php 
    _e('Select location');
    ?></span>
				</button>
			</p>

			<form class="community-events-form" aria-hidden="true" action="<?php 
    echo esc_url(admin_url('admin-ajax.php'));
    ?>" method="post">
				<label for="community-events-location">
					<?php 
    _e('City:');
    ?>
				</label>
				<?php 
    /* translators: Replace with a city related to your locale.
     * Test that it matches the expected location and has upcoming
     * events before including it. If no cities related to your
     * locale have events, then use a city related to your locale
     * that would be recognizable to most users. Use only the city
     * name itself, without any region or country. Use the endonym
     * (native locale name) instead of the English name if possible.
     */
    ?>
				<input id="community-events-location" class="regular-text" type="text" name="community-events-location" placeholder="<?php 
    esc_attr_e('Cincinnati');
    ?>" />

				<?php 
    submit_button(__('Submit'), 'secondary', 'community-events-submit', false);
    ?>

				<button class="community-events-cancel button-link" type="button" aria-expanded="false">
					<?php 
    _e('Cancel');
    ?>
				</button>

				<span class="spinner"></span>
			</form>
		</div>

		<ul class="community-events-results activity-block last"></ul>
	</div>

	<?php 
}

WordPress Version: 5.9

/**
 * Prints the markup for the Community Events section of the Events and News Dashboard widget.
 *
 * @since 4.8.0
 */
function wp_print_community_events_markup()
{
    ?>

	<div class="community-events-errors notice notice-error inline hide-if-js">
		<p class="hide-if-js">
			<?php 
    _e('This widget requires JavaScript.');
    ?>
		</p>

		<p class="community-events-error-occurred" aria-hidden="true">
			<?php 
    _e('An error occurred. Please try again.');
    ?>
		</p>

		<p class="community-events-could-not-locate" aria-hidden="true"></p>
	</div>

	<div class="community-events-loading hide-if-no-js">
		<?php 
    _e('Loading&hellip;');
    ?>
	</div>

	<?php 
    /*
     * Hide the main element when the page first loads, because the content
     * won't be ready until wp.communityEvents.renderEventsTemplate() has run.
     */
    ?>
	<div id="community-events" class="community-events" aria-hidden="true">
		<div class="activity-block">
			<p>
				<span id="community-events-location-message"></span>

				<button class="button-link community-events-toggle-location" aria-expanded="false">
					<span class="dashicons dashicons-location" aria-hidden="true"></span>
					<span class="community-events-location-edit"><?php 
    _e('Select location');
    ?></span>
				</button>
			</p>

			<form class="community-events-form" aria-hidden="true" action="<?php 
    echo esc_url(admin_url('admin-ajax.php'));
    ?>" method="post">
				<label for="community-events-location">
					<?php 
    _e('City:');
    ?>
				</label>
				<?php 
    /* translators: Replace with a city related to your locale.
     * Test that it matches the expected location and has upcoming
     * events before including it. If no cities related to your
     * locale have events, then use a city related to your locale
     * that would be recognizable to most users. Use only the city
     * name itself, without any region or country. Use the endonym
     * (native locale name) instead of the English name if possible.
     */
    ?>
				<input id="community-events-location" class="regular-text" type="text" name="community-events-location" placeholder="<?php 
    esc_attr_e('Cincinnati');
    ?>" />

				<?php 
    submit_button(__('Submit'), 'secondary', 'community-events-submit', false);
    ?>

				<button class="community-events-cancel button-link" type="button" aria-expanded="false">
					<?php 
    _e('Cancel');
    ?>
				</button>

				<span class="spinner"></span>
			</form>
		</div>

		<ul class="community-events-results activity-block last"></ul>
	</div>

	<?php 
}

WordPress Version: 4.8

/**
 * Prints the markup for the Community Events section of the Events and News Dashboard widget.
 *
 * @since 4.8.0
 */
function wp_print_community_events_markup()
{
    ?>

	<div class="community-events-errors notice notice-error inline hide-if-js">
		<p class="hide-if-js">
			<?php 
    _e('This widget requires JavaScript.');
    ?>
		</p>

		<p class="community-events-error-occurred" aria-hidden="true">
			<?php 
    _e('An error occurred. Please try again.');
    ?>
		</p>

		<p class="community-events-could-not-locate" aria-hidden="true"></p>
	</div>

	<div class="community-events-loading hide-if-no-js">
		<?php 
    _e('Loading&hellip;');
    ?>
	</div>

	<?php 
    /*
     * Hide the main element when the page first loads, because the content
     * won't be ready until wp.communityEvents.renderEventsTemplate() has run.
     */
    ?>
	<div id="community-events" class="community-events" aria-hidden="true">
		<div class="activity-block">
			<p>
				<span id="community-events-location-message"></span>

				<button class="button-link community-events-toggle-location" aria-label="<?php 
    esc_attr_e('Edit city');
    ?>" aria-expanded="false">
					<span class="dashicons dashicons-edit"></span>
				</button>
			</p>

			<form class="community-events-form" aria-hidden="true" action="<?php 
    echo esc_url(admin_url('admin-ajax.php'));
    ?>" method="post">
				<label for="community-events-location">
					<?php 
    _e('City:');
    ?>
				</label>
				<?php 
    /* translators: Replace with a city related to your locale.
     * Test that it matches the expected location and has upcoming
     * events before including it. If no cities related to your
     * locale have events, then use a city related to your locale
     * that would be recognizable to most users. Use only the city
     * name itself, without any region or country. Use the endonym
     * (native locale name) instead of the English name if possible.
     */
    ?>
				<input id="community-events-location" class="regular-text" type="text" name="community-events-location" placeholder="<?php 
    esc_attr_e('Cincinnati');
    ?>" />

				<?php 
    submit_button(__('Submit'), 'secondary', 'community-events-submit', false);
    ?>

				<button class="community-events-cancel button-link" type="button" aria-expanded="false">
					<?php 
    _e('Cancel');
    ?>
				</button>

				<span class="spinner"></span>
			</form>
		</div>

		<ul class="community-events-results activity-block last"></ul>
	</div>

	<?php 
}