Created
October 16, 2013 01:54
-
-
Save anonymous/7001478 to your computer and use it in GitHub Desktop.
Conditional check for active parent plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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