I would suggest using post_submitbox_misc_actions
action as shown in the below example to provide an option for Publish meta-box.
<?php
add_action( 'post_submitbox_misc_actions', 'my_post_submitbox_misc_actions' );
function my_post_submitbox_misc_actions(){
?>
<div class="misc-pub-section my-options">
<label for="my_custom_post_action">My Option</label><br />
<select id="my_custom_post_action" name="my_custom_post_action">
<option value="1">First Option goes here</option>
<option value="2">Second Option goes here</option>
</select>
</div>
<?php
}
?>
Once used for at-least one post( or a CPT), then those options should appear beside publish actions in all posts admin page.
Related Posts:
- WordPress hooks/filters insert before content or after title
- How do filters and hooks really work in PHP
- Trouble understanding apply_filters()
- How many filter/action hooks are healthy?
- Filter specific shortcode output?
- Earliest hook to reliably get $post/$posts
- How to pass/get data to/from the WooCommerce data-product_variations object?
- Where to hook into post content?
- What does (10, 2) mean when used with add_filter
- Filter translations (gettext strings) on specific admin pages
- Clarification on filters and hooks
- Valid characters for actions, hooks and filters
- How to hook into unregistering a widget instance?
- How to check if a hook is hooked or not?
- Passing Additional Parameters to add_filter Callable
- What hook do I use to edit the post statuses option in admin?
- Filter hook before create order WooCommerce
- Modify WordPress Rest Api Request/Response
- How to add some custom HTML into wordpress admin bar?
- How to add icons to post listing (edit.php) in admin
- Custom theme hooks / filters – passing arguments
- wp_mail – Remove sitename from email subject
- How to disable all WordPress emails modularly and programatically?
- How to hook wp_list_pages?
- How can I send data to admin-ajax via JS Fetch?
- apply_filters() slices away needed arguments
- WP Rest API – Upload media without saving attachment post
- How to make post and comment count unclickable with dashboard_glance_items hook
- How to use the_excerpt in a filter hook?
- How to add attribute to output with wp_video_shortcode add_filter
- How to change Woocommerce breadcrumbs content?
- Hook into admin post list page
- Anyway to edit the titlebar of WordPress Widgets in the Admin area?
- How to limit the pages displayed for choosing parent page on page attribute’s menu?
- How can I hide all posts that don’t have a thumbnail?
- Change text of Description in Image Library
- Load different template file when condition met?
- Am I using the right hook for removing quicktags on the admin TinyMCE?
- About Hooks and Filters
- How to enable visual editor when editing comments on the dashboard?
- Should I use add_action(‘publish_post or add_filter(‘publish_post?
- Please explain me what the do_action does
- Is it possible to Hook/Filters Attachment Creation?
- Filter all html output
- Can’t get wp_title filter working in twenty sixteen child theme
- How can I reliably and globally disable wptexturize?
- Customise Jetpack Publicize text
- Removing labels and tag on WordPress’s default login form
- WordPress RSS feed – filter RSS content by custom field value
- How to trigger the core WPLANG to make automatically set a language when the theme is activated? [duplicate]
- How to hook some Unicode texts into calendar widget safely?
- How to add attributes to tag when template cannot be directly modified
- filter the_title problem in nav
- How can I add a fifth option to the alignment picker?
- Too many actions/filters!
- Filter the URL of next_posts_link & previous_posts_link
- How to get list of all hooks of current theme / plugin?
- Which hook is fired when inserting media into a post
- How to replace any occurence of Gravatars with a local placeholder image?
- Hook inside a hook
- Incrementing content with extra text after save/publish
- Adding user filter – Not updating data in URL
- wp_editor customization
- How to check which submission button was clicked?
- Converting restricted html in comments to bbcode
- Why none of xmlrpc filters work
- Publish button inside custom field group
- WP Dashboard -> Posts-> Filter by Category -> Form Method Change : Which Hook
- How to filter posts in admin by before date or by post status ‘future’?
- How to add a class to Buddypress avatars in the Activity stream? [closed]
- Hide H1 Title using the_title filter
- Admin filter/error if post title is too long
- Add class to all parent elements inside the_content
- Which hook should be used in this case?
- Filter dashboard custom post listing by user
- Getting entry ID from frm_email_message filter in formidable
- WooCommerce comments_template Filter Not Firing
- Auto append text after the title?
- Remove pipe in views admin page filter
- Admin New Order: Autofocus on Search a product
- NextGEN Gallery: Adding drop-down menu widget to gallery view without modifying plugin code [closed]
- How to filter part of a variable if it is no array?
- str_replace css meta tag?
- How do you disable the verification process of user email changes?
- How to use apply_filters(‘get_calendar’) to change get_calendar() output?
- Can you call a filter hook by “add_action”?
- Better way to change the default password reset url with the woocommerce one?
- Hooking/Filtering theme name to add theme directory
- How to elect position of new item output in a dropdown when using add_filter
- Replacing text using add_filter
- Passing value from one hook to another
- Change password reqts with NO plugin without breaking resetpass link?
- How to Dynamically Switch WordPress Front Page Without Causing Canonical Redirect?
- hook on the_excerpt
- Why wordpress doesn’t allow to add author filter to media library page in grid mode
- “Invalid parameter(s): attributes” issue in context of “blocks.registerBlockType” filter
- Adding custom filter not working
- Core/Image access caption in render_template and in wp.hooks
- Ship block templates or block template parts with plugins
- How to add custom field to top of WordPress Comment Form for both logged in and anon users