I personally just add a menu link and in the function for it handle the form. With $_SERVER[‘REQUEST_URI’] as the action. Example below.
add_action("admin_menu", "menu" );
function menu(){
add_menu_page('Test form', 'Test form', 'manage_options', 'show_form' );
}
function show_form(){
if ( $_SERVER["REQUEST_METHOD"] == "POST" ){
print "do stuff";
} else {
?><form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>"><input type="submit" /></form><?php
}
}
Related Posts:
- Plugin Form Submission Best Practice
- $_POST form request with admin-post
- Handling results from data hooked into admin_post
- What is the real intention for admin-post.php?
- Admin settings update updating every time home page is hit?
- What’s the best method for emptying an option created with the Settings API?
- How to add a new plugin page under desired Options page?
- Is it possible to add an admin page using add_submenu_page() and pass a var in the query string?
- Overwriting Core WordPress Functions with Plugins
- Using AJAX in a plugin to submit form – REALLY confused
- Naming Admin Menus and Submenus
- Plugin development: how to create a form and get custom data?
- Current class on admin menu using add_submenu_page()
- Post from front-end with post types, categories and taxonomies
- Front-End Form Submission in Shortcode
- Check spam in custom form – akismet
- Add Admin Menu Inside Construct or Init
- Use a PHP file as action for a form in a WordPress plugin, what’s the correct way?
- Hook event for upload image in the menu
- Menu Error in Admin Console with Custom Plugin: You do not have sufficient permissions to access this page
- add_menu_page() with function inside a class [duplicate]
- How to add Font Awesome 5 icons in WP Admin dashboard menu?
- How to put placeholder text in the main post input area?
- Unified Approach for Placing Option Pages
- Plugin with specific admin menu icon
- Best Practices for Creating and Handling Forms with Plugins?
- Plugin options page – form with two different submit buttons
- OOP Plugin and Menu – Call to undefined function register_setting()
- How to sanitize user input?
- WooCommerce registration password field not displaying
- wordpress plugin php file processing form
- How to add custom fields to the all users page
- Global State During an Admin Post
- Howto: Use Custom Post Types as Submenu Items in Admin
- Sub Menu content is being duplicated
- Set different custom menu items for different user roles
- Show/Hide ‘add new user’ custom fields in wordpress admin panel by click another field
- Bootstrap doesn’t work on admin menu page-How to override wp-admin style?
- is it recommended to use WP_List_Table?
- Plugin sub-menu pages recommended structure and links
- Create custom HTML/JS app inside page
- Plugin Development for registered users
- Is there documentation reference for forms in menu and setting pages?
- Input in plugin widget does not allow spaces
- Creating Admin Plugin – Content of a page is displayed at global scope as well
- admin_post equivalent for guest user?
- Silently register plugin pages
- How can I add a simple custom field to my plugin?
- Print Dashboard submenu name and filename
- Run JavaScript validation script on form submit in plugin
- I am unable to save my data from a form
- The Correct Way to Use Nonce Field without Settings API
- I am trying to make a page in the admin section similar to the appearance of the Profile page for users
- How to add search form in main page body?
- How to make and save custom form in custom plugin page?
- Catching Form Submission in WordPress Admin Panel
- Disable Auto-Expanding Menu in WordPress Admin Menus
- in_array function Problem
- Submit form to a different PHP file in the same plugin folder
- A function that will remove HTML and tags from a string?
- Plugin Form Submitting to admin-ajax.php instead of admin-post.php
- Use options to control jQuery plugin
- Restrict certain actions to plugin-specific admin menu pages only
- Lead form that submits to 2 external APIs
- Proper way to create an administration page without adding it to the menu
- Pause plugin option page until all data manipulation is complete
- How to add text editor in plugin menu?
- WordPress: redirecting to the form page after form submission to admin-post.php
- How to make an admin plugin menu page go full screen?
- How to create a custom post-new.php page for plugin , no wp menu
- Information and Page from WordPress Plugin
- Why is that only the first row getting inserted into Mysql table when i import csv file on backend custom plugin?
- Using AJAX to submit and return data inside the WordPress Plugin Boiler Plate framework
- How to add admin.php to WP Admin Menu Link
- Use admin-post to submit form data to external database
- How to Maintain url on form submit
- How to retrieve custom profile fields associated with different users
- form does not generate $_POST request
- Convert each new line in the textfield as a new value in an array
- Acessing WP functions in form submission handler
- Form and database, plugin development
- Developing a plugin where users can edit entries saved in database
- Can I use a hook other than ‘init’ to handle form submissions?
- Add a description/hint field in the admin page of a plugin
- wp_mail links are dead
- Forcing ALL plugin Admin menus into a separate menu
- Link to a admin submenu item using a custom link
- Best way to handle a form post in plugin
- Plugin admin list pages as submenu
- Tracing dashboard publish settings from input form in WordPress
- Post data in wp-admin to external database
- Change Admin menu placement using hooks
- Multi-part form and wp_redirect()
- Page reload occurs before request finishes
- Menu_slug used for creating options page
- Submitting a plugin form to database in admin page
- How to design WooCommerce-like admin tabs for plugin settings page?
- Show Admin Menu
- Hook a search form anywhere on the site, using a custom plugin
- Plugin forms overwrite each other’s options