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。

返回正整數將有效地短路函式。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$main_site_id = (int) apply_filters( 'pre_get_main_site_id', null, $this );
$main_site_id = (int) apply_filters( 'pre_get_main_site_id', null, $this );
$main_site_id = (int) apply_filters( 'pre_get_main_site_id', null, $this );

常見問題

FAQs
檢視更多 >