mirror of
https://github.com/inretio/WordPress-Plugin-Boilerplate
synced 2024-12-22 20:03:53 +02:00
Update class-plugin-name-admin.php
added possibility for super admin check in constructor and get_instance()
This commit is contained in:
parent
5396453073
commit
66bf2e2a73
1 changed files with 18 additions and 0 deletions
|
@ -48,6 +48,15 @@ class Plugin_Name_Admin {
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private function __construct() {
|
private function __construct() {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TODO :
|
||||||
|
*
|
||||||
|
* - Decomment following lines if the admin class should only be available for super admins
|
||||||
|
*/
|
||||||
|
/* if( ! is_super_admin() ) {
|
||||||
|
return;
|
||||||
|
} */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Call $plugin_slug from public plugin class.
|
* Call $plugin_slug from public plugin class.
|
||||||
|
@ -90,6 +99,15 @@ class Plugin_Name_Admin {
|
||||||
* @return object A single instance of this class.
|
* @return object A single instance of this class.
|
||||||
*/
|
*/
|
||||||
public static function get_instance() {
|
public static function get_instance() {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TODO :
|
||||||
|
*
|
||||||
|
* - Decomment following lines if the admin class should only be available for super admins
|
||||||
|
*/
|
||||||
|
/* if( ! is_super_admin() ) {
|
||||||
|
return;
|
||||||
|
} */
|
||||||
|
|
||||||
// If the single instance hasn't been set, set it now.
|
// If the single instance hasn't been set, set it now.
|
||||||
if ( null == self::$instance ) {
|
if ( null == self::$instance ) {
|
||||||
|
|
Loading…
Reference in a new issue