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:
parent
4242cbe4f1
commit
f894ee25c0
1 changed files with 4 additions and 1 deletions
|
@ -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' ) );
|
||||||
|
}
|
Loading…
Reference in a new issue