функция
since 6.3.0
wp_is_development_mode()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
wp_is_development_mode( string $mode ): bool
Описание
Проверяет, находится ли сайт в заданном режиме разработки.
Параметры
$mode
string
обязательный
Режим разработки, который нужно проверить. Одно из значений: 'core', 'plugin', 'theme' или 'all'.
Возвращаемое значение
bool
Исходный код
wp-includes/load.php:361
function wp_is_development_mode( $mode ) {
$current_mode = wp_get_development_mode();
if ( empty( $current_mode ) ) {
return false;
}
// Return true if the current mode encompasses all modes.
if ( 'all' === $current_mode ) {
return true;
}
// Return true if the current mode is the given mode.
return $mode === $current_mode;
}
История изменений
| Версия | Описание |
|---|---|
| 6.3.0 | Introduced. |

