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 |
---|---|
389 | if ( $do_image ) |
390 | $out .= _media_button(__('Add an Image'), 'images/media-button-image.gif?ver=20100531', 'image'); |
391 | if ( $do_video ) |
392 | $out .= _media_button(__('Add Video'), 'images/media-button-video.gif?ver=20100531', 'video'); |
393 | if ( $do_audio ) |
394 | $out .= _media_button(__('Add Audio'), 'images/media-button-music.gif?ver=20100531', 'audio'); |
395 |
|
396 | $out .= _media_button(__('Add Media'), 'images/media-button-other.gif?ver=20100531', 'media'); |
397 |
|
398 | $context = apply_filters('media_buttons_context', __('Upload/Insert %s')); |
399 |
|
400 | printf($context, $out); |
401 | } |
402 | add_action( 'media_buttons', 'media_buttons' ); |
403 |
|
404 | function _media_button($title, $icon, $type) { |
405 | 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>"; |
406 | } |
407 |
|