diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index c47e299d5c..422793c076 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -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 = <<$image_title - $video_title - $audio_title - $media_title + $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 .= '$image_title'; + if ( $do_video ) + $out .= '$video_title'; + if ( $do_audio ) + $out .= '$audio_title'; + $out .= '$media_title'; -EOF; printf($context, $out); } add_action( 'media_buttons', 'media_buttons' ); diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php index 721ba27723..bad0993948 100644 --- a/wp-admin/includes/ms.php +++ b/wp-admin/includes/ms.php @@ -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 .= "$image_title"; - } - 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 .= "$video_title"; - } - 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 .= "$audio_title"; - } - $out .= "$media_title"; - 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() )