Yoast\WP\SEO\Helpers

Environment_Helper::is_production_mode()publicYoast 1.0

Determines if the site is running on production.

Метод класса: Environment_Helper{}

Хуки из метода

Возвращает

true|false. True if WordPress is currently running on production, false for all other environments.

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

$Environment_Helper = new Environment_Helper();
$Environment_Helper->is_production_mode();

Код Environment_Helper::is_production_mode() Yoast 20.0

public function is_production_mode() {
	// phpcs:ignore Yoast.NamingConventions.ValidHookName.WrongPrefix -- existing hook.
	$override = \apply_filters( 'yoast_seo_development_mode', false );
	if ( $override ) {
		return true;
	}

	return $this->get_wp_environment() === 'production';
}