Download the PHP package morningtrain/wp-acf-helper without Composer
On this page you can find all versions of the php package morningtrain/wp-acf-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package wp-acf-helper
Morningtrain\WP\ACFHelper
Some helpers to standialize Advanced Custom Fields (ACF) use in our projects.
Table of Contents
- Introduction
- Getting Started
- Installation
- Usage
- Credits
- License
Introduction
This package is made to standialize the way we are using Advanced Custom Fields (ACF) in our projects.
It makes it easy to handle ACF JSON files, hide ACF administration area and check if ACF is not installed or activated on the site.
Getting Started
To get started install the package as described below in Installation.
To use the package have a look at Usage
Installation
Install with composer.
Usage
Add JSON folder
To add a foldere where ACF should look for JSON field groups
Use JSON folder as save folder
To use the added JSON folder as the folder where ACF use the useAsSaveFolder
method on the returned JsonPath
object.
You can optionally set a namespace, which is used to force saving in specific folder if more than one project sets a save folder.
OBS: ACF will not create the folder, so it shall exist before ACF saves in the folder.
If you will force saving in your folder, define a constant in wp-config.php
with the namespace set in useAsSaveFolder
.
Hide Administration
To hide aministration from the WP backend.
This will hide ACF from the WP administration.
Hide Administration Except On Specific Environments
You can hide admin except on specific environments defined by WP_ENVIRONMENT_TYPE
in wp-config.php
.
Possible values are ‘local’, ‘development’, ‘staging’, and ‘production’.
To define the environment add this to wp-config.php
Check if ACF is installed and activated
To check if ACF is activated
Credits
- Martin Schadegg Brønniche
- All Contributors
License
The MIT License (MIT). Please see License File for more information.