After getting the posts you can easily put them in another array & then return that array
function get_sponsors()
{
$args = array(
'numberposts' => -1,
'post_type' => 'movies'
);
$my_movies = get_posts($args);
$options = array();
foreach($my_movies as $m)
$options[$m->ID] = array(
'label' => $m->post_title,
'value' => $m->ID
);
return $options;
}
Related Posts:
- Is it possible to sort metabox teaxtarea values?
- I’m having trouble with Related Product “tax_query” ‘terms’ value
- 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 get all children and grandchildren of a hierarchical custom post type?
- How to force one column layout on custom post type edit page?
- Getting the Intersection of Two Custom Taxonomy Terms for a Custom Post Type?
- Custom Post Type – Taxonomy Dropdown Menu?
- How to add meta box to backend menu page
- How to add multiple images to a custom post type single post?
- How to add multiple images to custom post type?
- 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
- Get all posts from custom post type and insert in select input as metabox
- Add pre-existing meta box to new custom post type
- Dynamic page.php template for custom post types
- Add comments meta fields to comments metabox on post edit screen
- WordPress metabox file upload in custom post [duplicate]
- Saving multiple Metabox contents
- Display metabox conditionally
- Embed ‘New Post’ Form Inside ‘New Post’ Form
- How to stop wordpress from mangling HTML in a metabox textarea
- post__in not taking my list of IDs
- Relate two custom post type using meta box
- Hiding Metabox from Screen Options Pull Down
- how to set default value for checkbox in wordpress
- Timepicker-addon doesn’t show – Datepicker works fine?
- Settings API with custom post type menu limitation
- Metabox Populated with a Custom Post Type – How to Output CPT based on Select?
- Is it possible to create a post using a metabox?
- How can I show/add/save custom metaboxes as an Array of values?
- WordPress custom meta field for custom post not storing data
- How to Duplicate (multiple meta box)?
- window.send_to_editor and jQuery .attr() conflicts with multiple custom upload image meta boxes
- Save an array from drop-down in custom meta box
- Custom meta box not saving
- Push metadata in array
- WordPress 3.5 Media Uploader – Only allow 1 upload and certain file types
- dynamically add a custom field or metabox to custom post type [duplicate]
- Make metabox of custom post type fully autosave- and bulk-/quick-edit compatible
- Custom Post Type uses Custom Tags in add_filter?
- Getting Custom Post Type Meta on Publish
- Query Multiple Custom Posts by Custom Fields
- How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
- How to get the intersection of two terms both from different custom taxonomies
- Adding a metabox on a CPT’s submenu page
- Ordering values entered in Custom Taxonomies
- Permalinks: custom structure for taxonomy – tags?
- Custom Post Type & Meta Box – Displaying meta box information on front end?
- Sizing textarea field in custom metabox
- Custom post-type metabox position
- How to Make infinite loop of post
- How can I set a meta value that will then affect other post meta values?
- get_posts seems to be skipping the last Post
- Unable to display selected post title in frontend from metabox wp_dropdown_pages()
- Topic won’t save for a custom post type — how to debug?
- How to Use Custom Meta Field Instead of CPT Title in Post URL
- Get custom term meta problem on single post type
- meta query not retrieving posts
- wp_editor for custom post type doesn’t save value
- shopping cart plugin development
- Meta box not appearing in my custom post type
- CMB select with data from CPT
- Custom Post Type Meta Box Text Input Field Won’t Save When Blank
- List of all posts in one custom post type in the edit screen of another
- date_query empty results with custom post type
- get_posts() returns empty on custom post type /wp-admin/edit.php
- How to Grab Anime info using Jikan API and fill the value in Metabox
- Custom Metabox Info Not Saving
- create a “add icon” field in taxonomies page
- Metabox collapsed by default
- Getting data from dynamically allocated metaboxes within a custom post
- Multiple useres editing specified content
- Get meta values from parent post and save in child post
- Using meta boxes as the title of a custom post type
- Custom post type option page template
- check_admin_referer not working in custom meta box for custom post type
- Why get_posts() returns empty array while I am trying to get posts from some specific taxonomies and work properly with others?
- Populate metabox dropdown with post title from another Custom Post Type (issues with wp_reset / global $post)
- Generating Custom Post Type list, within admin of another custom post type
- Custom meta box in editor of custom post type not working
- Meta box not saving
- Help ordering custom query by Title, Ascending
- CPT and metabox: create multi checkbox by using array?
- How to make post page unique and show it on home page?
- Fetch posts list from fist CPT taxonomy term and list under 2. CPT
- Default taxonomy ‘post_tag’ added to CPT managing by custom role : nothing in the metabox
- Custom sortable pages on custom post type
- How to create content automatically when a post is published?
- 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
- How to bring custom meta boxes to custom post types?
- Problems with a custom meta_box
- CPT Metabox with email notification
- Move title “meta box” in post mode
- Custom Post Type meta value is being saved in array, instead of just the string (as value)
- show custom post’s post in two different divs [duplicate]
- Custom Post Type featured option