How to create new page in wordpress plugin?

I want to create a new page in my plugin named as custompage

I dont want to add page in Main Menu list..

Read More

If it’s possible???

Related posts

Leave a Reply

2 comments

  1. try this

    add_action( 'admin_menu', 'register_newpage' );
    
    function register_newpage(){
        add_menu_page('custom_page', 'custom', 'administrator','custom', 'custompage');
        remove_menu_page('custom');
    }
    
  2. Add following code in your plugin .

    add_action( 'admin_menu', 'register_newpage' );
    
    function register_newpage(){
        add_menu_page( 'newpage title', '', 'manage_options', 'myplugin/newpage.php', '', plugins_url( 'myplugin/images/icon.png' ), 6 );
    }
    

    keep newpage.php in your plugin folder.