OPTINMONSTER_SHOW_CAMPAIGN::optinmonster_action_exists()

optinmonster_action_exists


Description Description

Checks if there is a recipe with an active OptinMonster action


Top ↑

Return Return

(boolean)


Source Source

File: src/integrations/optinmonster/actions/optinmonster-show-campaign.php

	public function optinmonster_action_exists() {

		$recipes_data = Automator()->get_recipes_data();

		// Loop through all actions
		foreach ( $recipes_data as $recipe ) {

			if ( 'publish' !== $recipe['post_status'] ) {
				continue;
			}

			foreach ( $recipe['actions'] as $action ) {

				if ( 'publish' !== $action['post_status'] ) {
					continue;
				}

				if ( $this->get_action_code() === $action['meta']['code'] && $this->get_integration() === $action['meta']['integration'] ) {
					return true;
				}
			}
		}

		return false;
	}