You can add button via add_meta_box function.
function add_your_meta_box(){
add_meta_box('your-metabox-id', 'Title', 'function_of_metabox', 'custom_post_type', 'side', 'high');}
add_action('add_meta_boxes', 'add_your_meta_box');
function function_of_metabox()
{?>
<input type="submit" class="button button-primary button-large" value="Add New" id="add-new"/>
<?php }
if you add to multiple post type, you should use foreach loop.
function add_your_meta_box(){
$types = array("post","page","custom_post_type");
foreach($types as $type){
add_meta_box('your-metabox-id', 'Title', 'function_of_metabox', $type, 'side', 'high');}
}
add_action('add_meta_boxes', 'add_your_meta_box');
Related Posts:
- call a function when insert and update a custom post type
- Hook for post and page load
- flush_rewrite_rules on save_post Does Not Work on First Post Save
- Why get_next_post_link() or get_previous_post_link() doesn’t return the required links?
- How often do you need to register_post_type?
- How to register custom post types in a plugin?
- Insert Multiple Post with Same Publish Button
- Why is conditionally loading a custom plugin’s code only on a specific custom post type causing the site content to disappear?
- wordpress remove views from action links in a custom post
- What’s an efficient way to change the post status of many posts at once?
- Add to ‘action’ within post.php to allow more actions when editing a Custom Post Type in a plugin
- Creating alternate meta box context locations
- Is it possible to get the specific content on the search page?
- Best way to fix bad count on All | Mine | Published
- Plugin Development using classes – Public & Private Callbacks
- Create a post automatically if search result has zero results
- Changing CPT permalink
- Correct way adding External classes to Custom Post type and output their methods to template
- Correct way to register custom post type from external php file?
- Widget area for individual posts (custom post type)?
- Execute code only after user clicks ‘update’ button for CPT being edited
- Adding Information To All Posts Screen
- Hook only specific post type
- How to change post cpt with submit button?
- Remove slug from custom post type post URLs
- How to get post content by calling ajax?
- Get category id from post id of a custom post type
- How to add custom content template part for a custom post type on main query using a plugin
- Unregister post type from child theme
- Loading custom page template via plugin
- Why The Init Hook For Custom Post Types
- register_taxonomy with multiple object type and update_count_callback
- How to use a dedicated template for the Custom Post Type from a plugin?
- How Can the Users Make a “Playlist” of Posts?
- Create Post tabs in single-{content-type}.php with Custom Field values
- Missing the first 6 Posts and displaying posts that are after the latest 6
- How do I check if a posts status is set to draft or pending?
- Use a textarea for a custom post type
- Adding Custom Taxonomy to WordPress default Post type
- Post type hierarchy
- How do I include drag-and-drop in a plugin?
- How do I alter the position of a Custom Post Type menu item within my plugin admin menu?
- How to get all posts except for one post from a certain custom post type?
- Get rewrite slug of custom post type in template
- Hook to override title, image and content
- How to: Display ACF [fields] on Custom Post Types Utilising WordPress ‘Hooks’? [closed]
- No posts found – Custom Post Type show_ui
- List children on child post
- Restrict custom post type from appearing with ?post_types=
- How do I do this with WordPress? Taxonomies?
- Display Ad on Specific Categories
- Show titles, date of all posts on single category page
- Set a CPT slug as a base name for all the taxonomies
- Shortcode not working with post counter
- Changing default ‘posts’ parameters with register_post_type_args
- Redirect to another page using contact form 7? [closed]
- Check post on publish for blank title
- Different Limit number of post on different archive page
- How to change “post_class()” for a custom post type?
- Help With Warning on creating new Post types?
- Including link to custom post type in ‘wp_list_pages’ function
- Get an array wich contains the post_name of every post that has the custom post_type “pelicula”
- how to set a WP Plugin’s url
- Option page’s form doesn’t work
- Custom post types and ‘new WP_Query’
- Showing custom post type categories in the menu
- How can I include active content in a custom post type?
- ajax response not recieving
- Dynamic pages for linked categories and content
- Separate Content from gallery (custom post type)
- How to set the mainpage of a custom post type?
- wordpress post_where set only for my costum post type
- CPT to installable Plugin
- Fill custom fields when saving custom post types
- Does “Custom Post Type” can have page hierarhy option?
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- Get next and prev item from custom WP_Query and Custom Post Type
- How to mass get post editor URLs
- wp_set_object_terms creates taxonomies but does not add custom posts to it
- Error 404 change permalink term custom term taxonomy
- Register custom_post_type from static function
- How to select meta key in custom database query
- Restrict Custom Post Type to One Item
- How to create editable sections in wordpress?
- Instructor can view, edit, delete only theirs courses
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- subtracting the current post form then whole loop, which is generating all CPT titles
- Custom post type that lets users create a set of posts?
- How to develop custom URL redirection
- Can the wp_posts table have the same slug (post_name) in multiple statuses (post_status)?
- Not Able to Display Metabox Saved Checkbox and Selected option After Save/ Update
- Add category slug as class attribute in a link array
- Custom Post Type used for FAQs Accordion
- How to Associate Posts with Pages
- Custom post types working in functions.php but not in plugin
- Why are my wp urls showing page not found?
- Post content stays the same but permalink changes ?
- Can I set a CPT title field to a dropdown with preset options if user is of a given type?
- How do I display the index position of a post from a custom post type?
- Sort ACF by custom taxonomy