Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Conditional check for active parent plugin
Plugin Name: Wordpress CTA behavorial Targeting
Plugin URI:
Description: Place calls to action based off lead data. Personalize Calls to Actions based off the exact visitor
Author: David Wells, Hudson Atwell
Author URI:
//checks to make sure landing page plugin is active
function wp_cta_bh_init() {
if (class_exists('wp_cta_dynamic_widget')) {
// Define Constants
if (!defined('WP_CONTENT_URL'))
define('WP_CONTENT_URL', get_option('siteurl').'/wp-content');
if (!defined('WP_CONTENT_DIR'))
define('WP_CONTENT_DIR', ABSPATH.'wp-content');
if (!defined('WP_PLUGIN_URL'))
define('WP_PLUGIN_URL', WP_CONTENT_URL.'/plugins');
if (!defined('WP_PLUGIN_DIR'))
define('WP_PLUGIN_DIR', WP_CONTENT_DIR.'/plugins');
define('BEHAVORIAL_CTA_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
if (is_admin()) {
// admin scripts
} else {
// Frontend scripts
add_action( 'plugins_loaded', 'wp_cta_bh_init' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.