Issue when manually defining "select_image" fields
Hi,
When using the "select_image" field and manually defining the:
'options' => Array( 'img_name' => 'img_path' )
the image_name field does not display in the dropdown box.
Here is an example of the code I have tried:
array( 'id' => 'social_icon_type', 'type' => 'select_image', 'title' => __('Select Icon Type', 'bizstream'), 'subtitle' => __('A preview of the selected image will appear underneath the select box.', 'bizstream'), 'desc' => __('Select the icon type that you want displayed for the Social networking icons', 'bizstream'), 'options' => array( 'coloured' => get_bloginfo('template_directory').'/images/admin/colored_icons.png', 'fontawesome' => get_bloginfo('template_directory').'/images/admin/fontawesome_icons.png' ), ),
Thanks
Wow, my docs are out of date. Sorry. Try this:
array(
'id' => 'social_icon_type',
'type' => 'select_image',
'title' => __('Select Icon Type', 'bizstream'),
'subtitle' => __('A preview of the selected image will appear underneath the select box.', 'bizstream'),
'desc' => __('Select the icon type that you want displayed for the Social networking icons', 'bizstream'),
'options' => array(
array(
'alt' => 'coloured',
'img' => get_bloginfo('template_directory').'/images/admin/colored_icons.png'
),
array(
'alt' => 'fontawesome',
'img' => get_bloginfo('template_directory').'/images/admin/fontawesome_icons.png'
),
),
),
I changed that field a looooooooooong time ago and forgot to update the docs, which I will do forthwith. :)
Thanks for the quick reply and fix.
PS - any changes you make to your field code may require a reset of the section for changes to appear. :)