1. 首页
  2. WordPress钩子手册

get_space_allowed

apply_filters( ‘get_space_allowed’, int $space_allowed )

筛选挂钩:筛选当前网站的上载配额。
Filter Hook: Filters the upload quota for the current site.

目录锚点:#参数#源码


参数(Parameters)

参数 类型 说明
$space_allowed (int) 以兆字节为单位上载当前博客的配额。

源码(Source)

/**
 * Returns the upload quota for the current blog.
 *
 * @since MU
 *
 * @return int Quota in megabytes
 */
function get_space_allowed() {
	$space_allowed = get_option( 'blog_upload_space' );

	if ( ! is_numeric( $space_allowed ) )
		$space_allowed = get_site_option( 'blog_upload_space' );

	if ( empty( $space_allowed ) || ! is_numeric( $space_allowed ) )
		$space_allowed = 100;

	/**
	 * Filter the upload quota for the current site.
	 *
	 * @since 3.7.0
	 *
	 * @param int $space_allowed Upload quota in megabytes for the current blog.
	 */
	return apply_filters( 'get_space_allowed', $space_allowed );
}
更新版本 源码位置 使用 被使用
3.7.0 wp-includes/ms-functions.php:2518 1 0

get_space_allowed 为WP2原创文章,链接:https://www.wp2.cn/hook/get_space_allowed-2/