Download the PHP package moxie-lean/wp-acf without Composer
On this page you can find all versions of the php package moxie-lean/wp-acf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download moxie-lean/wp-acf
More information about moxie-lean/wp-acf
Files in moxie-lean/wp-acf
Package wp-acf
Short Description Helper functions for working with Advanced Custom Fields
License MIT
Homepage https://github.com/moxie-lean/wp-acf
Informations about the package wp-acf
ACF
Helper functions for working with the Advanced Custom Fields plugin.
Requirements
- PHP 7.2+ or 8.0+
- Composer
Getting Started
The easiest way to install this package is by using running the following command from your terminal:
Or by adding the following lines on your composer.json
file
This will download the files from the packagelist site and set you up with the latest version located on master branch of the repository.
After that you can include the autoload.php
file in order to be able to autoload
the class during the object creation.
Filters
ln_acf_apply_default_transforms_{field_key}
This filter allows you to overwrite the default transforms applied to
the field. Where {field_key}
is replaced by the key of your field
for example: ln_acf_apply_default_transforms_field_56f293e024b74
.
The filter has the following parameters:
$target_id
: Theid
of the post or page that where the field belongs.$field_obj
: array of data containing all field settings
ln_acf_field_{field_key}
This filter allow you to overwrite the default value returned for a
particular field. The {field_key}
is replaced by the key of your field
for example: ln_acf_field_field_56f293e024b74
.
The filter has the following parameters:
$value
: The value of the field or the default value to be returned.$target_id
: Theid
of the post or page that where the field belongs.$field_obj
: array of data containing all field settings
ln_acf_image_size
This filter is applied to images before are returned and can be used to return a specifc size of the image.
The filter has the following parameters.
$size
: By default the value is false and the$attachment_id
is returned instead, here you can specify the size of the image you want to use.$field
: Is the field that has the image here you have all the information of that particular field such as:key
,name
and so on,$sub_field
: This is always false for fields that are not repeter fields otherwise contains the fields that are childs.