-
Notifications
You must be signed in to change notification settings - Fork 20
Configuration & Constants
Contains the version of the plugin as defined in the header of the main plugin file and available to other files (such as functions.php
).
echo \VendorName\PluginName\VERSION;
The following constants are available for you to define in wp-config.php
:
An optional constant that defines the environment. If not set, defaults to 'production'.
This constant is is the the is_production()
function in app/Plugin.php
. This can be useful when you want different behavior in production, staging, development or other environment.
define( 'WP_ENV', 'development' );
The Utils::encrypt()
and Utils::decrypt()
helpers use the SECURE_AUTH_KEY
in wp-config.pgp
by default. You may specify an alternate salt by defining:
define( 'WP_ENCRYPT_KEY', 'random_string' );
If you need a random string, visit the salt page or throw an MD5 in there.
Disables object caching (where available) when defined as true true
.
define( 'WPTK_DISABLE_CACHE', true );
This plugin loads many of its defaults & settings from plugin.json. You may change the settings as desired.
You may put add additional settings that you wish to make available to your plugin.
Contains the plugin's prefix, used for wp_options
and other field names.
A shorted name for the plugin, potentially useful for WP Admin menu item names when the actual plugin name is long (and wraps).
Define object cache settings:
-
group
- The object cache group key that is unique to the plugin under which all cached objects are stored. -
expire_hours
- The number of hours to cache settings before they automatically expire.
A list of dependencies and versions to check for. By default, this plugin checks for required minimum versions of PHP and Carbon Fields.
The cypher method used by the Utils::encrypt()
and Utils::decrypt()
functions.