plugin_url = plugins_url('',__FILE__).'/'; $this->plugin_path = plugin_dir_path( __FILE__ ); } // add plugin to settings menu function add_menu() { //print_r(get_option( $this->settings_name )); $active = true; if ( is_multisite() ) { $this->settings = get_blog_option(1, $this->settings_name ); if(get_current_blog_id() != 1){ if($this->get_setting('network') == true){ $active = false; }else{ $this->settings = get_option( $this->settings_name ); } } }else{ $this->settings = get_option( $this->settings_name ); } if($active){ $page = add_submenu_page( 'options-general.php', $this->page_name, $this->page_name, 'manage_options', 'tema-admin', array( $this, 'settings' ) ); add_action('load-'.$page, array( $this, 'admin_help' )); } } // register function register_settings() { register_setting( 'tema-admin-group', $this->settings_name ); add_filter( 'pre_update_option_'.$this->settings_name, array($this, 'update_variables'), 10, 2 ); } // get setting function get_setting($arg){ $ptr = $this->settings; foreach (func_get_args() as $arg) { if (!is_array($ptr) || !is_scalar($arg) || !isset($ptr[$arg])) { return NULL; } $ptr = $ptr[$arg]; } return $ptr; } // settings function settings() { global $nav; global $subnav; ?>
' . __( 'Admin Theme by flatfull.com', 'AT' ) . '
' . '' . __( 'Admin Theme changes your wordpress admin appearance', 'AT' ) . '
' . '' . __( 'Have fun.', 'AT' ) . '
', ) ); // Help Sidebar $current_screen->set_help_sidebar( '' . __( 'For more information:', 'AT' ) . '
' . '' . '' ); } } new tema;