Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: media_buttons_context

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
366      if ( $do_image )
367           $out .= _media_button(__('Add an Image'), 'images/media-button-image.gif?ver=20100531', 'image');
368      if ( $do_video )
369           $out .= _media_button(__('Add Video'), 'images/media-button-video.gif?ver=20100531', 'video');
370      if ( $do_audio )
371           $out .= _media_button(__('Add Audio'), 'images/media-button-music.gif?ver=20100531', 'audio');
372
373      $out .= _media_button(__('Add Media'), 'images/media-button-other.gif?ver=20100531', 'media');
374
375      $context = apply_filters('media_buttons_context', __('Upload/Insert %s'));
376
377      printf($context, $out);
378 }
379 add_action( 'media_buttons', 'media_buttons' );
380
381 function _media_button($title, $icon, $type) {
382      return "<a href='" . esc_url( get_upload_iframe_src($type) ) . "' id='add_$type' class='thickbox' title='$title'><img src='" . esc_url( admin_url( $icon ) ) . "' alt='$title' /></a>";
383 }
384