get_media_item_args
Filter HookHook Information
File Location |
wp-admin/includes/media.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1887 |
Hook Parameters
Type | Name | Description |
---|---|---|
int
|
$attachment_id
|
No description available |
array
|
$args
|
No description available |
Usage Examples
Basic Usage
<?php
// Hook into get_media_item_args
add_filter('get_media_item_args', 'my_custom_filter', 10, 2);
function my_custom_filter($attachment_id, $args) {
// Your custom filtering logic here
return $attachment_id;
}
Source Code Context
wp-admin/includes/media.php:1887
- How this hook is used in WordPress core
<?php
1882 $user_can_edit = current_user_can( 'edit_post', $attachment_id );
1883
1884 $args = wp_parse_args( $args, $default_args );
1885
1886 /** This filter is documented in wp-admin/includes/media.php */
1887 $args = apply_filters( 'get_media_item_args', $args );
1888
1889 $form_fields = array();
1890
1891 if ( $args['in_modal'] ) {
1892 foreach ( get_attachment_taxonomies( $post ) as $taxonomy ) {
PHP Documentation
<?php
/**
* @since 3.5.0
*
* @param int $attachment_id
* @param array $args
* @return array
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-admin/includes/media.php
Related Hooks
Related hooks will be displayed here in future updates.