Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: get_media_item_args

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
1176      if ( ( $attachment_id = intval( $attachment_id ) ) && $thumb_url = wp_get_attachment_image_src( $attachment_id, 'thumbnail', true ) )
1177           $thumb_url = $thumb_url[0];
1178      else
1179           $thumb_url = false;
1180
1181      $post = get_post( $attachment_id );
1182
1183      $default_args = array( 'errors' => null, 'send' => $post->post_parent ? post_type_supports( get_post_type( $post->post_parent ), 'editor' ) : true, 'delete' => true, 'toggle' => true, 'show_title' => true );
1184      $args = wp_parse_args( $args, $default_args );
1185      $args = apply_filters( 'get_media_item_args', $args );
1186      extract( $args, EXTR_SKIP );
1187
1188      $toggle_on  = __( 'Show' );
1189      $toggle_off = __( 'Hide' );
1190
1191      $filename = basename( $post->guid );
1192      $title = esc_attr( $post->post_title );
1193
1194      if ( $_tags = get_the_tags( $attachment_id ) ) {