How can i get custom taxonomy select dropdown as field in widget
-
Hi
Below is code i am using in widget but i can’t get option of select field. I see document guide select field type require associative array so get_search_course_cat function also return associative array term id as keys, term names as values but i am fail to get select field with taxonomy option. Please guide me
array(
‘title’ => array(
‘type’ => ‘text’,
‘label’ => __(‘Title’, ‘edupress’),
‘default’ => __(‘Search By Category’, ‘text-domain’),
),
‘course_cat’ => array(
‘type’ => ‘select’,
‘label’ => __( ‘Choose a thing from a long list of things’, ‘edupress’ ),
‘multiple’ => true,
‘options’ => $this->get_search_course_cat(),
),),
function get_search_course_cat()
{
return get_terms( ‘course_category’, ‘orderby=name&fields=id=>name&hide_empty=0’ );}
`
- The topic ‘How can i get custom taxonomy select dropdown as field in widget’ is closed to new replies.