Settings::show_upgrade()

should we show the upgrade nags?


Return

(boolean)


Top ↑

Source

File: src/Tribe/Admin/Settings.php

	public function show_upgrade(): bool {
		// This allows sub-site admins to utilize this setting when their access to plugins is restricted.
		$can_show_tab = current_user_can( 'activate_plugins' ) || ( is_multisite() && current_user_can( 'customize' ) );

		/**
		 * Provides an opportunity to override the decision to show or hide the upgrade tab.
		 *
		 * Normally it will only show if the current user has the "activate_plugins" capability
		 * and there are some currently-activated premium plugins.
		 *
		 * @since 4.9.12
		 * @since 6.0.0 This filter now controls only the capability to show the Upgrade tab.
		 *
		 * @param bool $can_show_tab True or False for showing the Upgrade Tab.
		 */
		$can_show_tab = apply_filters( 'tribe_events_show_upgrade_tab', $can_show_tab  );

		if ( ! $can_show_tab ) {
			return false;
		}

		/**
		 * Filters whether the Upgrade Tab has actually any content to show or not.
		 *
		 * @since 6.0.0
		 *
		 * @param bool $has_content Whether the tab has any content to show or not.
		 */
		if ( ! apply_filters( 'tec_events_upgrade_tab_has_content', false ) ) {
			return false;
		}

		return true;
	}

Top ↑

Changelog

Changelog
Version Description
6.0.5 Moved to Settings class.
4.9.12 Introduced.