block_editor_rest_api_preload_paths

過濾鉤子
apply_filters( 'block_editor_rest_api_preload_paths', $preload_paths, $block_editor_context )
引數
  • (string[]) $preload_paths Array of paths to preload.
    Required:
  • (WP_Block_Editor_Context) $block_editor_context The current block editor context.
    Required:
定義位置
相關勾子
block_editor_meta_box_hidden_fieldsblock_editor_settings_allblock_editor_no_javascript_messagerender_block_core_template_part_postshould_load_block_editor_scripts_and_styles
相關方法
block_editor_rest_api_preloaduse_block_editor_for_postget_block_editor_settingsblock_template_partuse_block_editor_for_post_type_wp_relative_upload_path
引入
5.8.0
棄用
-

block_editor_rest_api_preload_paths: 這是WordPress的一個過濾器鉤子,允許開發者修改區塊編輯器的REST API預載入路徑。block_editor_rest_api_preload_paths鉤子將預設的預載入路徑作為一個引數傳遞,鉤子函式可以返回一個修改後的預載入路徑陣列來代替使用。這對於調整REST API在塊編輯器中的預載入行為很有用。

過濾REST API路徑的陣列,這些路徑將被用於預裝區塊編輯器的通用資料。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$preload_paths = apply_filters( 'block_editor_rest_api_preload_paths', $preload_paths, $block_editor_context );
$preload_paths = apply_filters( 'block_editor_rest_api_preload_paths', $preload_paths, $block_editor_context );
$preload_paths = apply_filters( 'block_editor_rest_api_preload_paths', $preload_paths, $block_editor_context );

常見問題

FAQs
檢視更多 >