Tribe__Dependency::is_extension( string $class )

Test if plugin is an extension.

This is cludgy as none of our extensions flag themselves as such. THus, we have to do some text searching.


Parameters

$class

(string) (Required) - the classname to use to look up the plugin.


Top ↑

Return

(boolean)


Top ↑

Source

File: src/Tribe/Dependency.php

		public function is_extension( $class ): bool {
			$plugin = $this->get_registered_plugin_by_class( $class );
			$bad_words = [
				'extension',
				'labs',
				'hubspot',
				'mt_support',
				'support_team',
				'idea_garden',
			];

			foreach ( $bad_words as $bad_word ) {
				if ( stripos( $plugin['class'], $bad_word ) !== false ) {
					return true;
				}
			}

			// For extensions that break the rules.
			if ( in_array( $plugin['class'], $this->extensions, true) ) {
				return true;
			}

			return false;
		}

Top ↑

Changelog

Changelog
Version Description
5.1.3 Introduced.