钩子文档

pre_get_space_used

💡 云策文档标注

概述

pre_get_space_used 是一个 WordPress 过滤器,用于修改当前站点已使用的存储空间值(以兆字节为单位)。它允许开发者在 get_space_used() 函数返回结果前调整空间使用量。

关键要点

  • 过滤器名称:pre_get_space_used
  • 参数:$space_used(int|false),表示已使用的空间量(兆字节),默认值为 false
  • 用途:在 get_space_used() 函数中调用,用于过滤站点存储空间使用数据
  • 引入版本:WordPress 3.5.0

代码示例

$space_used = apply_filters( 'pre_get_space_used', false );

📄 原文内容

Filters the amount of storage space used by the current site, in megabytes.

Parameters

$space_usedint|false
The amount of used space, in megabytes. Default false.

Source

$space_used = apply_filters( 'pre_get_space_used', false );

Changelog

Version Description
3.5.0 Introduced.