Is it possible to get the label of a theme customizer option?
-
I have this code for the customizer to add some select options:
$wp_customize->add_setting( 'price1', array('default'=>'95')); $wp_customize->add_control( 'price1', array( 'label' => 'price 1', 'settings' => 'price1', 'section' => 'pricessection', 'type' => 'select', 'choices' => array( 'reguler price' => '95', 'special price' => '65', 'other price' => '35', ), ) );
Now if i use this:
echo get_theme_mod( 'price1' );
In my theme i will get the value of the selected option.I want to be able to get the label of the selected option also (not the label of the setting). is it possible? how?
Or in other words:
How do i echo the “other price” and how do i echo the “35”?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Is it possible to get the label of a theme customizer option?’ is closed to new replies.