plugin development – WordPress Admin panel: Custom submit button, need to suppress JS refresh dialog popup warning
Consider this workflow:
Custom post type that a special editor role [approver] will simply “approve or decline”, the normal PUBLISH metabox will be hidden, a custom button will instead be used. The [approvers] can change some data on the CPT, such as the title. (all built, hooked and working fine)
Creates this problem:
If any of the content has changed (title, custom meta fields, tags, ect..) then when that custom button is clicked WP-admin Js layer prevents the action from taking place (because the normal ‘publish’ button was not clicked) and as such a JS dialog box popups up like so:
This JS dialog popup is undesirable. In the final system the default PUBLISH METABOX will be hidden and the custom metabox will instead guide the [approver] to take the correct actions.
Leave an answer