WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
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 |
|