WordPress.org

Make WordPress Core

Changeset 15828


Ignore:
Timestamp:
10/17/10 07:12:34 (6 years ago)
Author:
nacin
Message:

Allow disabling of custom header uploads via remove_theme_support. props jorbin, fixes #14837.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/custom-header.php

    r15805 r15828  
    457457</td> 
    458458</tr> 
    459  
     459<?php if ( current_theme_supports( 'custom-header-uploads' ) ) : ?> 
    460460<tr valign="top"> 
    461461<th scope="row"><?php _e( 'Upload Image' ); ?></th> 
     
    474474</td> 
    475475</tr> 
     476<?php endif; ?> 
    476477</tbody> 
    477478</table> 
     
    484485<th scope="row"><?php _e( 'Default Images' ); ?></th> 
    485486<td> 
     487<?php if ( current_theme_supports( 'custom-header-uploads' ) ) : ?> 
    486488    <p><?php _e( 'If you don&lsquo;t want to upload your own image, you can use one of these cool headers.' ) ?></p> 
     489<?php else: ?> 
     490    <p><?php _e( 'You can use one of these cool headers.' ) ?> 
     491<?php endif; ?> 
    487492    <?php 
    488493        $this->show_default_header_selector(); 
     
    571576    function step_2() { 
    572577        check_admin_referer('custom-header-upload', '_wpnonce-custom-header-upload'); 
     578        if ( ! current_theme_supports( 'custom-header-uploads' ) ) 
     579            wp_die( 'Cheatin&#8217; uh?' ); 
     580 
    573581        $overrides = array('test_form' => false); 
    574582        $file = wp_handle_upload($_FILES['import'], $overrides); 
     
    651659    function step_3() { 
    652660        check_admin_referer('custom-header-crop-image'); 
     661        if ( ! current_theme_supports( 'custom-header-uploads' ) ) 
     662            wp_die( 'Cheatin&#8217; uh?' ); 
     663 
    653664        if ( $_POST['oitar'] > 1 ) { 
    654665            $_POST['x1'] = $_POST['x1'] * $_POST['oitar']; 
  • trunk/wp-includes/theme.php

    r15803 r15828  
    14681468 
    14691469    add_theme_support( 'custom-header' ); 
     1470    add_theme_support( 'custom-header-uploads' ); 
    14701471 
    14711472    if ( ! is_admin() ) 
Note: See TracChangeset for help on using the changeset viewer.