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 |
---|---|
372 | if ( $do_image ) |
373 | $out .= _media_button(__('Add an Image'), 'images/media-button-image.gif?ver=20100531', 'image'); |
374 | if ( $do_video ) |
375 | $out .= _media_button(__('Add Video'), 'images/media-button-video.gif?ver=20100531', 'video'); |
376 | if ( $do_audio ) |
377 | $out .= _media_button(__('Add Audio'), 'images/media-button-music.gif?ver=20100531', 'audio'); |
378 |
|
379 | $out .= _media_button(__('Add Media'), 'images/media-button-other.gif?ver=20100531', 'media'); |
380 |
|
381 | $context = apply_filters('media_buttons_context', __('Upload/Insert %s')); |
382 |
|
383 | printf($context, $out); |
384 | } |
385 | add_action( 'media_buttons', 'media_buttons' ); |
386 |
|
387 | function _media_button($title, $icon, $type) { |
388 | 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' onclick='return false;' /></a>"; |
389 | } |
390 |
|