tribe_show_community_tickets_fail_message()

Loads language files and displays notice of missing requirements if Common is unavailable due to both The Events Calendar (TEC) and Event Tickets (ET) not being active.

Bonus, if you check against a function that is hooked to ‘admin_notices’ action, it will be unhooked to avoid notice overkill, which is why this notice fires on priority 5 when lacking Common. This makes sense for Community Tickets because it has the most requirements; we do not want both CT and CE to display a notice that says TEC is required.

See also


Top ↑

Source

File: events-community-tickets.php

function tribe_show_community_tickets_fail_message() {
	if ( ! current_user_can( 'activate_plugins' ) ) {
		return;
	}

	$mopath = trailingslashit( basename( dirname( __FILE__ ) ) ) . 'lang/';
	$domain = 'tribe-events-community-tickets';

	// If we don't have Common classes load the old fashioned way
	if ( ! class_exists( 'Tribe__Main' ) ) {
		load_plugin_textdomain( $domain, false, $mopath );
	} else {
		// This will load `wp-content/languages/plugins` files first
		Tribe__Main::instance()->load_text_domain( $domain, $mopath );
	}

	$url = 'plugin-install.php?tab=plugin-information&plugin=the-events-calendar&TB_iframe=true';

	echo '<div class="error"><p>'
	. sprintf(
		'%1s <a href="%2s" class="thickbox" title="%3s">%4s</a>.',
		esc_html__( 'To begin using The Events Calendar: Community Events Tickets, please install the latest version of', 'tribe-events-community-tickets' ),
		esc_url( $url ),
		esc_html__( 'The Events Calendar', 'tribe-events-community-tickets' ),
		esc_html__( 'The Events Calendar', 'tribe-events-community-tickets' )
		) .
	'</p></div>';
}

Top ↑

Changelog

Changelog
Version Description
4.7.1 Added messaging for all the required plugins, not just TEC.
4.6 Introduced.