Created
October 1, 2012 15:01
-
-
Save ramzesimus/3812302 to your computer and use it in GitHub Desktop.
PHP: Plugin Implementing
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
// Run this code on 'after_theme_setup', when plugins have already been loaded. | |
add_action('after_setup_theme', 'my_load_plugin'); | |
// This function loads the plugin. | |
function my_load_plugin() { | |
// Check to see if your plugin has already been loaded. This can be done in several | |
// ways - here are a few examples: | |
// | |
// Check for a class: | |
// if (!class_exists('MyPluginClass')) { | |
// | |
// Check for a function: | |
// if (!function_exists('my_plugin_function_name')) { | |
// | |
// Check for a constant: | |
// if (!defined('MY_PLUGIN_CONSTANT')) { | |
if (!class_exists('Social')) { | |
// load Social if not already loaded | |
include_once(TEMPLATEPATH.'plugins/my-plugin/my-plugin.php'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment