How to make multiple admin pages for one plugin?

Using add_submenu_page function WordPress you can add multiple pages/menu In order to add a new top-level menu to WordPress administration dashboard, You can use add_menu_page() function. This function has the following syntax. //add plugin menu add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position); As you can see, The function accepts the following parameters. page_title: The page … Read more

I am unable to login into my wp-admin

You can fix this by changes site_url and home_url in your database. If you have access to your database(phpmyadmin) go to options table and change site_url and home_url from HTTPS to HTTP. You can also change it through wp-config file. define(‘WP_HOME’,’http://www.example.com’); define(‘WP_SITEURL’,’http://www.example.com’); See: https://codex.wordpress.org/Changing_The_Site_URL for possible methods. Hope this helps.

meta box on new admin page

You are trying to create a new admin page with add_pages_page(). Meta boxes are only for existing post types, not for admin pages. You need to create your fields like on a normal admin page. You should read the official codex about this first: Creating Options Pages For a simple start take a look at … Read more

How to import the css in the plugin admin area?

Just hook your callback into admin_print_styles, i.e.: add_action( ‘admin_print_styles’, ‘mytheme_add_init’ ); Alternately, you could add an is_admin() conditional wrapper inside your callback, and hook into wp_enqueue_scripts: function mytheme_add_init() { if ( is_admin() ) { $file_dir=get_bloginfo(‘template_directory’); wp_enqueue_style(“functions”, $file_dir.”/scripts/custom.css”, false, “1.0”, “all”); wp_enqueue_script(“rm_script”, $file_dir.”/scripts/custom.js”, false, “1.0”); } } add_action( ‘wp_enqueue_scripts’, ‘mytheme_add_init’ ); But the absolute best approach … Read more

Hide admin menu on update_option

OK, so you put your form in manu page callback and the code that is processing that form is also in that same function. And you register your manu pages on admin_menu hook. All of that means that when you process your form and change the value of your option, the menu is already registered. … Read more