I’m using Redux and I want select one post/page form select list. But I want choose form some post types (or all).
This is my Redux code for this field.
'fields' => array(
array(
'id' => 'featured_post_type',
'type' => 'select',
'multi' => false,
'data' => 'pages',
'args' => array('post_type' => array('nyheter_grenene', 'nyheter_forbundet', 'stup') ),
'title' => __('Featured Post', TD),
'subtitle' => __('Selected post will be displayed in page top menu', TD),
//'desc' => __('Page will be marked as front for this post type', TD),
),
),
There are two things that you have to change in your code so that it works properly. Here’s a working version:
The difference here is that we have
'data' => 'posts'
(instead ofpages
) and we also added'numberposts' => -1
to theargs
array.When you use
'data' => 'pages'
, the function[get_pages()][1]
is used, which only supports hierarchical post types.