1
0
Fork 0
mirror of https://github.com/inretio/WordPress-Plugin-Boilerplate synced 2024-12-22 20:03:53 +02:00

loading the admin class only if the dashboard is being loaded

fixes #104
This commit is contained in:
Tom McFarlin 2013-10-30 16:27:26 -04:00
parent 4242cbe4f1
commit f894ee25c0

View file

@ -61,4 +61,7 @@ register_deactivation_hook( __FILE__, array( 'Plugin_Name', 'deactivate' ) );
* `class-plugin-name-admin.php` * `class-plugin-name-admin.php`
*/ */
add_action( 'plugins_loaded', array( 'Plugin_Name', 'get_instance' ) ); add_action( 'plugins_loaded', array( 'Plugin_Name', 'get_instance' ) );
if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) {
add_action( 'plugins_loaded', array( 'Plugin_Name_Admin', 'get_instance' ) ); add_action( 'plugins_loaded', array( 'Plugin_Name_Admin', 'get_instance' ) );
}