If it was a reguler select (not taxonomy select), for example:
$workdays_box->add_field( array(
'name' => '??? ????? '.$i,
'id' => '_pf_workdays'.$i,
'type' => 'select',
'default' => ' ',
'options_cb' => 'workdays_select_options',
) );
function workdays_select_options() {
return array(' ' => ' ','Mo, Tu, We, Th, Su' => '????? - ?????','Mo, Tu, We, Th, Fr, Su' => '????? - ????','Tu, Su' => '????? ??????','Mo, We' => '??? ??????','Su' => '?????','Mo' => '???','Tu' => '?????','We' => '?????','Th' => '?????','Fr' => '????','Fr Plus' => '???? ????? ??','Sa' => '?????',);
}
and i would want to echo the value of the selected option i know i would use:
$options = workdays_select_options(); $key = get_post_meta( $post->ID, '_pf_workdays'.$wdi, true ); echo isset( $options[ $key ] ) ? $options[ $key ] : $options[' '];
where workdays_select_options()
is the function that i use in the config to echo the options of the select field.
Now i use select_taxonomy field, and the field config i use is:
$lmsets_names_box->add_field( array(
'name' => 'maintag',
'id' => '_lmsets_names_maintagshow',
'taxonomy' => 'protags_taxonomy',
'type' => 'taxonomy_select',
) );
where protags_taxonmy
is the slug of the taxonomy i want to use it’s terms as options for that select field.
How would i echo the value of option selected in that field?
-
This reply was modified 7 years ago by
Begin.
-
This reply was modified 7 years ago by
Begin.