Opened 15 years ago
Closed 15 years ago
#11068 closed enhancement (worksforme)
post.php should issue an action event
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.8.5 |
Component: | Plugins | Keywords: | post.php |
Focuses: | Cc: |
Description
The subject is Handling POST Requests (http://codex.wordpress.org/Handling_POST_and_AJAX_Requests).
As described at a forum post (http://wordpress.org/support/topic/327586) post.php should issue an action event like admin-post.php do.
You have to provide some strange workarounds to redirect the request to admin-post.php that issues your action. Then you have to do some workarounds again to let post.php handle its parts of the request.
A really easy and useful solution would be issuing an action in post.php. Then no workarounds are needed. By the way it would be perhaps useful to use a hidden input field named custom_action istead of action. Then there is no needed to restore the original action in the custom action hook.
There are already plenty of hooks in post.php.
For saving custom fields metaboxes, you should use add_action('save_post', 'your_callback');