Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/heybran/acf-helpers
Helper classes for creating ACF Fields.
https://github.com/heybran/acf-helpers
acf acf-addon acf-field php wordpress
Last synced: 2 days ago
JSON representation
Helper classes for creating ACF Fields.
- Host: GitHub
- URL: https://github.com/heybran/acf-helpers
- Owner: heybran
- Created: 2024-07-10T02:41:46.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-19T02:51:49.000Z (4 months ago)
- Last Synced: 2024-08-23T17:25:36.998Z (3 months ago)
- Topics: acf, acf-addon, acf-field, php, wordpress
- Language: PHP
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ACF Helpers
Few utility classes that help you better manage your ACF fields.
## Create an ACF group.
```php
ACFGroup::create('test_movie_group')
->title('Movie Fields')
->fields([
Text::create('job_title')
->label('Job Title')
->placeholder('Job title')
->save(),
])
->location([
[
[
'param' => 'post_type',
'operator' => '==',
'value' => 'movie',
]
]
])
->save();
```## Create a `text` field.
```php
Text::create('first_name')
->label('First Name')
->ariaLabel('Enter your first name')
->instructions('Please enter your first name, maximum length of 50 characters')
->required(1)
->conditionalLogic(0)
->wrapperWidth(50)
->wrapperClass('first-name')
->wrapperID('first-name')
->maxlength(50)
->placeholder('Your first name')
->prepend('Before input')
->append('After input')
->save()
```