php - How to create a custom page in wordpress admin, in which no default content must be loaded -


currently loading custom page of wp-plugin using hook i.e

add_action('admin_init','myfunction') function myfunction(){     include("login.php");     return exit; } 

i checking session value , include login.php file , return exit. when return exit doesn't load default content of wordpress. if want enqueue script in login page i.e "login.php" wp_enqueue_script() doesn't work. because, didn't load wordpress default functions returned exit previously.

because of include scripts manually in login.php file. wordpress support doesn't allow include script manually in page. tell me way create custom page in wordpress admin without having default content of wordpress.

login.php code:

<html> <head> <title>my login page</title> </head> <body>      <form action="submitlogin.php" method="post">           <input type="text" name="username" placeholder="username"/>           <input type="password" name="password" placeholder="password"/>           <input type="submit" name="login_submit" value="login"/>      </form> </body> </html> 

if page option page functionality tied wordpress theme or plugin need create options page , hook register_settings() function: https://codex.wordpress.org/creating_options_pages

if you're looking create page outside of wordpress core need create menu page , tie plugins hook, so:

add_action('admin_menu', 'my_plugin_setup_menu');  function my_plugin_setup_menu(){     add_menu_page( 'my plugin page', 'menu name', 'manage_options', 'your plugin slug', 'plugin_login_page' ); }  function plugin_login_page(){     echo "<h1>hello world!</h1>"; } 

Comments