Make WordPress Core


Ignore:
Timestamp:
11/08/2012 07:11:46 PM (12 years ago)
Author:
ryan
Message:

Don't show "Skip Cropping, Publish Image as Is" button for themes that do not support headers with flexible width or height. Forces too small images to be scaled to fit in the absence of flex support.

Props MadtownLems, kobenland
fixes #21100

File:
1 edited

Legend:

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

    r22462 r22468  
    747747    <?php submit_button( __( 'Crop and Publish' ), 'primary', 'submit', false ); ?>
    748748    <?php
    749     if ( isset( $oitar ) && 1 == $oitar )
     749    if ( isset( $oitar ) && 1 == $oitar && ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) )
    750750        submit_button( __( 'Skip Cropping, Publish Image as Is' ), 'secondary', 'skip-cropping', false );
    751751    ?>
     
    799799            wp_die( __( 'Cheatin&#8217; uh?' ) );
    800800
     801        if ( ! empty( $_POST['skip-cropping'] ) && ! ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) )
     802            wp_die( __( 'Cheatin&#8217; uh?' ) );
     803           
    801804        if ( $_POST['oitar'] > 1 ) {
    802805            $_POST['x1'] = $_POST['x1'] * $_POST['oitar'];
Note: See TracChangeset for help on using the changeset viewer.