wp_save_image_editor_file

過濾鉤子
apply_filters( 'wp_save_image_editor_file', null, $filename, $image, $mime_type, $post_id )
引數
  • (bool|null) $override Value to return instead of saving. Default null.
    Required:
  • (string) $filename Name of the file to be saved.
    Required:
  • (WP_Image_Editor) $image The image editor instance.
    Required:
  • (string) $mime_type The mime type of the image.
    Required:
  • (int) $post_id Attachment post ID.
    Required:
定義位置
相關勾子
wp_theme_editor_filetypeswp_image_editor_before_changeimage_editor_save_preload_image_to_edit_filesystempathwp_opcache_invalidate_file
相關方法
wp_save_image_filewp_get_image_editorwp_ajax_image_editorwp_image_editorwp_save_imagewp_image_editor_supports
引入
3.5.0
棄用
-

wp_save_image_editor_file:這是一個 WordPress 函式,用於將影象編輯器中的修改儲存到檔案系統中。它接受一個影象編輯器物件和要儲存的檔案路徑作為引數,並使用該物件的 save 方法將影象寫入檔案。

過濾是否要跳過儲存影象檔案。

返回一個非空值將使儲存方法短路,而返回該值。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$saved = apply_filters( 'wp_save_image_editor_file', null, $filename, $image, $mime_type, $post_id );
$saved = apply_filters( 'wp_save_image_editor_file', null, $filename, $image, $mime_type, $post_id );
$saved = apply_filters( 'wp_save_image_editor_file', null, $filename, $image, $mime_type, $post_id );

常見問題

FAQs
檢視更多 >