redux-framework icon indicating copy to clipboard operation
redux-framework copied to clipboard

Issue when manually defining "select_image" fields

Open wpinsite opened this issue 12 years ago • 3 comments

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

wpinsite avatar Oct 08 '14 23:10 wpinsite

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. :)

kprovance avatar Oct 09 '14 00:10 kprovance

Thanks for the quick reply and fix.

wpinsite avatar Oct 09 '14 00:10 wpinsite

PS - any changes you make to your field code may require a reset of the section for changes to appear. :)

kprovance avatar Oct 09 '14 00:10 kprovance