Changeset 15689 for trunk/wp-includes/media.php
- Timestamp:
- 10/03/2010 03:08:39 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/media.php
r15688 r15689 1398 1398 1399 1399 /** 1400 * 1401 * 1402 * 1403 */ 1404 function get_media_buttons(){ 1400 * Generate HTML for the editor media buttons (image, video, audio). 1401 * 1402 * @since 3.1.0 1403 * 1404 * @return string HTML 1405 */ 1406 function get_media_buttons() { 1405 1407 $do_image = $do_audio = $do_video = true; 1406 1408 if ( is_multisite() ) { 1407 1409 $media_buttons = get_site_option( 'mu_media_buttons' ); 1408 if ( empty( $media_buttons['image']) )1410 if ( empty( $media_buttons['image'] ) ) 1409 1411 $do_image = false; 1410 if ( empty( $media_buttons['audio']) )1412 if ( empty( $media_buttons['audio'] ) ) 1411 1413 $do_audio = false; 1412 if ( empty( $media_buttons['video']) )1414 if ( empty( $media_buttons['video'] ) ) 1413 1415 $do_video = false; 1414 1416 } … … 1416 1418 1417 1419 if ( $do_image ) 1418 $out .= _media_button( __('Add an Image'), 'images/media-button-image.gif?ver=20100531', 'image');1420 $out .= _media_button( __( 'Add an Image' ), 'images/media-button-image.gif?ver=20100531', 'image' ); 1419 1421 if ( $do_video ) 1420 $out .= _media_button( __('Add Video'), 'images/media-button-video.gif?ver=20100531', 'video');1422 $out .= _media_button( __( 'Add Video' ), 'images/media-button-video.gif?ver=20100531', 'video' ); 1421 1423 if ( $do_audio ) 1422 $out .= _media_button( __('Add Audio'), 'images/media-button-music.gif?ver=20100531', 'audio');1423 1424 $out .= _media_button( __('Add Media'), 'images/media-button-other.gif?ver=20100531', 'media');1425 1426 $context = apply_filters( 'media_buttons_context', __('Upload/Insert %s'));1424 $out .= _media_button( __( 'Add Audio' ), 'images/media-button-music.gif?ver=20100531', 'audio' ); 1425 1426 $out .= _media_button( __( 'Add Media' ), 'images/media-button-other.gif?ver=20100531', 'media' ); 1427 1428 $context = apply_filters( 'media_buttons_context', __( 'Upload/Insert %s' ) ); 1427 1429 1428 1430 return sprintf($context, $out); … … 1441 1443 add_action( 'media_buttons', 'media_buttons' ); 1442 1444 1443 function _media_button($title, $icon, $type) { 1444 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>"; 1445 } 1446 1447 function get_upload_iframe_src($type) { 1445 /** 1446 * {@internal Missing Short Description}} 1447 * 1448 * @since unknown 1449 * @access private 1450 */ 1451 function _media_button( $title, $icon, $type ) { 1452 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>"; 1453 } 1454 1455 /** 1456 * {@internal Missing Short Description}} 1457 * 1458 * @since unknown 1459 */ 1460 function get_upload_iframe_src( $type ) { 1448 1461 global $post_ID, $temp_ID; 1449 $uploading_iframe_ID = (int) ( 0 == $post_ID ? $temp_ID : $post_ID);1450 $upload_iframe_src = add_query_arg( 'post_id', $uploading_iframe_ID, 'media-upload.php');1462 $uploading_iframe_ID = (int) ( 0 == $post_ID ? $temp_ID : $post_ID ); 1463 $upload_iframe_src = add_query_arg( 'post_id', $uploading_iframe_ID, 'media-upload.php' ); 1451 1464 1452 1465 if ( 'media' != $type ) 1453 $upload_iframe_src = add_query_arg( 'type', $type, $upload_iframe_src);1454 $upload_iframe_src = apply_filters( $type . '_upload_iframe_src', $upload_iframe_src);1455 1456 return add_query_arg( 'TB_iframe', true, $upload_iframe_src);1457 } 1466 $upload_iframe_src = add_query_arg( 'type', $type, $upload_iframe_src ); 1467 $upload_iframe_src = apply_filters( $type . '_upload_iframe_src', $upload_iframe_src ); 1468 1469 return add_query_arg( 'TB_iframe', true, $upload_iframe_src ); 1470 }
Note: See TracChangeset
for help on using the changeset viewer.