pre_option

过滤钩子
apply_filters( 'pre_option', $pre, $option, $default )
参数
  • (mixed) $pre_option The value to return instead of the option value. This differs from `$default`, which is used as the fallback value in the event the option doesn't exist elsewhere in get_option(). Default false (to skip past the short-circuit).
    Required:
  • (string) $option Name of the option.
    Required:
  • (mixed) $default The fallback value to return if the option does not exist. Default false.
    Required:
定义位置
相关勾子
update_optionpre_pingupdated_optionpre_update_optionadded_option
相关方法
get_optionupdate_optionform_optionscreen_optionsmu_optionsadd_option
引入
6.1.0
弃用
-

pre_option – 这个钩子在从选项数据库表中检索一个值之前被调用。开发者可以使用这个钩子为选项提供一个自定义的值,绕过数据库的查询。

在检索之前过滤所有现有选项的值。

从过滤器中返回一个真值将有效地缩短检索并返回传递的值。

$pre = apply_filters( 'pre_option', $pre, $option, $default );

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-14 12:36:31

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: