Changeset 14015
- Timestamp:
- 04/06/2010 11:20:47 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r13940 r14015 352 352 */ 353 353 function media_buttons() { 354 global $post_ID, $temp_ID;355 $uploading_iframe_ID = (int) (0 == $post_ID ? $temp_ID : $post_ID);356 $context = apply_filters('media_buttons_context', __('Upload/Insert %s'));357 $media_upload_iframe_src = "media-upload.php?post_id=$uploading_iframe_ID";358 $media_title = __('Add Media');359 $image_upload_iframe_src = apply_filters('image_upload_iframe_src', "$media_upload_iframe_src&type=image");360 $image_title = __('Add an Image');361 $video_upload_iframe_src = apply_filters('video_upload_iframe_src', "$media_upload_iframe_src&type=video");362 $video_title = __('Add Video');363 $audio_upload_iframe_src = apply_filters('audio_upload_iframe_src', "$media_upload_iframe_src&type=audio");364 $audio_title = __('Add Audio');365 366 354 $do_image = $do_audio = $do_video = true; 367 355 if ( is_multisite() ) { … … 377 365 378 366 if ( $do_image ) 379 $out .= "<a href='{$image_upload_iframe_src}&TB_iframe=true' id='add_image' class='thickbox' title='$image_title' onclick='return false;'><img src='" . esc_url( admin_url( 'images/media-button-image.gif' ) ) . "' alt='$image_title' /></a>";367 $out .= _media_button(__('Add an Image'), 'images/media-button-image.gif', 'image'); 380 368 if ( $do_video ) 381 $out .= "<a href='{$video_upload_iframe_src}&TB_iframe=true' id='add_video' class='thickbox' title='$video_title' onclick='return false;'><img src='" . esc_url( admin_url( 'images/media-button-video.gif' ) ) . "' alt='$video_title' /></a>";369 $out .= _media_button(__('Add Video'), 'images/media-button-video.gif', 'video'); 382 370 if ( $do_audio ) 383 $out .= "<a href='{$audio_upload_iframe_src}&TB_iframe=true' id='add_audio' class='thickbox' title='$audio_title' onclick='return false;'><img src='" . esc_url( admin_url( 'images/media-button-music.gif' ) ) . "' alt='$audio_title' /></a>"; 384 $out .= "<a href='{$media_upload_iframe_src}&TB_iframe=true' id='add_media' class='thickbox' title='$media_title' onclick='return false;'><img src='" . esc_url( admin_url( 'images/media-button-other.gif' ) ) . "' alt='$media_title' /></a>"; 371 $out .= _media_button(__('Add Audio'), 'images/media-button-music.gif', 'audio'); 372 373 $out .= _media_button(__('Add Media'), 'images/media-button-other.gif', 'media'); 374 375 $context = apply_filters('media_buttons_context', __('Upload/Insert %s')); 385 376 386 377 printf($context, $out); 387 378 } 388 379 add_action( 'media_buttons', 'media_buttons' ); 380 381 function _media_button($title, $icon, $type) { 382 return "<a href='" . 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 } 389 396 390 397 /** -
trunk/wp-admin/includes/post.php
r13940 r14015 1144 1144 function _wp_post_thumbnail_html( $thumbnail_id = NULL ) { 1145 1145 global $content_width, $_wp_additional_image_sizes; 1146 $content = '<p class="hide-if-no-js"><a href="#" id="set-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . esc_html__( 'Set featured image' ) . '</a></p>'; 1146 1147 $set_thumbnail_link = '<p class="hide-if-no-js"><a href="' . get_upload_iframe_src('image') . '" id="set-post-thumbnail" class="thickbox">%s</a></p>'; 1148 $content = sprintf($set_thumbnail_link, esc_html__( 'Set featured image' )); 1147 1149 1148 1150 if ( $thumbnail_id && get_post( $thumbnail_id ) ) { … … 1154 1156 $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'post-thumbnail' ); 1155 1157 if ( !empty( $thumbnail_html ) ) { 1156 $content = '<a href="#" id="set-post-thumbnail" onclick="jQuery(\'#add_image\').click();return false;">' . $thumbnail_html . '</a>';1158 $content = sprintf($set_thumbnail_link, $thumbnail_html); 1157 1159 $content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" onclick="WPRemoveThumbnail();return false;">' . esc_html__( 'Remove featured image' ) . '</a></p>'; 1158 1160 } -
trunk/wp-includes/js/thickbox/thickbox.js
r13864 r14015 24 24 //add thickbox to href & area elements that have a class of .thickbox 25 25 function tb_init(domChunk){ 26 jQuery(domChunk). click(function(){26 jQuery(domChunk).live('click', function(){ 27 27 var t = this.title || this.name || null; 28 28 var a = this.href || this.alt; -
trunk/wp-includes/script-loader.php
r13984 r14015 168 168 $scripts->add_data( 'jquery-autocomplete', 'group', 1 ); 169 169 170 $scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-2010 0108');170 $scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-20104104'); 171 171 $scripts->add_data( 'thickbox', 'group', 1 ); 172 172 $scripts->localize( 'thickbox', 'thickboxL10n', array(
Note: See TracChangeset
for help on using the changeset viewer.