Environment helper functions for WordPress themes.
You can install the package via Composer:
composer require mindkomm/theme-lib-environment
Name | Summary | Type | Returns/Description |
---|---|---|---|
is_dev | Checks if we are in a development environment. | bool |
|
is_live | Checks if we are in a live environment. | bool |
|
is_stage | Checks if we are in a stating environment. | bool |
|
is_visitor | Checks whether user is a normal site visitor. | bool |
Checks if we are in a live environment.
When no environment constant is set, the environment is considered a live environment.
Returns: bool
Checks whether user is a normal site visitor.
This is mostly used to include scripts related to analytics and data tracking. For that, we normally do not want to have admin calls and frontend calls made by logged-in users.
Use this in combination with other environment functions, e.g. is_live().
Returns: bool
Checks if we are in a stating environment.
Returns: bool
Checks if we are in a development environment.
Returns: bool
This is a library that we use at MIND to develop WordPress themes. You’re free to use it, but currently, we don’t provide any support.