wp_ajax_cropped_attachment_metadata
Filter HookDescription
Filters the cropped image attachment metadata.Hook Information
File Location |
wp-admin/includes/ajax-actions.php
View on GitHub
|
Hook Type | Filter |
Line Number | 4089 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$metadata
|
Attachment metadata. |
Usage Examples
Basic Usage
<?php
// Hook into wp_ajax_cropped_attachment_metadata
add_filter('wp_ajax_cropped_attachment_metadata', 'my_custom_filter', 10, 1);
function my_custom_filter($metadata) {
// Your custom filtering logic here
return $metadata;
}
Source Code Context
wp-admin/includes/ajax-actions.php:4089
- How this hook is used in WordPress core
<?php
4084 *
4085 * @see wp_generate_attachment_metadata()
4086 *
4087 * @param array $metadata Attachment metadata.
4088 */
4089 $metadata = apply_filters( 'wp_ajax_cropped_attachment_metadata', $metadata );
4090 wp_update_attachment_metadata( $attachment_id, $metadata );
4091
4092 /**
4093 * Filters the attachment ID for a cropped image.
4094 *
PHP Documentation
<?php
/**
* Filters the cropped image attachment metadata.
*
* @since 4.3.0
*
* @see wp_generate_attachment_metadata()
*
* @param array $metadata Attachment metadata.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-admin/includes/ajax-actions.php
Related Hooks
Related hooks will be displayed here in future updates.