Skip to content

mindkomm/theme-lib-environment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Environment

Environment helper functions for WordPress themes.

Installation

You can install the package via Composer:

composer require mindkomm/theme-lib-environment

Functions

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

is_live

Checks if we are in a live environment.

When no environment constant is set, the environment is considered a live environment.

Returns: bool


is_visitor

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


is_stage

Checks if we are in a stating environment.

Returns: bool


is_dev

Checks if we are in a development environment.

Returns: bool


Support

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.

About

Environment helper functions for WordPress themes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages