Changeset 18890 for trunk/wp-admin/includes/media.php
- Timestamp:
- 10/05/2011 09:07:04 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r18831 r18890 375 375 */ 376 376 function media_buttons($editor_id = 'content') { 377 $out = _media_button(__('Add Media'), 'images/media-button-video.gif?ver=20100531', 'media', $editor_id);378 379 377 $context = apply_filters('media_buttons_context', __('Upload/Insert %s')); 380 378 381 printf($context, $out); 379 $img = '<img src="' . esc_url( admin_url( 'images/media-button.png?ver=20111005' ) ) . '" width="15" height="15" />'; 380 381 echo '<a href="' . esc_url( get_upload_iframe_src() ) . '" class="thickbox add_media" id="$editor_id-add_media" title="' . esc_attr__( 'Add Media' ) . '" onclick="return false;">' . sprintf( $context, $img ) . '</a>'; 382 382 } 383 383 add_action( 'media_buttons', 'media_buttons' ); 384 384 385 385 function _media_button($title, $icon, $type, $id) { 386 return "<a href='" . esc_url( get_upload_iframe_src($type) ) . "' id='{$id}-add_{$type}' class='thickbox add_$type' title=' $title'><img src='" . esc_url( admin_url( $icon ) ) . "' alt='$title' onclick='return false;' /></a>";387 } 388 389 function get_upload_iframe_src( $type) {386 return "<a href='" . esc_url( get_upload_iframe_src($type) ) . "' id='{$id}-add_{$type}' class='thickbox add_$type' title='" . esc_attr( $title ) . "'><img src='" . esc_url( admin_url( $icon ) ) . "' alt='$title' onclick='return false;' /></a>"; 387 } 388 389 function get_upload_iframe_src( $type = null ) { 390 390 global $post_ID; 391 391 … … 393 393 $upload_iframe_src = add_query_arg( 'post_id', $uploading_iframe_ID, admin_url('media-upload.php') ); 394 394 395 if ( 'media' != $type )395 if ( $type && 'media' != $type ) 396 396 $upload_iframe_src = add_query_arg('type', $type, $upload_iframe_src); 397 397 … … 1457 1457 <?php wp_nonce_field('media-form'); ?> 1458 1458 1459 <h3 class="media-title"><?php _e(' Add media file from URL'); ?></h3>1459 <h3 class="media-title"><?php _e('Insert media from another website'); ?></h3> 1460 1460 1461 1461 <script type="text/javascript"> … … 1891 1891 1892 1892 return ' 1893 <h4 class="media-sub-title">' . __('Insert media from another web site') . '</h4> 1894 <p class="media-types"><label><input type="radio" name="media_type" value="image" id="image-only"' . checked( 'image-only', $view, false ) . ' /> ' . __( 'Images' ) . '</label> <label><input type="radio" name="media_type" value="generic" id="not-image"' . checked( 'not-image', $view, false ) . ' /> ' . __( 'Audio, Video, or Files' ) . '</label></p> 1893 <p class="media-types"><label><input type="radio" name="media_type" value="image" id="image-only"' . checked( 'image-only', $view, false ) . ' /> ' . __( 'Image' ) . '</label> <label><input type="radio" name="media_type" value="generic" id="not-image"' . checked( 'not-image', $view, false ) . ' /> ' . __( 'Audio, Video, or Other File' ) . '</label></p> 1895 1894 <table class="describe ' . $table_class . '"><tbody> 1896 1895 <tr>
Note: See TracChangeset
for help on using the changeset viewer.