wp_ajax_cropped_attachment_id

過濾鉤子
apply_filters( 'wp_ajax_cropped_attachment_id', $attachment_id, $context )
引數
  • (int) $attachment_id The attachment ID of the cropped image.
    Required:
  • (string) $context The Customizer control requesting the cropped image.
    Required:
定義位置
相關勾子
wp_ajax_cropped_attachment_metadataajax_query_attachments_argswp_generate_attachment_metadatawp_ajax_nopriv_actiontwentyten_attachment_size
相關方法
wp_ajax_get_attachmentwp_ajax_upload_attachmentwp_ajax_save_attachmentwp_ajax_save_attachment_orderwp_ajax_query_attachmentswp_ajax_send_attachment_to_editor
引入
4.3.0
棄用
-

wp_ajax_cropped_attachment_id:當使用內建影象裁剪功能裁剪附件時,會在 WordPress 中觸發此操作鉤子。它允許開發人員訪問裁剪後的附件 ID 並使用它執行其他處理或操作。

過濾裁剪影象的附件ID。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$attachment_id = apply_filters( 'wp_ajax_cropped_attachment_id', $attachment_id, $context );
$attachment_id = apply_filters( 'wp_ajax_cropped_attachment_id', $attachment_id, $context );
$attachment_id = apply_filters( 'wp_ajax_cropped_attachment_id', $attachment_id, $context );

常見問題

FAQs
檢視更多 >