Several photo-size fields bug

Hey all,

i’ve got a problem with several Photo-size fields.

I want to put several Photo-size fields and set default values.
But the default setting is not changing, if the fieldname includes ‘size’.

The problem only comes up when you are setting several photo-size fields.

So I changing the name to ‘dimensions’ and it works.

'image_size' => array(
                        'type'          => 'photo-sizes',
                        'label'         => __('Image size', 'fl-builder'),
                        'default'       => 'full'
                    ),

to

'image_dimensions' => array(
                        'type'          => 'photo-sizes',
                        'label'         => __('Image size', 'fl-builder'),
                        'default'       => 'full'
                    ),

Do you know about the problem?

Hey Mario,

I’ve already assigned another member of the team to assist you with your concern! :slight_smile:

Ben

Hey Mario,

That’s actually a bug in your code. Each field needs to have a separate key like image_size and image_dimensions. If they don’t they will be treated as the same field.

When saved, you use the key to reference those values in your $settings object like so…

$settings->image_size
$settings->image_dimensions

Let me know if you have any questions about that.

Justin