Project config is located in
src/class-config.php, and it extends
Eightshift_Libs\Core\Config class from the lib.
This class is used to define all the important methods for your project:
Some methods are mandatory and are defined in config interface the rest are provided inside the project.
Generally used for naming assets handlers, languages, etc.
Generally used for versioning asset handlers while enqueueing them.
The WordPress filters live in a global namespace, so we need to prefix them to avoid naming collisions.
Type: Optional but recommended
Returns the project environment variable descriptor.
Used for defining global settings depending on the environment of the project. It can be one of, but not limited to, develop, staging, production.
Defaults to 'develop' (as to not cache manifest in transient) if not otherwise defined in
Used for namespacing project's REST-API routes and fields. Only required if you are creating a custom REST route or field.
Used for versioning projects REST-API routes and fields. Only required if you are creating a custom REST route or field.
Used for styling the mobile browser color and splash screens. Check
head.php for more details.
Returns project absolute path.
If used in a theme, use
get_template_directory() and in case it's used in a plugin, use
The method that returns every string prefixed with project prefix based on project type.
It converts all spaces and "_" with "-", also it converts all characters to lowercase. Also, it appends the project prefix defined in the
Config::get_config( 'custom_filter_name' );
Config::get_config( 'custom-filter-name' );
Config::get_config( 'custom filter name' );