- This topic has 2 replies, 2 voices, and was last updated 6 years, 4 months ago by
Steve.
Viewing 2 reply threads
-
AuthorPosts
-
-
October 12, 2015 at 8:42 pm #4541
Mehdi SalemMemberHello guys, another bug here:
I have a setting page containing a filed group that contains a field and another add_more field group.
When saving the setting page after adding an add_more, the fields get duplicated. Meaning if I’m trying to save 3 fields, I’ll end up with 6…
Note also that after saving, if you have any color picker field like I do, the color picker widget will not be available anymore.
FYI: Same behavior if these fields are added to a post meta-box instead of a setting page.
This does not seem to happen if the nested field groups does not contain an add_more field
Here is my code, you can use it in a setting page or meta-box, thanks:
// Register the Gallery Viewer Slider Photo field group piklist('field', array( 'type' => 'group' ,'field' => 'slider_photo' ,'label' => __('Slider Photo','stopping-the-world-admin') ,'fields' => array( array( 'type' => 'group' ,'field' => 'box_shadow' ,'label' => __('Outer Glow','stopping-the-world-admin') ,'add_more' => TRUE ,'fields' => array( array( // Register the outer glow field 'type' => 'text' ,'field' => 'h_shadow' ,'label' => __('h-shadow', 'stopping-the-world-admin') ,'help' => 'Required. The position of the horizontal shadow. Negative values are allowed. The default value is 0px if left empty.' ,'value' => '0px' ,'columns' => 2 ,'attributes' => array( 'class' => 'box-shadow-h-shadow' ,'placeholder' => '0px' ) ) ,array( // Register the outer glow field 'type' => 'text' ,'field' => 'v_shadow' ,'label' => __('v-shadow', 'stopping-the-world-admin') ,'help' => 'Required. The position of the vertical shadow. Negative values are allowed. The default value is 0px if left empty.' ,'value' => '0px' ,'columns' => 2 ,'attributes' => array( 'class' => 'box-shadow-v-shadow' ,'placeholder' => '0px' ) ) ,array( // Register the outer glow field 'type' => 'text' ,'field' => 'blur' ,'label' => __('blur', 'stopping-the-world-admin') ,'help' => 'Optional. The blur distance. The default value is 25px if left empty.' ,'value' => '50px' ,'columns' => 2 ,'attributes' => array( 'class' => 'box-shadow-blur' ,'placeholder' => '50px' ) ) ,array( // Register the outer glow field 'type' => 'text' ,'field' => 'spread' ,'label' => __('spread', 'stopping-the-world-admin') ,'help' => 'Optional. The size of shadow. Negative values are allowed. The default value is 5px if left empty.' ,'value' => '5px' ,'columns' => 2 ,'attributes' => array( 'class' => 'box-shadow-spread' ,'placeholder' => '5px' ) ) ,array( // Register the outer glow field 'type' => 'colorpicker' ,'field' => 'color' ,'label' => __('color', 'stopping-the-world-admin') ,'help' => 'Optional. The color of the shadow. The default value is white if left empty. Look at CSS Color Values for a complete list of possible color values.' ,'value' => '#ffffff' ,'columns' => 2 ,'attributes' => array( 'class' => 'box-shadow-color' ,'placeholder' => '#ffffff' ) ) ) ) ,array( // Register the outer glow field 'type' => 'colorpicker' ,'field' => 'border_color' ,'label' => __('border-color', 'stopping-the-world-admin') ,'help' => 'Optional. The color of the shadow. The default value is white if left empty. Look at CSS Color Values for a complete list of possible color values.' ,'value' => '#000000' ,'columns' => 2 ,'attributes' => array( 'class' => 'border-color' ,'placeholder' => '#oooooo' ) ) ) )); -
October 12, 2015 at 11:15 pm #4542
Mehdi SalemMemberI noticed this bug while testing Piklist 0.9.9.2 by the way, did not test on other versions
-
October 13, 2015 at 11:31 am #4550
-
-
AuthorPosts
Viewing 2 reply threads
- You must be logged in to reply to this topic.