fbpx

New wp_get_environment_type() function in WordPress 5.5

WordPress 5.5 introduces a new wp_get_environment_type() function that retrieves a site’s current environment type. This allows plugin and theme authors to more easily differentiate how they handle specific functionality between production and development sites in a standardized way.

By default, this function will return production. Other values supported by default are development and staging.

Below is an example of how this new function can be used to determine a site’s environment type.

switch ( wp_get_environment_type() ) { case ‘development’: do_nothing(); break; case ‘staging’: do_staging_thing(); break; default: do_production_thing(); break; }

Of course care should be taken with this kind

This post was originally published on this site

Work With Xiphos Web Marketing

No business is too small to succeed, thanks to online technology! From marketing, to customer service, to placing orders, to customer financing, there are tools that anyone can utilize. Let me, Nate Houstman, be your guide!

FINANCING AVAILABLE!

Pin It on Pinterest

Share This
Xiphos Web Marketing

FREE
VIEW