wp_header_image_attachment_metadata
Filter HookDescription
Filters the header image attachment metadata.Hook Information
File Location |
wp-admin/includes/class-custom-image-header.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1374 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$metadata
|
Attachment metadata. |
Usage Examples
Basic Usage
<?php
// Hook into wp_header_image_attachment_metadata
add_filter('wp_header_image_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/class-custom-image-header.php:1374
- How this hook is used in WordPress core
<?php
1369 *
1370 * @see wp_generate_attachment_metadata()
1371 *
1372 * @param array $metadata Attachment metadata.
1373 */
1374 $metadata = apply_filters( 'wp_header_image_attachment_metadata', $metadata );
1375
1376 wp_update_attachment_metadata( $attachment_id, $metadata );
1377
1378 return $attachment_id;
1379 }
PHP Documentation
<?php
/**
* Filters the header image attachment metadata.
*
* @since 3.9.0
*
* @see wp_generate_attachment_metadata()
*
* @param array $metadata Attachment metadata.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-admin/includes/class-custom-image-header.php
Related Hooks
Related hooks will be displayed here in future updates.