Changeset 15688 for trunk/wp-admin/includes/media.php
- Timestamp:
- 10/03/2010 02:58:59 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r15590 r15688 344 344 </html> 345 345 <?php 346 }347 348 /**349 * {@internal Missing Short Description}}350 *351 * @since unknown352 */353 function media_buttons() {354 $do_image = $do_audio = $do_video = true;355 if ( is_multisite() ) {356 $media_buttons = get_site_option( 'mu_media_buttons' );357 if ( empty($media_buttons['image']) )358 $do_image = false;359 if ( empty($media_buttons['audio']) )360 $do_audio = false;361 if ( empty($media_buttons['video']) )362 $do_video = false;363 }364 $out = '';365 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 385 function get_upload_iframe_src($type) {386 global $post_ID, $temp_ID;387 $uploading_iframe_ID = (int) (0 == $post_ID ? $temp_ID : $post_ID);388 $upload_iframe_src = add_query_arg('post_id', $uploading_iframe_ID, 'media-upload.php');389 390 if ( 'media' != $type )391 $upload_iframe_src = add_query_arg('type', $type, $upload_iframe_src);392 $upload_iframe_src = apply_filters($type . '_upload_iframe_src', $upload_iframe_src);393 394 return add_query_arg('TB_iframe', true, $upload_iframe_src);395 346 } 396 347
Note: See TracChangeset
for help on using the changeset viewer.