image_editor_output_format

過濾鉤子
apply_filters( 'image_editor_output_format', array()
引數
  • (string[]) $output_format { An array of mime type mappings. Maps a source mime type to a new destination mime type. Default empty array. @type string ...$0 The new mime type. }
    Required:
  • (string) $filename Path to the image.
    Required:
  • (string) $mime_type The source image mime type.
    Required:
定義位置
相關勾子
image_editor_default_mime_typewp_image_editor_before_changeimage_editor_save_preimage_strip_metaload_image_to_edit_path
相關方法
wp_image_editor_supportsget_post_formatwp_image_editorset_post_formatget_post_format_link_load_image_to_edit_path
引入
5.8.0
棄用
-

image_editor_output_format。這個鉤子是用來設定使用WordPress影象編輯器時輸出影象的格式。你可以使用這個鉤子將輸出格式設定為任何支援的影象格式,如PNG或JPEG。

過濾影象編輯器輸出格式對映。

啟用篩選用於儲存影象的mime型別。預設情況下,對映陣列為空,因此mime型別與源影象匹配。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$output_format = apply_filters( 'image_editor_output_format', array(), $filename, $mime_type );
$output_format = apply_filters( 'image_editor_output_format', array(), $filename, $mime_type );
$output_format = apply_filters( 'image_editor_output_format', array(), $filename, $mime_type );

常見問題

FAQs
檢視更多 >