Make WordPress Core

Ticket #32654: 32654.diff

File 32654.diff, 3.4 KB (added by wonderboymusic, 10 years ago)
  • src/wp-admin/custom-background.php

     
    259259</tr>
    260260<?php endif; ?>
    261261
     262<?php if ( current_user_can( 'upload_files' ) ): ?>
    262263<tr>
    263264<th scope="row"><?php _e('Select Image'); ?></th>
    264265<td><form enctype="multipart/form-data" id="upload-form" class="wp-upload-form" method="post">
     
    278279        </form>
    279280</td>
    280281</tr>
     282<?php endif; ?>
    281283</tbody>
    282284</table>
    283285
  • src/wp-admin/custom-header.php

     
    509509</tr>
    510510<?php endif; ?>
    511511
    512 <?php if ( current_theme_supports( 'custom-header', 'uploads' ) ) : ?>
     512<?php if ( current_user_can( 'upload_files' ) && current_theme_supports( 'custom-header', 'uploads' ) ) : ?>
    513513<tr>
    514514<th scope="row"><?php _e( 'Select Image' ); ?></th>
    515515<td>
  • src/wp-includes/class-wp-customize-control.php

     
    721721                $this->json['label'] = html_entity_decode( $this->label, ENT_QUOTES, get_bloginfo( 'charset' ) );
    722722                $this->json['mime_type'] = $this->mime_type;
    723723                $this->json['button_labels'] = $this->button_labels;
     724                $this->json['canUpload'] = current_user_can( 'upload_files' );
    724725
    725726                $value = $this->value();
    726727
     
    823824                                </div>
    824825                        </div>
    825826                        <div class="actions">
     827                                <# if ( data.canUpload ) { #>
    826828                                <button type="button" class="button remove-button"><?php echo $this->button_labels['remove']; ?></button>
    827829                                <button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button"><?php echo $this->button_labels['change']; ?></button>
    828830                                <div style="clear:both"></div>
     831                                <# } #>
    829832                        </div>
    830833                <# } else { #>
    831834                        <div class="current">
     
    843846                                <# if ( data.defaultAttachment ) { #>
    844847                                        <button type="button" class="button default-button"><?php echo $this->button_labels['default']; ?></button>
    845848                                <# } #>
     849                                <# if ( data.canUpload ) { #>
    846850                                <button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button"><?php echo $this->button_labels['select']; ?></button>
     851                                <# } #>
    847852                                <div style="clear:both"></div>
    848853                        </div>
    849854                <# } #>
     
    11581163                $width = absint( get_theme_support( 'custom-header', 'width' ) );
    11591164                $height = absint( get_theme_support( 'custom-header', 'height' ) );
    11601165                ?>
    1161 
    1162 
    11631166                <div class="customize-control-content">
    11641167                        <p class="customizer-section-intro">
    11651168                                <?php
     
    11801183                                </div>
    11811184                        </div>
    11821185                        <div class="actions">
     1186                                <?php if ( current_user_can( 'upload_files' ) ): ?>
    11831187                                <?php /* translators: Hide as in hide header image via the Customizer */ ?>
    11841188                                <button type="button"<?php echo $visibility ?> class="button remove"><?php _ex( 'Hide image', 'custom header' ); ?></button>
    11851189                                <?php /* translators: New as in add new header image via the Customizer */ ?>
    11861190                                <button type="button" class="button new"><?php _ex( 'Add new image', 'header image' ); ?></button>
    11871191                                <div style="clear:both"></div>
     1192                                <?php endif; ?>
    11881193                        </div>
    11891194                        <div class="choices">
    11901195                                <span class="customize-control-title header-previously-uploaded">