Skip to content

Default value for select_image field is not working #3379

@ZoranJambor

Description

@ZoranJambor

Support Hash

http://support.redux.io/?id=rDWyQbLbn0lTEZM9v%2BFgw1M5udgry3eZ42LXwLgwjxzM8E2UUDSCcujPSs2Yj%2FOriMY2frkQSxgBzp9mNoz27w%3D%3D

Steps to reproduce

I'm using the code provided in your docs (https://docs.reduxframework.com/core/fields/select-image/):

Redux::setSection($opt_name, Array(
    'title'     => __('Header', 'redux-framework-demo'),
    'id'        => 'header',
    'icon'      => 'el-icon-arrow-up',
    'fields'    => Array(
        Array(
            'id'       => 'opt-select-image',
            'type'     => 'select_image',
            'title'    => __('Select Image', 'redux-framework-demo'),
            'options'  => Array(
                Array (
                    'alt' => 'Basic',
                    'img' => get_template_directory_uri() . '/images/header-basic.png'
                ),
                Array (
                    'alt' => 'Advanced',
                    'img' => get_template_directory_uri() . '/images/header-advanced.png'
                )
            ),
            'default'  => 'Basic',
        )
    )
));

Expected Behavior

Image header-basic.png should be selected by default.

Actual Behavior

No image is selected by default: https://www.dropbox.com/s/vc9abzclb0xkl9k/Screenshot%202017-07-31%2014.44.30.png?dl=0

Any Error Details (PHP/JavaScript)

There are no PHP or JavaScript errors.
The image path is correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions