• Hey

    i’m trying to move plugins settings page to top level now the menu is under Appearance…
    what i want to do is move that sub menu to he top level above Appearance…

    i think this is the file i should edit but can’t figure it out almost for 3 hours googling plz help…

    tthis is the code i think:

    <?php
    /**
     */
    
    if ( !defined( 'geek_LOGIN' ) ) { exit; }
    
    if( !class_exists( 'geek_Login_Admin' ) ) {
        /**
         * Konceptunit Custom Login Admin
         */
        class geek_Login_Admin {
            /**
             * Plugin version
             */
            public $version;
    
            /**
             * Parameters for add_submenu_page
             */
            public $submenu = array();
    
            /**
             * Initial Options definition:
             */
            public $options = array();
    
            /**
             * Panel instance
             */
            public $panel;
    
            /**
             * Constructor
             */
            public function __construct( $version ) {
                global $geek_login_options;
    
                $this->version = $version;
                $this->submenu = apply_filters( 'geek_login_submenu', array(
                    'themes.php',
                    __('geek Custom Login', 'gk'),
                    __('GK Login Screen', 'gk'),
                    'administrator',
                    'geek-custom-login'
                ) );
                $this->options = apply_filters( 'geek_login_options', $geek_login_options );
    
                add_action( 'init', array( $this, 'init_panel' ) );
                add_action( 'init', array( $this, 'default_options' ) );
    
                return $this;
    
            }
    
            /**
             * Default options
             */
            public function default_options() {
                foreach ($this->options as $tab) {
                    foreach( $tab['sections'] as $section ) {
                        foreach ( $section['fields'] as $id => $value ) {
                            if ( isset( $value['std'] ) && isset( $id ) ) {
                                add_option($id, $value['std']);
                            }
                        }
                    }
                }
            }
    
            /**
             * Init the panel
             */
            public function init_panel() {
                $this->panel = new geek_Panel(
                                        $this->submenu,
                                        $this->options,
                                        array(
                                            'url' => $this->banner_url,
                                            'img' => $this->banner_img
                                        ),
                                        'geek-custom-login-group',
                                        'geek-custom-login'
                );
            }
        }
    }
  • The topic ‘Plugin Sub Menu Move to top level Need Help’ is closed to new replies.