upload_is_user_over_quota

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

WordPress Version: 6.2

/**
 * Checks whether a site has used its allotted upload space.
 *
 * @since MU (3.0.0)
 *
 * @param bool $display_message Optional. If set to true and the quota is exceeded,
 *                              a warning message is displayed. Default true.
 * @return bool True if user is over upload space quota, otherwise false.
 */
function upload_is_user_over_quota($display_message = true)
{
    if (get_site_option('upload_space_check_disabled')) {
        return false;
    }
    $space_allowed = get_space_allowed();
    if (!is_numeric($space_allowed)) {
        $space_allowed = 10;
        // Default space allowed is 10 MB.
    }
    $space_used = get_space_used();
    if ($space_allowed - $space_used < 0) {
        if ($display_message) {
            printf(
                /* translators: %s: Allowed space allocation. */
                __('Sorry, you have used your space allocation of %s. Please delete some files to upload more files.'),
                size_format($space_allowed * MB_IN_BYTES)
            );
        }
        return true;
    } else {
        return false;
    }
}

WordPress Version: 6.1

/**
 * Check whether a site has used its allotted upload space.
 *
 * @since MU (3.0.0)
 *
 * @param bool $display_message Optional. If set to true and the quota is exceeded,
 *                              a warning message is displayed. Default true.
 * @return bool True if user is over upload space quota, otherwise false.
 */
function upload_is_user_over_quota($display_message = true)
{
    if (get_site_option('upload_space_check_disabled')) {
        return false;
    }
    $space_allowed = get_space_allowed();
    if (!is_numeric($space_allowed)) {
        $space_allowed = 10;
        // Default space allowed is 10 MB.
    }
    $space_used = get_space_used();
    if ($space_allowed - $space_used < 0) {
        if ($display_message) {
            printf(
                /* translators: %s: Allowed space allocation. */
                __('Sorry, you have used your space allocation of %s. Please delete some files to upload more files.'),
                size_format($space_allowed * MB_IN_BYTES)
            );
        }
        return true;
    } else {
        return false;
    }
}

WordPress Version: 5.4

/**
 * Check whether a site has used its allotted upload space.
 *
 * @since MU (3.0.0)
 *
 * @param bool $echo Optional. If $echo is set and the quota is exceeded, a warning message is echoed. Default is true.
 * @return bool True if user is over upload space quota, otherwise false.
 */
function upload_is_user_over_quota($echo = true)
{
    if (get_site_option('upload_space_check_disabled')) {
        return false;
    }
    $space_allowed = get_space_allowed();
    if (!is_numeric($space_allowed)) {
        $space_allowed = 10;
        // Default space allowed is 10 MB.
    }
    $space_used = get_space_used();
    if ($space_allowed - $space_used < 0) {
        if ($echo) {
            printf(
                /* translators: %s: Allowed space allocation. */
                __('Sorry, you have used your space allocation of %s. Please delete some files to upload more files.'),
                size_format($space_allowed * MB_IN_BYTES)
            );
        }
        return true;
    } else {
        return false;
    }
}

WordPress Version: 5.3

/**
 * Check whether a site has used its allotted upload space.
 *
 * @since MU (3.0.0)
 *
 * @param bool $echo Optional. If $echo is set and the quota is exceeded, a warning message is echoed. Default is true.
 * @return bool True if user is over upload space quota, otherwise false.
 */
function upload_is_user_over_quota($echo = true)
{
    if (get_site_option('upload_space_check_disabled')) {
        return false;
    }
    $space_allowed = get_space_allowed();
    if (!is_numeric($space_allowed)) {
        $space_allowed = 10;
        // Default space allowed is 10 MB
    }
    $space_used = get_space_used();
    if ($space_allowed - $space_used < 0) {
        if ($echo) {
            printf(
                /* translators: %s: Allowed space allocation. */
                __('Sorry, you have used your space allocation of %s. Please delete some files to upload more files.'),
                size_format($space_allowed * MB_IN_BYTES)
            );
        }
        return true;
    } else {
        return false;
    }
}

WordPress Version: 5.2

/**
 * Check whether a site has used its allotted upload space.
 *
 * @since MU (3.0.0)
 *
 * @param bool $echo Optional. If $echo is set and the quota is exceeded, a warning message is echoed. Default is true.
 * @return bool True if user is over upload space quota, otherwise false.
 */
function upload_is_user_over_quota($echo = true)
{
    if (get_site_option('upload_space_check_disabled')) {
        return false;
    }
    $space_allowed = get_space_allowed();
    if (!is_numeric($space_allowed)) {
        $space_allowed = 10;
        // Default space allowed is 10 MB
    }
    $space_used = get_space_used();
    if ($space_allowed - $space_used < 0) {
        if ($echo) {
            printf(
                /* translators: %s: allowed space allocation */
                __('Sorry, you have used your space allocation of %s. Please delete some files to upload more files.'),
                size_format($space_allowed * MB_IN_BYTES)
            );
        }
        return true;
    } else {
        return false;
    }
}

WordPress Version: 4.9

/**
 * Check whether a site has used its allotted upload space.
 *
 * @since MU (3.0.0)
 *
 * @param bool $echo Optional. If $echo is set and the quota is exceeded, a warning message is echoed. Default is true.
 * @return bool True if user is over upload space quota, otherwise false.
 */
function upload_is_user_over_quota($echo = true)
{
    if (get_site_option('upload_space_check_disabled')) {
        return false;
    }
    $space_allowed = get_space_allowed();
    if (!is_numeric($space_allowed)) {
        $space_allowed = 10;
        // Default space allowed is 10 MB
    }
    $space_used = get_space_used();
    if ($space_allowed - $space_used < 0) {
        if ($echo) {
            _e('Sorry, you have used your space allocation. Please delete some files to upload more files.');
        }
        return true;
    } else {
        return false;
    }
}

WordPress Version: 4.5

/**
 * Check whether a site has used its allotted upload space.
 *
 * @since MU
 *
 * @param bool $echo Optional. If $echo is set and the quota is exceeded, a warning message is echoed. Default is true.
 * @return bool True if user is over upload space quota, otherwise false.
 */
function upload_is_user_over_quota($echo = true)
{
    if (get_site_option('upload_space_check_disabled')) {
        return false;
    }
    $space_allowed = get_space_allowed();
    if (!is_numeric($space_allowed)) {
        $space_allowed = 10;
        // Default space allowed is 10 MB
    }
    $space_used = get_space_used();
    if ($space_allowed - $space_used < 0) {
        if ($echo) {
            _e('Sorry, you have used your space allocation. Please delete some files to upload more files.');
        }
        return true;
    } else {
        return false;
    }
}

WordPress Version: 4.4

/**
 * Check whether a blog has used its allotted upload space.
 *
 * @since MU
 *
 * @param bool $echo Optional. If $echo is set and the quota is exceeded, a warning message is echoed. Default is true.
 * @return bool True if user is over upload space quota, otherwise false.
 */
function upload_is_user_over_quota($echo = true)
{
    if (get_site_option('upload_space_check_disabled')) {
        return false;
    }
    $space_allowed = get_space_allowed();
    if (!is_numeric($space_allowed)) {
        $space_allowed = 10;
        // Default space allowed is 10 MB
    }
    $space_used = get_space_used();
    if ($space_allowed - $space_used < 0) {
        if ($echo) {
            _e('Sorry, you have used your space allocation. Please delete some files to upload more files.');
        }
        return true;
    } else {
        return false;
    }
}

WordPress Version: 4.1

/**
 * Check whether a blog has used its allotted upload space.
 *
 * @since MU
 *
 * @param bool $echo Optional. If $echo is set and the quota is exceeded, a warning message is echoed. Default is true.
 * @return bool True if user is over upload space quota, otherwise false.
 */
function upload_is_user_over_quota($echo = true)
{
    if (get_site_option('upload_space_check_disabled')) {
        return false;
    }
    $space_allowed = get_space_allowed();
    if (empty($space_allowed) || !is_numeric($space_allowed)) {
        $space_allowed = 10;
    }
    // Default space allowed is 10 MB
    $space_used = get_space_used();
    if ($space_allowed - $space_used < 0) {
        if ($echo) {
            _e('Sorry, you have used your space allocation. Please delete some files to upload more files.');
        }
        return true;
    } else {
        return false;
    }
}

WordPress Version: 3.7

/**
 * Check whether a blog has used its allotted upload space.
 *
 * @since MU
 *
 * @param bool $echo Optional. If $echo is set and the quota is exceeded, a warning message is echoed. Default is true.
 * @return int
 */
function upload_is_user_over_quota($echo = true)
{
    if (get_site_option('upload_space_check_disabled')) {
        return false;
    }
    $space_allowed = get_space_allowed();
    if (empty($space_allowed) || !is_numeric($space_allowed)) {
        $space_allowed = 10;
    }
    // Default space allowed is 10 MB
    $space_used = get_space_used();
    if ($space_allowed - $space_used < 0) {
        if ($echo) {
            _e('Sorry, you have used your space allocation. Please delete some files to upload more files.');
        }
        return true;
    } else {
        return false;
    }
}