Is there a way to get wp_dropdown_pages to return a list of multiple post types (including custom) as options for parent_id? I have tried supplying array for ‘post_type’ but beginning to think its either not possible? Or need to create a custom function to replace the meta box for page-attributes (parent_id) with a select which is built providing a list of multiple post type pages.
Ultimate aim is to allow CPT’s to be moved around where a user wants them other than be restricted to the same post_type. Want to use differing post types for say example ‘brand’, ‘model’, so that if they wanted model to be under brand they could have /{brand}/{model}/ or if they wanted to attached model under a page such as ‘special’ be /special/{model}/. Don’t want to have to just chuck everything under one post_type as thats probably counter productive and lazy.
wp_dropdown_pages()
does not accept a post type as an argument, however, as noted in the Codex, it may be possible to use some arguments ofget_pages()
likepost_type
.Unfortunately, the
post_type
argument forget_pages()
only accepts a string and not an array of post types.Although you may be able to pass a single post type as an argument to
wp_dropdown_pages()
you cannot pass an array of post types.