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
1202      if ( ( $attachment_id = intval( $attachment_id ) ) && $thumb_url = wp_get_attachment_image_src( $attachment_id, 'thumbnail', true ) )
1203           $thumb_url = $thumb_url[0];
1204      else
1205           $thumb_url = false;
1206
1207      $post = get_post( $attachment_id );
1208
1209      $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 );
1210      $args = wp_parse_args( $args, $default_args );
1211      $args = apply_filters( 'get_media_item_args', $args );
1212      extract( $args, EXTR_SKIP );
1213
1214      $toggle_on  = __( 'Show' );
1215      $toggle_off = __( 'Hide' );
1216
1217      $filename = esc_html( basename( $post->guid ) );
1218      $title = esc_attr( $post->post_title );
1219
1220      if ( $_tags = get_the_tags( $attachment_id ) ) {