Skip to content

Commit

Permalink
Rename enableOpacity to opacity
Browse files Browse the repository at this point in the history
  • Loading branch information
vinkla committed Nov 2, 2023
1 parent f19c539 commit df3dbd3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ use Extended\ACF\Fields\ColorPicker;
ColorPicker::make('Text Color')
->instructions('Add the text color.')
->default('#4a9cff')
->opacity()
->required()
```

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Fields/ColorPicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions tests/Fields/ColorPickerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
}
}

0 comments on commit df3dbd3

Please sign in to comment.