pre_get_main_site_id

过滤钩子
apply_filters( 'pre_get_main_site_id', null, $this )
参数
  • (int|null) $main_site_id If a positive integer is returned, it is interpreted as the main site ID.
    Required:
  • (WP_Network) $network The network object for which the main site was detected.
    Required:
定义位置
相关勾子
pre_get_sitespre_get_document_titlepre_get_site_by_pathpre_get_space_usedpre_get_avatar_data
相关方法
get_main_site_idget_main_network_idwp_get_duotone_filter_idis_main_sitewp_get_sitesget_cat_id
引入
4.9.0
弃用
-

pre_get_main_site_id是一个过滤钩子,允许你在WordPress检索之前修改主站点的ID。

过滤主站点ID。

返回正整数将有效地短路函数。

$main_site_id = (int) apply_filters( 'pre_get_main_site_id', null, $this );

常见问题

FAQs
查看更多 >
闪电侠

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

2025-12-14 16:36:35

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

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

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