Try this:
<div class="my-metabox">
<!-- This is your metabox HTML -->
<-- Add this button somewhere: -->
<button id="my-submit" class="button button-primary button-large">Submit</button>
</div>
Add this JavaScript snippet however you want only to this screen (either by checking the post type and enqueue this in the admin footer or output it directly along with your metabox HTML):
<script type="text/javascript">
jQuery(function($) {
// You can substitute this with a CSS rule somewhere:
// <style type="text/css"> #submitdiv { display: none } </style>
// if you wish to avoid the hiding 'flicker'
$('#submitdiv').hide();
$('#my-submit').on('click', function(ev) {
ev.preventDefault();
$('#publish').trigger('click');
});
});
</script>
Related Posts:
- How to add a custom CSS class to core blocks in Gutenberg editor?
- Filter translations (gettext strings) on specific admin pages
- How to add icons to post listing (edit.php) in admin
- Adding a class to the body_class function
- How can I send data to admin-ajax via JS Fetch?
- How to limit the pages displayed for choosing parent page on page attribute’s menu?
- Add classname to the_category() function?
- Changing Gutenberg / WP block editor width only on pages, not posts or other taxonomies
- Filtering admin entries for custom post type
- how to change appearence of the content of default post list columns?
- How to remove google font in WordPress for only single page?
- Where is this inline CSS code [closed]
- How to center oEmbedded content
- Remove CSS & JS files from WordPress Main Page For Increase Pagespeed?
- Add new post with predefined / preset date
- Make the Status, Visibility, or Date fields opened by default in the Publish box
- Header image automatically changes depending on season
- Adding a Clone link to product attributes – post_row_actions() filter, or how to override a Class question
- Filtering the post list in the admin area
- Filter for when the post is updated
- Help with filter for wp_notify_moderator()
- Change login CSS
- Admin: how to make a custom list filter button send GET queryvars
- Echo string in admin panel footer beside version no
- an action hook when a post reaches a certain number of views
- Add an attribute to the root from functions.php with add_filter
- How to filter page title for certain page?
- Having issue with dynamic data within restrict_manage_posts function
- meta box loop problem with a search filter
- Filter on the day of the week from timestamp
- Admin view: filter posts by whether they have specific taxonomy attached
- Get content of publish box
- How to filter posts in admin by before date or by post status ‘future’?
- Adding to an array & passing it through do_action/apply_filters
- Admin filter/error if post title is too long
- Remove “minor-publishing” div from Publish admin metabox
- Remove pipe in views admin page filter
- This code works, but breaks the media uploader. How do I integrate it in a way that won’t?
- Background color and background image below element in Contact Form 7 – error tip [closed]
- Sanitize and data validation with apply_filters() function
- WordPress admin stylesheet
- How many filter/action hooks are healthy?
- Valid characters for actions, hooks and filters
- How to hook into unregistering a widget instance?
- How do I use the ‘http_request_host_is_external’ filter
- get_option() filtering and getting out of recursion
- Get excerpt from $post->post_content
- Better way to enforce category hierarchy in post_categories_metabox?
- AJAX filter posts on click based on category
- How can I filter Microsoft Word gunk from pasted content?
- How to disable all WordPress emails modularly and programatically?
- How do I know if author field was changed on post save?
- WordPress 3.5+ upload tool filter
- Some questions regarding filter
- Use content custom filter for all shortcodes
- Filter all html output
- Custom colors for post rows based on post meta value
- Which hook is fired when inserting media into a post
- How to specify which category of the post to use in case of multiple categories
- Return array of images after content
- return values from hooks do_action and apply_filters, which is better
- get_title without filter(the_title)
- How to remove “publish metabox” from each post type
- How can filters be run when they are never applied?
- get_bookmarks filter not supplying query argument (wp 3.1)
- Is there a filter called ‘network_admin_init’?
- Manipulating show_on_front, page_on_front, page_for_posts and template hierarchy
- Edit default comments page in WP Admin
- Hide metabox dependant on page template chosen
- Post Content, Special Characters and Filters
- Correct method of redirecting user login
- Filter In Reply comments from WordPress Admin Panel
- Globally register styles but enqueue them selectively
- Admin filter for product SKU?
- Can’t publish custom post type – “You are not allowed to edit this post.”
- How to check if a protected hook is hooked?
- Translate custom order status through a filter?
- Using preg_replace() with the_content filter
- WP 4.5 hide core customizer sections
- Filter posts of custom post type by meta key in (List All Section)
- Custom nav walker: How to acces the $args parameter?
- How to stop the deduction in “wp_term_taxonomy” count, when the post is deleted?
- alternative to the_content filter
- Same URL for portfolio and for a page creates 404 error. Is there any filter that i can use for a child page?
- how to unescape wordpress output
- Database & Post Search
- How can I change the button text of a custom widget?
- Restrict access to custom post type and filter from every query
- Change shortcode output (filter?)
- How do I add a class to all sidebars to let a Google Custom Search Engine know not to index the content?
- How to replace all images in all posts and pages with a different size?
- How to add a class to Buddypress avatars in the Activity stream? [closed]
- using posts_where for meta data on pre_get_posts
- Updating User Profile on Registration
- Adding additional text fields and image upload to a Page?
- How properly write function to filter content in a template for plugin “multiple content blocks”
- ACF Load Field Groups Programmatically [closed]
- Why does using excerpt_more filter change link location?
- Query Multiple Filters, one with Meta
- How to remove a filter that is an object method?