From df3dbd33dd87856f51a442d992ad9544a1aff078 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Thu, 2 Nov 2023 08:15:37 +0100 Subject: [PATCH] Rename `enableOpacity` to `opacity` --- README.md | 8 ++++++++ src/Fields/ColorPicker.php | 2 +- tests/Fields/ColorPickerTest.php | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8c3368b6..92bf73aa 100644 --- a/README.md +++ b/README.md @@ -339,6 +339,7 @@ use Extended\ACF\Fields\ColorPicker; ColorPicker::make('Text Color') ->instructions('Add the text color.') ->default('#4a9cff') + ->opacity() ->required() ``` @@ -987,6 +988,13 @@ The `mimeTypes` method has been renamed to `acceptedFileTypes`. +File::make('Manual')->acceptedFileTypes(['pdf']) ``` +The `enableOpacity` method has been renamed to `opacity`. + +```diff +-ColorPicker::make('Background')->enableOpacity() ++ColorPicker::make('Background')->opacity() +``` + The `delay` method has been renamed to `lazyLoad`. ```diff diff --git a/src/Fields/ColorPicker.php b/src/Fields/ColorPicker.php index 6a83e1d5..1ba19e56 100644 --- a/src/Fields/ColorPicker.php +++ b/src/Fields/ColorPicker.php @@ -29,7 +29,7 @@ class ColorPicker extends Field protected string|null $type = 'color_picker'; - public function enableOpacity(): static + public function opacity(): static { $this->settings['enable_opacity'] = true; diff --git a/tests/Fields/ColorPickerTest.php b/tests/Fields/ColorPickerTest.php index 3affe48a..a486cc50 100644 --- a/tests/Fields/ColorPickerTest.php +++ b/tests/Fields/ColorPickerTest.php @@ -31,9 +31,9 @@ class ColorPickerTest extends FieldTestCase public string $field = ColorPicker::class; public string $type = 'color_picker'; - public function testEnableOpacity() + public function testOpacity() { - $field = ColorPicker::make('Enable Opacity')->enableOpacity()->get(); + $field = ColorPicker::make('Opacity')->opacity()->get(); $this->assertTrue($field['enable_opacity']); } }