upload_size_limit_filter() WordPress Function

The upload_size_limit_filter() function is used to filter the maximum allowed upload size for a given site. This function is useful for sites that allow users to upload large files, or for sites that need to limit the size of files that can be uploaded.

upload_size_limit_filter( int $size ) #

Filters the maximum upload file size allowed, in bytes.


Parameters

$size

(int)(Required)Upload size limit in bytes.


Top ↑

Return

(int) Upload size limit in bytes.


Top ↑

Source

File: wp-includes/ms-functions.php

function upload_size_limit_filter( $size ) {
	$fileupload_maxk = KB_IN_BYTES * get_site_option( 'fileupload_maxk', 1500 );
	if ( get_site_option( 'upload_space_check_disabled' ) ) {
		return min( $size, $fileupload_maxk );
	}

	return min( $size, $fileupload_maxk, get_upload_space_available() );
}


Top ↑

Changelog

Changelog
VersionDescription
3.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More