There’s no reason you can’t call add_meta_box() twice in a row and use the same function to display it both times; just change the $post_type
parameter.
Example
foreach ( array ( 'post', 'page' ) as $post_type )
{
add_meta_box( 'your_id', 'your title', 'your_callback', $post_type );
}
Related Posts:
- Detect meta value changes when post is updated (post_updated)
- How to change default position of WP meta boxes?
- echo value from ‘select’ field type into page template using cmb2?
- How do I remove all the metaboxes for a custom post type?
- Find callback function for custom taxonomy metabox
- Get all posts from custom post type and insert in select input as metabox
- Search everything (posts, pages, tags, cpt, meta)
- Saving multiple Metabox contents
- Having trouble with custom post type / meta box
- How can I include meta box content when searching?
- update a post meta from a single table cell TablePress
- update custom post type meta from a shortcode
- Custom Meta Boxes – Nonce Issue – Move to trash issue
- Displaying Meta Box Image
- How to: add option to add more checkboxes on custom post type
- How to keep a check box in custom meta box for custom post type checked by default for add new post?
- How to add multiple featured image in meta box in post editor?
- Show metabox in custom-post-template depending on taxonomy term?
- Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
- Displaying custom posts only if custom meta box’s date is not expired
- Displaying Metabox value (custom post type taxonomy)
- How can I display my custom metaboxes on a custom post template?
- Meta Box Only in CPT Edit Page, Not in Add New
- get_post_meta is returning image id
- A good strategy to print custom posts (offer) that are checked inside the metabox of a post?
- Populate Custom Fields in a Custom Post Type?
- Custom meta box data array: foreach not working correctly?
- Undefined Variable – Custom Post Type Meta
- What’s the difference between same wp functions get_posts(); functions in different form?
- Populate dropdown from one custom post type inside another custom post type
- How to check if user meta field is empty in conditional else statement
- Custom Post Type with Templates using Meta Boxes?
- A better way to add a meta box to custom post types
- get_post_meta not working on publishing
- Anon function and add_meta_box
- Metabox not show in categories custom post type cmb2
- Show Custom Post Type meta boxes only on Page Edit
- Cannot save CPT meta box
- Can’t publish custom post type – “You are not allowed to edit this post.”
- Global custom meta box
- Meta Data for Custom Post Type not saving
- Meta-Boxes for CustomPostType cause PHP Errors and Notices in “Add New” view
- custom post type metaboxes not saving
- create custom meta box with default value
- Displaying a div from an assigned meta_value when on a page
- How to Echo Metadata Value in Currency Format
- Issue on Working with Metabox – Checkbox to enable Sale Items
- Why do I have to press the “Update” button twice to save my meta box values?
- Values from meta-box not on $_POST
- Custom post type suddenly stoped working after WordPress 5 update
- How can I output WPAlchemy repeating fields meta values in my page template?
- Meta box data is saved but NOT displayed in the meta box text field. Why?
- Save Metabox Custom Field Value
- Meta box data not saving
- Custom meta box in custom post type not working
- WP_Meta_Query object with conditionals
- Meta box not appearing in my custom post type
- Related posts meta_query CPT
- Meta box with front-end styling
- Sanitaizing Select Optin For Custom Post Type Metabox in WP
- How to retrive Custom Post Type Meta Fields in Custom WP_Query
- Cannot Save MetaBox Data in Custom Post Type
- Add a class to post_class if more than one post shares same meta_value_num
- Function to return values from metabox
- Add a meta field to the list of results for a custom post type
- Empty meta-box returns publishdate if no value is set?
- Custom Meta Box with variable number of fields
- Custom Post Type meta data getting deleted on bulk editing taxonomies
- Custom attachment function not working in v5.4.2?
- Problem with multi checkboxes value in metabox?
- Get meta values from parent post and save in child post
- Custom Function to redirect singular post if specific meta field is empty
- Stored meta from attachment, video length?
- Metaboxes in Loop
- Custom meta box data not saving
- Collect custom post in a calendar
- Delete custom post type metadata without deleting the post in admin area
- Problem with ‘save_post’ hook not running
- Edit post meta direct from post.php?
- Howto: use existing post_meta as options for a different metabox (checkboxes or list)
- Display a post count from a custom metabox selection
- Rich Custom Field for Custom Post type not saving
- Use a Variable in update_post_meta as the $meta_key
- Remove Custom Taxonomy Metabox from Custom Post Type Screen
- expire wordpress user posts
- How to select one major category (or custom taxonomy) for a custom post type?
- Remove default post types on all sites except primary blog. WPMU
- WordPress nl2br is not converting newline to html line break when saving metabox value
- Metadata for a taxonomy – is there any WordPress way of doing this?
- Create custom PAGE with register_post_type
- Update CPT post meta with update_post_meta and cron job
- Get only used meta_values
- Send post changes to set email addresses (not users or subscribers)
- Post visibility option to theme front-end for author to select?
- Custom MetaBox : Food Menu Item Available Dates
- how to compare different timestamps in wp-query for events custom post types?
- Check that a slug is present in the get_terms request
- Update main post with same category when creating custom post to update the modified date
- How to check if meta box value is false for all posts then do something based on that
- Pagination fault in custom post type archive page [duplicate]