I want to generate an array of custom post types to add it to a options array. I'm doing this to show a checkbox group populated with custom post type.
I have this array:
'options' => array (
'one' => array (
'label' => 'Option One',
'value' => 'one'
),
'two' => array (
'label' => 'Option Two',
'value' => 'two'
),
'three' => array (
'label' => 'Option Three',
'value' => 'three'
),
'four' => array (
'label' => 'Option Four',
'value' => 'four'
)
)
How can i replace this with a custom post type? i'm trying this:
function get_sponsors()
{
$args = array(
'numberposts' => -1,
'post_type' => 'movies'
);
$my_movies = get_posts( $args, ARRAY_A );
return $my_movies;
}
I'm using the code in this article: Reusable Custom Meta Boxes Part 2