The query-attachments AJAX action immediately errors out if the user doesn't have the upload_files cap. As such, the Customizer shouldn't show buttons that launch the media modal when the user doesn't have the proper permissions to query attachments.

See #32654.


git-svn-id: https://develop.svn.wordpress.org/trunk@32913 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2015-06-23 18:19:43 +00:00
parent 2399de6870
commit 5beca90d40
3 changed files with 10 additions and 3 deletions
+2
View File
@@ -259,6 +259,7 @@ class Custom_Background {
</tr>
<?php endif; ?>
<?php if ( current_user_can( 'upload_files' ) ): ?>
<tr>
<th scope="row"><?php _e('Select Image'); ?></th>
<td><form enctype="multipart/form-data" id="upload-form" class="wp-upload-form" method="post">
@@ -278,6 +279,7 @@ class Custom_Background {
</form>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
+1 -1
View File
@@ -509,7 +509,7 @@ class Custom_Image_Header {
</tr>
<?php endif; ?>
<?php if ( current_theme_supports( 'custom-header', 'uploads' ) ) : ?>
<?php if ( current_user_can( 'upload_files' ) && current_theme_supports( 'custom-header', 'uploads' ) ) : ?>
<tr>
<th scope="row"><?php _e( 'Select Image' ); ?></th>
<td>