Merge mu_media_buttons() into media_buttons(). see #11644
git-svn-id: http://svn.automattic.com/wordpress/trunk@12955 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f4ad08882e
commit
79007568a6
|
@ -361,14 +361,27 @@ function media_buttons() {
|
|||
$video_title = __('Add Video');
|
||||
$audio_upload_iframe_src = apply_filters('audio_upload_iframe_src', "$media_upload_iframe_src&type=audio");
|
||||
$audio_title = __('Add Audio');
|
||||
$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>
|
||||
$do_image = $do_audio = $do_video = true;
|
||||
if ( is_multisite() ) {
|
||||
$media_buttons = get_site_option( 'mu_media_buttons' );
|
||||
if ( empty($media_buttons['image']) )
|
||||
$do_image = false;
|
||||
if ( empty($media_buttons['audio']) )
|
||||
$do_audio = false;
|
||||
if ( empty($media_buttons['video']) )
|
||||
$do_video = false;
|
||||
}
|
||||
$out = '';
|
||||
|
||||
if ( $do_image )
|
||||
$out .= '<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>';
|
||||
if ( $do_video )
|
||||
$out .= '<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>';
|
||||
if ( $do_audio )
|
||||
$out .= '<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>';
|
||||
$out .= '<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;
|
||||
printf($context, $out);
|
||||
}
|
||||
add_action( 'media_buttons', 'media_buttons' );
|
||||
|
|
|
@ -594,36 +594,6 @@ function mu_dropdown_languages( $lang_files = array(), $current = '' ) {
|
|||
echo implode("\n\t", $output);
|
||||
}
|
||||
|
||||
// Only show "Media" upload icon
|
||||
function mu_media_buttons() {
|
||||
global $post_ID, $temp_ID;
|
||||
$uploading_iframe_ID = (int) (0 == $post_ID ? $temp_ID : $post_ID);
|
||||
$context = apply_filters('media_buttons_context', __('Add media: %s'));
|
||||
$media_upload_iframe_src = "media-upload.php?post_id=$uploading_iframe_ID";
|
||||
$media_title = __('Add Media');
|
||||
$mu_media_buttons = get_site_option( 'mu_media_buttons' );
|
||||
$out = '';
|
||||
if ( $mu_media_buttons[ 'image' ] ) {
|
||||
$image_upload_iframe_src = apply_filters('image_upload_iframe_src', "$media_upload_iframe_src&type=image");
|
||||
$image_title = __('Add an Image');
|
||||
$out .= "<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>";
|
||||
}
|
||||
if ( $mu_media_buttons[ 'video' ] ) {
|
||||
$video_upload_iframe_src = apply_filters('video_upload_iframe_src', "$media_upload_iframe_src&type=video");
|
||||
$video_title = __('Add Video');
|
||||
$out .= "<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>";
|
||||
}
|
||||
if ( $mu_media_buttons[ 'audio' ] ) {
|
||||
$audio_upload_iframe_src = apply_filters('audio_upload_iframe_src', "$media_upload_iframe_src&type=audio");
|
||||
$audio_title = __('Add Audio');
|
||||
$out .= "<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>";
|
||||
}
|
||||
$out .= "<a href='{$media_upload_iframe_src}&TB_iframe=true&height=500&width=640' class='thickbox' title='$media_title'><img src='images/media-button-other.gif' alt='$media_title' /></a>";
|
||||
printf($context, $out);
|
||||
}
|
||||
add_action( 'media_buttons', 'mu_media_buttons' );
|
||||
remove_action( 'media_buttons', 'media_buttons' );
|
||||
|
||||
/* Warn the admin if SECRET SALT information is missing from wp-config.php */
|
||||
function secret_salt_warning() {
|
||||
if ( !is_super_admin() )
|
||||
|
|
Loading…
Reference in New Issue