Yoast\WP\SEO\Helpers

Environment_Helper{}Yoast 1.0

A helper object for site environment.

Хуков нет.

Использование

$Environment_Helper = new Environment_Helper();
// use class methods

Методы

  1. public get_wp_environment()
  2. public is_production_mode()

Код Environment_Helper{} Yoast 18.8

class Environment_Helper {

	/**
	 * Determines if the site is running on production.
	 *
	 * @return bool True if WordPress is currently running on production, false for all other environments.
	 */
	public function is_production_mode() {
		return $this->get_wp_environment() === 'production';
	}

	/**
	 * Determines on which environment WordPress is running.
	 *
	 * @return string The current WordPress environment.
	 */
	public function get_wp_environment() {
		return \wp_get_environment_type();
	}
}