pre_site_option_{$option}

过滤钩子
apply_filters( "pre_site_option_{$option}", false, $option, $network_id, $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_network_option(). Default false (to skip past the short-circuit).
    Required:
  • (string) $option Option name.
    Required:
  • (int) $network_id ID of the network.
    Required:
  • (mixed) $default The fallback value to return if the option does not exist. Default false.
    Required:
定义位置
相关勾子
pre_add_site_option_optionsite_option_optionupdate_site_option_optionpre_update_option_optionpre_delete_site_option_option
相关方法
get_site_optionupdate_site_optionadd_site_optiondelete_site_optionwp_load_core_site_optionsscreen_options
引入
4.9.0
弃用
-

pre_site_option_{$option}: 该过滤器用于在get_site_option函数返回之前过滤全站选项的值。这允许开发者在网站使用前修改全站选项的值。过滤器的名称是动态的,$option占位符被替换为被检索的选项的名称。

在检索现有网络选项的值之前过滤该值。

钩子名称的动态部分$option引用了选项名称。

从过滤器中返回非false的值将使检索短路,并返回该值。

$pre = apply_filters( "pre_site_option_{$option}", false, $option, $network_id, $default );

常见问题

FAQs
查看更多 >
闪电侠

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

2025-12-06 11:33:17

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

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

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