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
This commit is contained in:
markjaquith 2008-11-13 07:45:11 +00:00
parent b9098f869b
commit 9928e82e36
2 changed files with 3 additions and 2 deletions

View File

@ -577,8 +577,6 @@ endif; ?>
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
<!--<div id="add-media-button"><a id="add-media-link" href="<?php echo clean_url( admin_url( 'media-upload.php?post_id=' . ( $post_ID ? $post_ID : $temp_ID ) . '&amp;type=image&amp;TB_iframe=true' ) ); ?>" class="thickbox button"><?php _e( 'Insert Media' ); ?></a></div>-->
<?php the_editor($post->post_content); ?>
<div id="post-status-info">

View File

@ -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'";