How to make in the admin’s dashboard a <select> with the list of all posts of specified post type?
I need this in order to save a post ID with set_option()
call.
How to do this?
How to make in the admin’s dashboard a <select> with the list of all posts of specified post type?
I need this in order to save a post ID with set_option()
call.
How to do this?
You must be logged in to post a comment.
Use
wp_dropdown_pages()
to create the drop down. It accepts anpost_type
parameter.To avoid collisions with plugins filtering this function you may use
walk_page_dropdown_tree()
and build your ownselect
. See this post for a code example.