From 9928e82e36449e77033e6698b24ea103a6017fa9 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Thu, 13 Nov 2008 07:45:11 +0000 Subject: [PATCH] Do not show Media Upload buttons in Visual Editor if user lacks the capabilities to upload files. fixes #8110 git-svn-id: http://svn.automattic.com/wordpress/trunk@9660 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-form-advanced.php | 2 -- wp-includes/general-template.php | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 064b30aa20..0d9008a451 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -577,8 +577,6 @@ endif; ?>
- - post_content); ?>
diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 9c6a664bf0..cfa45f2967 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -1483,6 +1483,9 @@ function the_editor($content, $id = 'content', $prev_id = 'title', $media_button if (($rows < 3) || ($rows > 100)) $rows = 12; + if ( !current_user_can( 'upload_files' ) ) + $media_buttons = false; + $richedit = user_can_richedit(); $rows = "rows='$rows'";