функция
since 4.6.0
wp_is_ini_value_changeable()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
wp_is_ini_value_changeable( string $setting ): bool
Описание
Определяет, можно ли изменить значение параметра PHP ini во время выполнения.
Параметры
$setting
string
обязательный
Имя параметра ini для проверки.
Возвращаемое значение
bool
Исходный код
wp-includes/load.php:1713
function wp_is_ini_value_changeable( $setting ) {
static $ini_all;
if ( ! isset( $ini_all ) ) {
$ini_all = false;
// Sometimes `ini_get_all()` is disabled via the `disable_functions` option for "security purposes".
if ( function_exists( 'ini_get_all' ) ) {
$ini_all = ini_get_all();
}
}
if ( isset( $ini_all[ $setting ]['access'] )
&& ( INI_ALL === $ini_all[ $setting ]['access'] || INI_USER === $ini_all[ $setting ]['access'] )
) {
return true;
}
// If we were unable to retrieve the details, fail gracefully to assume it's changeable.
if ( ! is_array( $ini_all ) ) {
return true;
}
return false;
}
История изменений
| Версия | Описание |
|---|---|
| 4.6.0 | Introduced. |

