rest_prepare_menu_location

過濾鉤子
apply_filters( 'rest_prepare_menu_location', $response, $location, $request )
引數
  • (WP_REST_Response) $response The response object.
    Required:
  • (object) $location The original location object.
    Required:
  • (WP_REST_Request) $request Request used to generate the response.
    Required:
定義位置
相關勾子
rest_prepare_commentrest_prepare_block_patternrest_prepare_nav_menu_itemrest_prepare_revisionrest_prepare_plugin
相關方法
get_nav_menu_locationswp_map_nav_menu_locationsrest_parse_hex_colorwp_ajax_menu_locations_savewp_redirect_admin_locationsrest_parse_date
引入
5.9.0
棄用
-

rest_prepare_menu_location: 這是WordPress中的一個動作鉤子,當REST API準備響應一個選單位置時被觸發。它允許開發人員在返回之前修改選單位置資料。

過濾從REST API返回的選單位置資料。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
return apply_filters( 'rest_prepare_menu_location', $response, $location, $request );
return apply_filters( 'rest_prepare_menu_location', $response, $location, $request );
return apply_filters( 'rest_prepare_menu_location', $response, $location, $request );

常見問題

FAQs
檢視更多 >