1
0
Fork 0
mirror of https://github.com/inretio/WordPress-Plugin-Boilerplate synced 2025-04-19 05:35:36 +03:00

Add admin class

This commit is contained in:
Ulrich Pogson 2013-10-14 17:37:41 +02:00
parent 0642b96439
commit ac8e5cfb01
3 changed files with 228 additions and 121 deletions

View file

@ -31,12 +31,20 @@ if ( ! defined( 'WPINC' ) ) {
// TODO: replace `class-plugin-name.php` with the name of the actual plugin's class file
require_once( plugin_dir_path( __FILE__ ) . 'class-plugin-name.php' );
// TODO: replace `class-plugin-admin.php` with the name of the actual plugin's admin class file
if( is_admin() ) {
require_once( plugin_dir_path( __FILE__ ) . 'class-plugin-name-admin.php' );
}
// Register hooks that are fired when the plugin is activated or deactivated.
// When the plugin is deleted, the uninstall.php file is loaded.
// TODO: replace Plugin_Name with the name of the plugin defined in `class-plugin-name.php`
// TODO: replace Plugin_Name with the name of the class defined in `class-plugin-name.php`
register_activation_hook( __FILE__, array( 'Plugin_Name', 'activate' ) );
register_deactivation_hook( __FILE__, array( 'Plugin_Name', 'deactivate' ) );
// TODO: replace Plugin_Name with the name of the plugin defined in `class-plugin-name.php`
// TODO: replace Plugin_Name with the name of the class defined in `class-plugin-name.php`
add_action( 'plugins_loaded', array( 'Plugin_Name', 'get_instance' ) );
// TODO: replace Plugin_Name_Admin with the name of the class defined in `class-plugin-name-admin.php`
if( is_admin() ) {
//add_action( 'plugins_loaded', array( 'Plugin_Name_Admin', 'get_instance' ) );
}