Closed menno-ll closed 1 year ago
You were so fast fast with the response, i could not fix it that fast ;) Thanks for looking so quickly
Thanks for the pull request Menno!
Please note that this change might be breaking for people now providing integers in there.
I don't think that is the case. Tried it locally and it seems to be working fine. How would it break?
Number::make('Number')->min(1)->max(10);
Nope, you are right! Also tested locally (PHP 8.0) and didn't break.
I was thinking if you force cast a variable to an int, and provide that, it would crash. Like so:
$field = Number::make( _x( 'Some label', 'Fields', 'some-textdomain' ), 'some-field-name' )
->min( (int) 0.5 )
->max( (int) 1.5 )
->step( 0.1 )
->defaultValue( 1.0 )
->required();
But apparently PHP converts it automatically, so there's no problem there! So ignore my comment, my assumption was wrong.
Fixes https://github.com/vinkla/extended-acf/issues/120
Changes the typehints for the
min
andmax
field settings to befloat
instead ofint
.Allows setting options like this: