Automator_Integrations_Status::get( $integration = null )

Check if a plugin is active


Description Description

this is either the plugins file name or the integrations code


Top ↑

Parameters Parameters

$integration

(Optional)

Default value: null


Top ↑

Return Return

(bool) || null


Source Source

File: src/core/lib/utilities/class-automator-integrations-status.php

	public function get( $integration = null ) {

		// Sanity check that there was a trigger passed
		if ( null === $integration || ! is_string( $integration ) ) {
			Automator()->error->add_error( 'get_plugin_status', 'ERROR: You are try to get a plugin\'s status without passing its proper integration code.', $this );

			return null;
		}

		$active = 0;

		if ( in_array( $integration, Set_Up_Automator::$active_integrations_code, true ) ) {
			$active = 1;
		}

		return absint( apply_filters( 'uncanny_automator_maybe_add_integration', $active, $integration ) );
	}