Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add plugin path/url vars.

  • Loading branch information...
commit cddb1a0b9a6c64e86e91335d3230be4b28db0480 1 parent a36b654
@gilbitron authored
Showing with 12 additions and 5 deletions.
  1. +12 −5 wp-plugin-boilerplate.php
View
17 wp-plugin-boilerplate.php
@@ -12,30 +12,37 @@
class WordPressPluginBoilerplate {
+ private $plugin_path;
+ private $plugin_url;
+
function __construct()
{
- // Set up some defaults
+ // Set up default vars
+ $this->plugin_path = plugin_dir_path( __FILE__ );
+ $this->plugin_url = plugin_dir_url( __FILE__ );
+ // Set up activation hooks
register_activation_hook( __FILE__, array(&$this, 'activate') );
register_deactivation_hook( __FILE__, array(&$this, 'deactivate') );
+ // Set up l10n
load_plugin_textdomain( 'plugin-name-locale', false, dirname( plugin_basename( __FILE__ ) ) . '/lang' );
- // Use the constructor to add your own hooks/filters
+ // Add your own hooks/filters
add_action( 'init', array(&$this, 'init') );
}
function activate( $network_wide )
{
-
+
}
function deactivate( $network_wide )
{
-
+
}
function init()
{
-
+
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.