wp_is_mobile

過濾鉤子
apply_filters( 'wp_is_mobile', $is_mobile )
引數
  • (bool) $is_mobile Whether the request is from a mobile device or not.
    Required:
定義位置
相關勾子
wp_mailwp_titlewp_sitemaps_enabledwp_installpings_open
相關方法
wp_is_mobilewp_list_filterwp_is_writablewp_is_uuidwp_mailwp_is_xml_request
引入
4.9.0
棄用
-

wp_is_mobile:此函式檢查當前用於訪問站點的裝置是否為移動裝置。它使用 Mobile_Detect 庫來確定裝置是否為移動裝置。

過濾請求是否應被視為來自移動裝置。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
return apply_filters( 'wp_is_mobile', $is_mobile );
return apply_filters( 'wp_is_mobile', $is_mobile );
return apply_filters( 'wp_is_mobile', $is_mobile );

常見問題

FAQs
檢視更多 >