wp_ajax_crop_image_pre_save

動作鉤子
do_action( 'wp_ajax_crop_image_pre_save', $context, $attachment_id, $cropped )
引數
  • (string) $context The Customizer control requesting the cropped image.
    Required:
  • (int) $attachment_id The attachment ID of the original image.
    Required:
  • (string) $cropped Path to the cropped image file.
    Required:
定義位置
相關勾子
wp_ajax_cropped_attachment_metadatawp_save_image_editor_filewp_read_image_metadatawp_read_image_metadata_typesimage_editor_save_pre
相關方法
wp_ajax_crop_imagewp_ajax_imgedit_previewwp_ajax_inline_savewp_crop_imagewp_ajax_image_editorwp_make_content_images_responsive
引入
4.3.0
棄用
-

wp_ajax_crop_image_pre_save:在將影象裁剪儲存到資料庫之前,在 WordPress 中觸發此操作鉤子。它允許開發人員在儲存裁剪資料之前修改或驗證裁剪資料,確保裁剪正確執行並準確儲存資料。

在剪裁後的圖片被儲存之前啟動。

允許新增過濾器來修改剪裁後的影象的儲存方式。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
do_action( 'wp_ajax_crop_image_pre_save', $context, $attachment_id, $cropped );
do_action( 'wp_ajax_crop_image_pre_save', $context, $attachment_id, $cropped );
do_action( 'wp_ajax_crop_image_pre_save', $context, $attachment_id, $cropped );

常見問題

FAQs
檢視更多 >