Created
July 28, 2011 03:15
-
-
Save wvega/1110899 to your computer and use it in GitHub Desktop.
A WordPress plugin template
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: | |
Plugin URI: http://wvega.com | |
Description: | |
Version: 1.0 | |
Author: Willington Vega | |
Author URI: http://wvega.com | |
License: GPLv2 | |
*/ | |
if (!function_exists('debug')) { | |
function debug($var = false, $showHtml = false, $showFrom = true) { | |
if ($showFrom) { | |
$calledFrom = debug_backtrace(); | |
echo '<strong>'; | |
echo substr(str_replace(ROOT, '', $calledFrom[0]['file']), 1); | |
echo '</strong>'; | |
echo ' (line <strong>' . $calledFrom[0]['line'] . '</strong>)'; | |
} | |
echo "\n<pre class=\"cake-debug\">\n"; | |
$var = print_r($var, true); | |
if ($showHtml) { | |
$var = str_replace('<', '<', str_replace('>', '>', $var)); | |
} | |
echo $var . "\n</pre>\n"; | |
} | |
} | |
define('WPCE_DIR_NAME', str_replace(basename(__FILE__), '', plugin_basename(__FILE__))); | |
define('WPCE_URL', WP_PLUGIN_URL. '/' . WPCE_DIR_NAME); | |
define('WPCE_DIR', WP_PLUGIN_DIR. '/' . WPCE_DIR_NAME); | |
class Plugin { | |
public function activate() {} | |
} | |
$plugin = new Plugin(); | |
register_activation_hook(__FILE__, array($plugin, 'activate')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment