wp_max_upload_size

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

WordPress Version: 4.6

/**
 * Determines the maximum upload size allowed in php.ini.
 *
 * @since 2.5.0
 *
 * @return int Allowed upload size.
 */
function wp_max_upload_size()
{
    $u_bytes = wp_convert_hr_to_bytes(ini_get('upload_max_filesize'));
    $p_bytes = wp_convert_hr_to_bytes(ini_get('post_max_size'));
    /**
     * Filters the maximum upload size allowed in php.ini.
     *
     * @since 2.5.0
     *
     * @param int $size    Max upload size limit in bytes.
     * @param int $u_bytes Maximum upload filesize in bytes.
     * @param int $p_bytes Maximum size of POST data in bytes.
     */
    return apply_filters('upload_size_limit', min($u_bytes, $p_bytes), $u_bytes, $p_bytes);
}

WordPress Version: 4.2

/**
 * Determines the maximum upload size allowed in php.ini.
 *
 * @since 2.5.0
 *
 * @return int Allowed upload size.
 */
function wp_max_upload_size()
{
    $u_bytes = wp_convert_hr_to_bytes(ini_get('upload_max_filesize'));
    $p_bytes = wp_convert_hr_to_bytes(ini_get('post_max_size'));
    /**
     * Filter the maximum upload size allowed in php.ini.
     *
     * @since 2.5.0
     *
     * @param int $size    Max upload size limit in bytes.
     * @param int $u_bytes Maximum upload filesize in bytes.
     * @param int $p_bytes Maximum size of POST data in bytes.
     */
    return apply_filters('upload_size_limit', min($u_bytes, $p_bytes), $u_bytes, $p_bytes);
}

WordPress Version: 3.9

/**
 * Determine the maximum upload size allowed in php.ini.
 *
 * @since 2.5.0
 *
 * @return int Allowed upload size.
 */
function wp_max_upload_size()
{
    $u_bytes = wp_convert_hr_to_bytes(ini_get('upload_max_filesize'));
    $p_bytes = wp_convert_hr_to_bytes(ini_get('post_max_size'));
    /**
     * Filter the maximum upload size allowed in php.ini.
     *
     * @since 2.5.0
     *
     * @param int $size    Max upload size limit in bytes.
     * @param int $u_bytes Maximum upload filesize in bytes.
     * @param int $p_bytes Maximum size of POST data in bytes.
     */
    return apply_filters('upload_size_limit', min($u_bytes, $p_bytes), $u_bytes, $p_bytes);
}

WordPress Version: 3.7

/**
 * Determine the maximum upload size allowed in php.ini.
 *
 * @since 2.5.0
 *
 * @return int Allowed upload size.
 */
function wp_max_upload_size()
{
    $u_bytes = wp_convert_hr_to_bytes(ini_get('upload_max_filesize'));
    $p_bytes = wp_convert_hr_to_bytes(ini_get('post_max_size'));
    $bytes = apply_filters('upload_size_limit', min($u_bytes, $p_bytes), $u_bytes, $p_bytes);
    return $bytes;
}