WordPress.org

Make WordPress Core

Changeset 33854


Ignore:
Timestamp:
09/02/15 16:28:18 (2 years ago)
Author:
SergeyBiryukov
Message:

Provide more helpful feedback than just "Cheatin' uh?" for permission errors in wp-admin/custom-header.php.

props ericlewis, kraftbj, lukecarbis, mrmist.
fixes #33667. see #14530.

File:
1 edited

Legend:

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

    r33180 r33854  
    684684    public function step_2() { 
    685685        check_admin_referer('custom-header-upload', '_wpnonce-custom-header-upload'); 
    686         if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) 
    687             wp_die( __( 'Cheatin’ uh?' ), 403 ); 
     686        if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) { 
     687            wp_die( 
     688                '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . 
     689                '<p>' . __( 'The current theme does not support uploading a custom header image.' ) . '</p>', 
     690                403 
     691            ); 
     692        } 
    688693 
    689694        if ( empty( $_POST ) && isset( $_GET['file'] ) ) { 
     
    835840        check_admin_referer( 'custom-header-crop-image' ); 
    836841 
    837         if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) 
    838             wp_die( __( 'Cheatin&#8217; uh?' ), 403 ); 
    839  
    840         if ( ! empty( $_POST['skip-cropping'] ) && ! ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) ) 
    841             wp_die( __( 'Cheatin&#8217; uh?' ), 403 ); 
     842        if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) { 
     843            wp_die( 
     844                '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . 
     845                '<p>' . __( 'The current theme does not support uploading a custom header image.' ) . '</p>', 
     846                403 
     847            ); 
     848        } 
     849 
     850        if ( ! empty( $_POST['skip-cropping'] ) && ! ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) ) { 
     851            wp_die( 
     852                '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' . 
     853                '<p>' . __( 'The current theme does not support a flexible sized header image.' ) . '</p>', 
     854                403 
     855            ); 
     856        } 
    842857 
    843858        if ( $_POST['oitar'] > 1 ) { 
Note: See TracChangeset for help on using the changeset viewer.