# Select Image

The Select Image field offers the ability to populate a drop-down field with an array of images names.  When selected, a preview of the image appears underneath.

# Arguments

Name Type
Default
Description
type string select_image Value identifying the field type.
options array Array of arrays in the following format:
array(
  'alt' => __( 'Image One', 'redux-framework-demo'),
  'img' => 'http://yoursite.com/image.png'
)
default string Full URL of the default image.
placeholder string Select an item Text to display in the selector when no value is present.

# Build Config

Build a Custom Configuration →
Changes you make to this form will be reflected in the generated code.
Field visibility requirements.

Redux::set_field( 'OPT_NAME', 'SECTION_ID', array(
    'type' => 'select'
) );

# Example Config

Redux::addField( 'OPT_NAME', 'SECTION_ID', array(
    'id'       => 'opt-select-image',
    'type'     => 'select_image',
    'title'    => __('Select Image', 'redux-framework-demo'),
    'subtitle' => __('A preview of the selected image will appear underneath the select box.', 'redux-framework-demo'),
    'desc'     => __('This is the description field, again good for additional info.', 'redux-framework-demo'),
    'options'  => array(
        array (
             'alt'  => 'Image Name 1',
             'img'  => $url_to_img_1,
        ),
        array (
             'alt'  => 'Image Name 2',
             'img'  => $url_to_img_2,
        )
    ),
    'default'  => $url_to_img_1,
) );

# Example Usage

This example in based on the example usage provided above. Be sure to change $redux_demo to the value you specified in your opt_name argument.

global $redux_demo;

echo '' . $redux_demo['opt-select-image'];