Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step decimal value #8

Open
K15Lmk98 opened this issue Aug 14, 2017 · 1 comment
Open

Step decimal value #8

K15Lmk98 opened this issue Aug 14, 2017 · 1 comment

Comments

@K15Lmk98
Copy link

This is an automatic translation

Good day,

WordPress 4.8.1

Code
$cmb_cr_header_opacity->add_field( array(
'name' => __( '', 'genesis-theme-cr' ),
'desc' => __( '', 'genesis-theme-cr' ),
'id' => $prefix . 'header_img_opacity',
'type' => 'own_slider',
'min' => '0',
'max' => '1',
'step' => '0.1',
'default' => '0', // start value.
'value_label' => __( 'Valore:', 'genesis-theme-cr' ),
) );

If the 'step' parameter is a decimal value, the slider works correctly but is not saved in the database.
The value saved in the database is always zero (0)

Thanks, Claudio_

@K15Lmk98
Copy link
Author

This is an automatic translation

Good day,

In my opinion - I'm not an expert programmer - you should remove absint in the file "cmb2_field_slider.php" at line 32.

This also works with decimal numbers.

Thanks, Claudio_

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant