You need to get all the titles of CPT (Custom Post Type
) A
, and loop through them in the second CPT in a metabox of CPT B
.
Example :
$my_titles = array(
'post_status' => 'publish',
'posts_per_page' => -1,
'order' => 'ASC',
'post_type' => 'my_custom_post_type' // get the type of your CPT
);
Now in your second custom post type i.e B
, inside the meta box
loop through them like
<select name="" id="">
<?php foreach ($my_titles as $key => $title): ?>
<option value=""><?php echo $title; ?></option>
<?php endforeach ?>
</select>
Related Posts:
- How to add multiple images to custom post type?
- WordPress metabox file upload in custom post [duplicate]
- Save or update data when custom post published
- How to: add option to add more checkboxes on custom post type
- How to add multiple featured image in meta box in post editor?
- how to set default value for checkbox in wordpress
- Adding Meta Boxes while Registering a Post Type in a Class
- How to use TinyMCE Editor for one of my custom post meta field?
- Adding a metabox on a CPT’s submenu page
- Wrap meta boxes & data handling for specific post types in classes?
- Save Multiple Metabox values
- How to insert data into meta box from another plugin?
- Custom Meta Box returns no HTML
- How to Use Custom Meta Field Instead of CPT Title in Post URL
- Creating alternate meta box context locations
- Is it possible to sort metabox teaxtarea values?
- Create a select metabox that the user can pupolate?
- Wp Meta Query does not work while simple Query Works
- WP_List_Table Inside Metabox Not Working on Clicking Search Button
- Getting data from dynamically allocated metaboxes within a custom post
- Admin metabox with custom post type dropdown option not update choosed input after saving
- How save custom meta type posts multicheck grouped by taxonomy (with CMB2) [closed]
- php output of generated custom metabox
- Custom meta box in editor of custom post type not working
- Not Able to Display Metabox Saved Checkbox and Selected option After Save/ Update
- How to consume external API from WordPress post editor and display the response data in the custom field?
- Do I need a nonce field for every meta box I add to my custom post type admin?
- Help Creating a Slideshow Custom Post Type with Custom Meta Boxes?
- How to force one column layout on custom post type edit page?
- Custom Post Type – Taxonomy Dropdown Menu?
- How to set a fall back template for a custom post type in a plugin?
- How do I remove all the metaboxes for a custom post type?
- How To Set Custom Post Type Title Without Supports
- Creating a Custom Post Types dropdown in a Meta Box
- How do I Make a custom post type get a custom post template in a plugin
- Add pre-existing meta box to new custom post type
- working Custom Post Type and Widget code no longer works when moved from functions.php to plugin
- WordPress custom post action hook
- Display metabox conditionally
- Uploaded image not appearing in custom post type
- Row actions not showing? Why?
- How do I add a custom button to my “edit” list? ( edit.php?post_type= ) beside “Add New”
- How to add notification in the sidebar of the administration panel when a Custom post type is created? [duplicate]
- Timepicker-addon doesn’t show – Datepicker works fine?
- Custom Post Type get_post_type_archive_link( $post_type ) returns false
- How to have the right design for a custom post type without accessing themes
- Metabox Populated with a Custom Post Type – How to Output CPT based on Select?
- Is it possible to create a post using a metabox?
- Get all of user’s custom post types in WP Admin for plugin
- WordPress custom meta field for custom post not storing data
- How to Get Current Custom Post Type Selected Taxonomy Term (Not All Terms)
- dynamically add a custom field or metabox to custom post type [duplicate]
- WordPress post_where & posts_join not working only for custom post type
- How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
- Custom Permalink to remove category word , keeping posts permalink with date?
- Ordering values entered in Custom Taxonomies
- Permalinks: custom structure for taxonomy – tags?
- Custom Post Type & Meta Box – Displaying meta box information on front end?
- ACF in wordpress
- Theme independent plugin by using default page template
- Inefficient Query Confusion
- link featured image to external link
- Custom post type in Custom widget – $listItem
- Generating and downloading files with WP API
- Showing a meta box in a custom post type on a page
- Having Issue on Getting Metabox Checkbox Value
- Convert Custom Table Data Based Plugin To Be Searchable
- Updating post content and custom fields in edit post screen
- 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
- Create a custom post type based on ‘Post’
- Limit Amount of Pages users can create in Custom Post Types
- Placing Admin Post Metaboxes in Tabs
- Plugin Development using classes – Public & Private Callbacks
- Unable to gather Image URL from Custom Post Type’s; Custom Meta Field
- How to display the post using a shortcode in WordPress?
- create a “add icon” field in taxonomies page
- Issue removing columns from admin table
- Shortcode and get_template_part
- dynamic vue widget inside custom post
- Get meta values from parent post and save in child post
- how to allow subscriber to add/edit/delete custom post type
- check_admin_referer not working in custom meta box for custom post type
- Populate metabox dropdown with post title from another Custom Post Type (issues with wp_reset / global $post)
- Facing some Issues on Two Parts Custom Post Type Taxonomy Names
- Meta box not saving
- call_user_func_array() error after moving to another server
- How to make post page unique and show it on home page?
- Default taxonomy ‘post_tag’ added to CPT managing by custom role : nothing in the metabox
- Toggle a metabox based on a selection
- Add multiple custom meta boxes to different custom post types
- Custom post type Featured Image popup not working
- Issue on Adding Taxonomy to Custom Post Type Using Function
- Custom Post Types in plugins?
- How to bring custom meta boxes to custom post types?
- Problems with a custom meta_box
- How to apply order on custom taxonomy and custom meta key on custom post type
- Hide custom post type and use its slug in new plugin menu
- Don’t display post if post has empty body