It’s simply the wrong endpoint. The admin_post_*
hook and its admin_post_nopriv_*
counterpart is not fired for any admin page with the appropriate action
request variable set, it only triggers for requests hitting wp-admin/admin-post.php
.
Try https://test.local/wp-admin/admin-post.php?action=test instead.
I should add that using admin-post.php
for handling plugin actions might not be appropriate. If you wanted to return the user to their page of origin, then you would need to redirect them and would loose their request data This is terrible UX if, for example, you are returning them because a form field was invalid, as those forms would now be blank.
Related Posts:
- get_current_screen and the WP_Screen class
- What are the standard admin CSS id/class tags?
- Modal window from within WordPress admin
- How to Change the Default Home Page for the WordPress Dashboard?
- How To Remove WordPress Version From The Admin Footer
- Set Default Admin Colour For All Users
- Securing Admin Accounts – Username Discovery
- Can an admin check passwords of registered users?
- How-to make the admin area mobile friendly [closed]
- How to obtain the user ID of the current profile being edited in WP-Admin?
- 3.3: How do you hide the new dashboard welcome panel?
- Are there any action like ‘init_frontend’
- Is there a hook to put stylesheet and/or JS inside iframes (thickbox or tinyMCE) in admin area
- A similar hook as wp_head for the admin area
- How to remove items from +New admin menu?
- Appearance->Editor not visible
- Possible to create placeholder images in WordPress editor that are clickable (should bring up uploader)?
- Admin pages have no content
- Blocking Administrative Access to Authors and Subcribers?
- How to find out if an wp-admin action edited a file?
- How to display only logged in user’s post comments in comments area
- How to Remove the “Restore” Link in Quick Edit?
- WordPress 3.8 get current admin color scheme
- How to Use Resposive Tables in WordPress ADMIN Pages?
- Use latest jQuery in WordPress (admin interface)
- How can I access profile Admin Colour Scheme
- I keep getting logged out in Firefox
- Add tabbed menu to admin page
- remove_action with profile_personal_options
- Getting the different post statuses + count like in edit.php, in a custom submenu page
- how to redirect to url.com/wp-admin if url.com/admin is typed in?
- How To Create User Specific Admin User Pages?
- Adding markup to column text in “Edit Pages” admin page
- Change the Default Pages Menu View in wp-admin
- Disable HTML (Text) Tab in Post Editor
- Conditionally load CSS/JS/PHP in wp-admin if using a mobile device
- How to disable automatic excerpt generation *in admin*?
- Limit Words in Category / Term Description – Admin Panel
- Change top level menu item to point to custom submenu item
- Associating custom submenu item with post type of top level menu item
- Manage users custom column add class “num”
- Adding text in more than one language (at the same time)
- wp-admin post.php JavaScript Links Not Working
- Custom Thickbox Broken on Dashboard Page?
- Super slow admin panel
- Admin Taxonomy Terms – Orderby Term Field
- How do I add an admin notice within javascript in the admin interface for posts?
- Fatal error: Exception thrown without a stack frame in Unknown on line 0
- Hide Pages on Edit Pages based on Capability (edit_others_pages)?
- Where should I hook into admin?
- Problems with WP_List_Table and hooks
- Unable to Access WP Admin or Login buttons after Migration
- Add ‘Last Modified’ and Attachments (Yes/No) to WordPress Users Column
- Editors change a permalink on an unpublished post, but only admins change a permalink on a post that has ever been published?
- How Can I Found Admin Directory
- WordPress post feature image not uploading
- Combine and Minify wp-admin files, also re-write URI’s for CDN
- 500 internal server error on wp-admin only
- Grabbing how Many Posts by Month for a Dashboard Widget
- Redirect from the dashboard to edit.php if wp_is_mobile() is true
- Why can’t a custom postype be registered with “admin_init” hook?
- Remove Permalink From Admin Edit Post
- Show excerpt if no title in admin view
- Add sub menu page in your plugin
- Add Custom Script in Other Plugin’s Options page
- When submitting the form site.com/blog/wp-admin it goes to site.com/wp-admin
- Can I host WP-admin locally for a remote blog?
- Is there alternative to WP_List_Table?
- WordPress Brute Force Prevention
- Admin login not working
- Filter WooCommerce Orders
- Adding and removing columns from the admin pages panel
- How to make sure your admin doesn’t hi-jack you site?
- Send admin to a different login than users?
- How to change the descriptive text on the menus admin page?
- Dynamic WordPress Admin Panel
- Wp-Admin FTPS Connection Error unlike Filezilla
- Remove iPhone detection on login page
- ‘Conflict’ with action deleted_post and is_admin()
- How to update my website with WordPress?
- wordpress login loop after install
- Unable to render Admin Notices
- WordPress login not working
- Admin blank but Admin menu showing
- Capability to read/edit page in wp-admin only for administrators
- Problems in migration of WordPress site from local server to the online server
- WYSIWYG editor not in a post editor?
- htaccess and htpasswd
- plugin to upload to youtube via wordpress [closed]
- You do not have permission to access this document on form submit
- Modify CSS via Theme Control Panel
- changing body background color for custom post type in admin backend
- Change default Posts page
- WordPress Frontend Check If Current User Is Administrator
- Trigger a custom function when option are saved in admin area
- Why am I timing out when using the Menu Editor?
- Show global Message in User Profiles with admin only Input field in WordPress Backend
- Publish page by invoking submit via jQuery
- cannot access the wordpress dashboard after changing the site url
- How to set selected attribute on option after filter query?