Skip to content

Instantly share code, notes, and snippets.

Created October 16, 2013 01:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/7001478 to your computer and use it in GitHub Desktop.
Save anonymous/7001478 to your computer and use it in GitHub Desktop.
Conditional check for active parent plugin
<?php
/*
Plugin Name: Wordpress CTA behavorial Targeting
Plugin URI: http://www.inboundnow.com/
Description: Place calls to action based off lead data. Personalize Calls to Actions based off the exact visitor
Version: 1.0.0.2
Author: David Wells, Hudson Atwell
Author URI: http://www.inboudnow.com/
*/
//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
include_once('module.metaboxes.php');
} else {
// Frontend scripts
include_once('functions.global.php');
}
}
}
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