rest_prepare_theme

過濾鉤子
apply_filters( 'rest_prepare_theme', $response, $theme, $request )
引數
  • (WP_REST_Response) $response The response object.
    Required:
  • (WP_Theme) $theme Theme object used to create response.
    Required:
  • (WP_REST_Request) $request Request object.
    Required:
定義位置
相關勾子
rest_prepare_attachmentrest_prepare_userrest_prepare_commentrest_prepare_autosaverest_prepare_taxonomy
相關方法
rest_parse_datewp_prepare_themes_for_jsresume_themepreview_themeget_page_templaterest_parse_hex_color
引入
5.0.0
棄用
-

rest_prepare_theme: 這是WordPress中的一個動作鉤子,當REST API準備響應一個主題時被觸發。它允許開發者在返回之前修改主題資料。

過濾從REST API返回的主題資料。

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

常見問題

FAQs
檢視更多 >