WordPress.org

Ready to get started?Download WordPress

Forums

Bug fix for thickbox (2 posts)

  1. fosron
    Member
    Posted 4 years ago #

    Hello, i've had some problems with thickbox media window. It didnt want to show up on some computers, with slow internet connection. I've found the solution, and i want to suggest it to the WordPress core (Can't use SVN for that).

    Open file /wp-admin/includes/media.php
    find function media_buttons() { (line 349 on 2.8.3)
    and the find

    $out = <<<EOF
    
    	<a href="{$image_upload_iframe_src}&TB_iframe=true" id="add_image" class="thickbox" title='$image_title' onclick="return false;"><img src='images/media-button-image.gif' alt='$image_title' /></a>
    	<a href="{$video_upload_iframe_src}&TB_iframe=true" id="add_video" class="thickbox" title='$video_title' onclick="return false;"><img src='images/media-button-video.gif' alt='$video_title' /></a>
    	<a href="{$audio_upload_iframe_src}&TB_iframe=true" id="add_audio" class="thickbox" title='$audio_title' onclick="return false;"><img src='images/media-button-music.gif' alt='$audio_title' /></a>
    	<a href="{$media_upload_iframe_src}&TB_iframe=true" id="add_media" class="thickbox" title='$media_title' onclick="return false;"><img src='images/media-button-other.gif' alt='$media_title' /></a>
    
    EOF;

    and change it with `$out = <<<EOF

    <img src='images/media-button-image.gif' alt='$image_title' />
    <img src='images/media-button-video.gif' alt='$video_title' />
    <img src='images/media-button-music.gif' alt='$audio_title' />
    <img src='images/media-button-other.gif' alt='$media_title' />

    EOF;`

    it just removes onclick="return false;" which i found not useful.

  2. fosron
    Member
    Posted 4 years ago #

    oops, it should be

    $out = <<<EOF
    
    	<a href="{$image_upload_iframe_src}&TB_iframe=true" id="add_image" class="thickbox" title='$image_title'><img src='images/media-button-image.gif' alt='$image_title' /></a>
    	<a href="{$video_upload_iframe_src}&TB_iframe=true" id="add_video" class="thickbox" title='$video_title'><img src='images/media-button-video.gif' alt='$video_title' /></a>
    	<a href="{$audio_upload_iframe_src}&TB_iframe=true" id="add_audio" class="thickbox" title='$audio_title'><img src='images/media-button-music.gif' alt='$audio_title' /></a>
    	<a href="{$media_upload_iframe_src}&TB_iframe=true" id="add_media" class="thickbox" title='$media_title'><img src='images/media-button-other.gif' alt='$media_title' /></a>
    
    EOF;

Topic Closed

This topic has been closed to new replies.

About this Topic