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
372 <?php
373 }
374
375 /**
376  * {@internal Missing Short Description}}
377  *
378  * @since 2.5.0
379  */
380 function media_buttons($editor_id = 'content') {
381      $context = apply_filters('media_buttons_context', __('Upload/Insert %s'));
382
383      $img = '<img src="' . esc_url( admin_url( 'images/media-button.png?ver=20111005' ) ) . '" width="15" height="15" />';
384
385      echo '<a href="' . esc_url( get_upload_iframe_src() ) . '" class="thickbox add_media" id="' . esc_attr( $editor_id ) . '-add_media" title="' . esc_attr__( 'Add Media' ) . '" onclick="return false;">' . sprintf( $context, $img ) . '</a>';
386 }
387 add_action( 'media_buttons', 'media_buttons' );
388
389 function _media_button($title, $icon, $type, $id) {
390      return "<a href='" . esc_url( get_upload_iframe_src($type) ) . "' id='{$id}-add_{$type}' class='thickbox add_$type' title='" . esc_attr( $title ) . "'><img src='" . esc_url( admin_url( $icon ) ) . "' alt='$title' onclick='return false;' /></a>";