Border issue - data not saved
I have several Border options in different sections. The configurations are like this:
array(
"title" => "Title",
"desc" => "Descr.",
"id" => "opt_border1",
"default" => array(
'border-bottom' => '0',
'border-top' => '0',
'border-left' => '0',
'border-right' => '0',
'border-style' => 'solid',
'border-color' => '#cccccc'
),
"type" => "border",
"all" => false,
),
When I change the values and save it in one of the sections these values keep stored. But when I go to another section and change the values there, the values of the first border are lost - some of them.
Are you sure that all your ID's are unique?
Yes, I checked it twice.
Oh, wait a moment. A few of them just configure Top or Bottom border. Do I have to use
... "border-left" => false, "border-right" => false,
or
"left" => false, "right" => false,
I used the latter. Could this be the problem?
I just found out, that this is a problem with the 0. Only the top or bottom border fields () where I entered a 0 do not keep it. If I enter a 1 or 2 it seems to be okay.
I am confused. Can you send me your config file and tell me exact steps to duplicate? Thanks.
Thanks for the code. I've resolved that issue for you. It's been pushed to the repo. Good eye!
Thank you very much for the quick fix, @dovy. I just tested it and it works fine.
Awesome.
Sorry, but I have a similar issue with border field. Values are not being saved. When I click reset, I get the defaults, but when I fill the fields and save...zero.
I've used the redux builder last month. Should I update the base code?
My code for this:
array( 'id' => 'mab-border', 'type' => 'border', 'title' => __('Border Option', 'redux-framework-demo'), 'subtitle' => __('Define your border style. Default is border-bottom: 3px.', 'redux-framework-demo'), 'output' => array('body .masterbar'), // An array of CSS selectors to apply this font style to // 'desc' => __('Default: border-bottom:3px and the other borders set to 0.', 'redux-framework-demo'), 'validate' => 'color', 'color' => true, 'style' => true, 'all' => false, 'top' => true, 'right' => true, 'bottom' => true, 'left' => true, 'default' => array( 'border-color' => '#1e73be', 'border-style' => 'solid', 'border-top' => '0', 'border-right' => '0', 'border-bottom' => '3px', 'border-left' => '0' ) ),
Yes, do an update and let's see if the problem persists. Please open a new ticket and don't piggyback. That way you don't get lost.
Ok. Thanks for your time.