wp_is_ini_value_changeable

The timeline below displays how wordpress function wp_is_ini_value_changeable has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.5

/**
 * Determines whether a PHP ini value is changeable at runtime.
 *
 * @since 4.6.0
 *
 * @link https://www.php.net/manual/en/function.ini-get-all.php
 *
 * @param string $setting The name of the ini setting to check.
 * @return bool True if the value is changeable at runtime. False otherwise.
 */
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();
        }
    }
    // Bit operator to workaround https://bugs.php.net/bug.php?id=44936 which changes access level to 63 in PHP 5.2.6 - 5.2.17.
    if (isset($ini_all[$setting]['access']) && (INI_ALL === ($ini_all[$setting]['access'] & 7) || INI_USER === ($ini_all[$setting]['access'] & 7))) {
        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;
}

WordPress Version: 5.4

/**
 * Determines whether a PHP ini value is changeable at runtime.
 *
 * @since 4.6.0
 *
 * @staticvar array $ini_all
 *
 * @link https://www.php.net/manual/en/function.ini-get-all.php
 *
 * @param string $setting The name of the ini setting to check.
 * @return bool True if the value is changeable at runtime. False otherwise.
 */
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();
        }
    }
    // Bit operator to workaround https://bugs.php.net/bug.php?id=44936 which changes access level to 63 in PHP 5.2.6 - 5.2.17.
    if (isset($ini_all[$setting]['access']) && (INI_ALL === ($ini_all[$setting]['access'] & 7) || INI_USER === ($ini_all[$setting]['access'] & 7))) {
        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;
}

WordPress Version: 4.9

/**
 * Determines whether a PHP ini value is changeable at runtime.
 *
 * @since 4.6.0
 *
 * @staticvar array $ini_all
 *
 * @link https://secure.php.net/manual/en/function.ini-get-all.php
 *
 * @param string $setting The name of the ini setting to check.
 * @return bool True if the value is changeable at runtime. False otherwise.
 */
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();
        }
    }
    // Bit operator to workaround https://bugs.php.net/bug.php?id=44936 which changes access level to 63 in PHP 5.2.6 - 5.2.17.
    if (isset($ini_all[$setting]['access']) && (INI_ALL === ($ini_all[$setting]['access'] & 7) || INI_USER === ($ini_all[$setting]['access'] & 7))) {
        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;
}

WordPress Version: 4.7

/**
 * Determines whether a PHP ini value is changeable at runtime.
 *
 * @since 4.6.0
 *
 * @link https://secure.php.net/manual/en/function.ini-get-all.php
 *
 * @param string $setting The name of the ini setting to check.
 * @return bool True if the value is changeable at runtime. False otherwise.
 */
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();
        }
    }
    // Bit operator to workaround https://bugs.php.net/bug.php?id=44936 which changes access level to 63 in PHP 5.2.6 - 5.2.17.
    if (isset($ini_all[$setting]['access']) && (INI_ALL === ($ini_all[$setting]['access'] & 7) || INI_USER === ($ini_all[$setting]['access'] & 7))) {
        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;
}

WordPress Version: 6.1

/**
 * Determines whether a PHP ini value is changeable at runtime.
 *
 * @since 4.6.0
 *
 * @link http://php.net/manual/en/function.ini-get-all.php
 *
 * @param string $setting The name of the ini setting to check.
 * @return bool True if the value is changeable at runtime. False otherwise.
 */
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();
        }
    }
    // Bit operator to workaround https://bugs.php.net/bug.php?id=44936 which changes access level to 63 in PHP 5.2.6 - 5.2.17.
    if (isset($ini_all[$setting]['access']) && (INI_ALL === ($ini_all[$setting]['access'] & 7) || INI_USER === ($ini_all[$setting]['access'] & 7))) {
        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;
}

WordPress Version: 4.6

/**
 * Determines whether a PHP ini value is changeable at runtime.
 *
 * @since 4.6.0
 *
 * @link http://php.net/manual/en/function.ini-get-all.php
 *
 * @param string $setting The name of the ini setting to check.
 * @return bool True if the value is changeable at runtime. False otherwise.
 */
function wp_is_ini_value_changeable($setting)
{
    static $ini_all;
    if (!isset($ini_all)) {
        $ini_all = ini_get_all();
    }
    // Bit operator to workaround https://bugs.php.net/bug.php?id=44936 which changes access level to 63 in PHP 5.2.6 - 5.2.17.
    if (isset($ini_all[$setting]['access']) && (INI_ALL === ($ini_all[$setting]['access'] & 7) || INI_USER === ($ini_all[$setting]['access'] & 7))) {
        return true;
    }
    return false;
}