| 1 |
<?php |
| 2 |
|
| 3 |
namespace Yoast\WP\SEO\Helpers; |
| 4 |
|
| 5 |
/** |
| 6 |
* A helper object for site environment. |
| 7 |
*/ |
| 8 |
class Environment_Helper { |
| 9 |
|
| 10 |
/** |
| 11 |
* Determines if the site is running on production. |
| 12 |
* |
| 13 |
* @return bool True if WordPress is currently running on production, false for all other environments. |
| 14 |
*/ |
| 15 |
public function is_production_mode() { |
| 16 |
return $this->get_wp_environment() === 'production'; |
| 17 |
} |
| 18 |
|
| 19 |
/** |
| 20 |
* Determines on which environment WordPress is running. |
| 21 |
* |
| 22 |
* @return string The current WordPress environment. |
| 23 |
*/ |
| 24 |
public function get_wp_environment() { |
| 25 |
return \wp_get_environment_type(); |
| 26 |
} |
| 27 |
} |
| 28 |
|