Taxonomy data in a select input
-
how can i populate a select input with the data of taxonomy? here is a of my sample code
$positions->add_meta_box( array( ‘id’ => ‘details’, ‘context’ => ‘normal’, ‘fields’ => array( ‘title’ => array( ‘label’ => false, ‘placeholder’ => ‘Enter title here’ ), ‘department’ => array( ‘type’ => ‘select’, ‘data’ => ‘department’ ) ), ) );
firstly i created a taxonomy department which i want to show the data in a select input inside a metabox.
I find it working with a post type post if i change the value of the data to ‘data’ => ‘post’ all the existing post is showing in the dropdown but its not working for taxonomy. Please help me
- The topic ‘Taxonomy data in a select input’ is closed to new replies.