X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/48ab98cb1779cf2088c1351ac3dd3d0da6fb31d3..caeaf8dc94b5e3f75dc98ec92dc7b76049cdddb6:/wp-admin/custom-header.php diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index 76f6f746..0e5ffa6b 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -60,6 +60,11 @@ class Custom_Image_Header { */ private $page = ''; + /** + * @var bool + */ + private $updated; + /** * Constructor - Register administration header callback. * @@ -300,9 +305,6 @@ class Custom_Image_Header { public function process_default_headers() { global $_wp_default_headers; - if ( !empty($this->headers) ) - return; - if ( !isset($_wp_default_headers) ) return; @@ -360,7 +362,7 @@ class Custom_Image_Header { } /** - * Execute Javascript depending on step. + * Execute JavaScript depending on step. * * @since 2.1.0 */ @@ -373,7 +375,7 @@ class Custom_Image_Header { } /** - * Display Javascript based on Step 1 and 3. + * Display JavaScript based on Step 1 and 3. * * @since 2.6.0 */ @@ -437,7 +439,7 @@ class Custom_Image_Header { } /** - * Display Javascript based on Step 2. + * Display JavaScript based on Step 2. * * @since 2.6.0 */ @@ -522,6 +524,19 @@ class Custom_Image_Header {

+ +
+

+ Customizer.' ), + admin_url( 'customize.php?autofocus[control]=header_image' ) + ); + ?> +

+
+ + updated ) ) { ?>

Visit your site to see how it looks.' ), home_url( '/' ) ); ?>

@@ -555,7 +570,7 @@ class Custom_Image_Header { else $style = ' style="display:none;"'; ?> -

onclick="return false;" href="">

+

onclick="return false;" href="" tabindex="-1">

>
@@ -602,10 +617,10 @@ class Custom_Image_Header { ?>


- + data-update="">

@@ -615,6 +630,7 @@ class Custom_Image_Header {
+ @@ -736,7 +752,7 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> public function step_2() { check_admin_referer('custom-header-upload', '_wpnonce-custom-header-upload'); if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) - wp_die( __( 'Cheatin’ uh?' ) ); + wp_die( __( 'Cheatin’ uh?' ), 403 ); if ( empty( $_POST ) && isset( $_GET['file'] ) ) { $attachment_id = absint( $_GET['file'] ); @@ -748,7 +764,6 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> $attachment_id = $data['attachment_id']; $file = $data['file']; $url = $data['url']; - $type = $data['type']; } if ( file_exists( $file ) ) { @@ -888,10 +903,10 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> check_admin_referer( 'custom-header-crop-image' ); if ( ! current_theme_supports( 'custom-header', 'uploads' ) ) - wp_die( __( 'Cheatin’ uh?' ) ); + wp_die( __( 'Cheatin’ uh?' ), 403 ); if ( ! empty( $_POST['skip-cropping'] ) && ! ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) ) - wp_die( __( 'Cheatin’ uh?' ) ); + wp_die( __( 'Cheatin’ uh?' ), 403 ); if ( $_POST['oitar'] > 1 ) { $_POST['x1'] = $_POST['x1'] * $_POST['oitar']; @@ -1107,7 +1122,7 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> $has_flex_width = current_theme_supports( 'custom-header', 'flex-width' ); $has_flex_height = current_theme_supports( 'custom-header', 'flex-height' ); $has_max_width = current_theme_supports( 'custom-header', 'max-width' ) ; - $dst = array( 'dst_height' => null, 'dst_height' => null ); + $dst = array( 'dst_height' => null, 'dst_width' => null ); // For flex, limit size of image displayed to 1500px unless theme says otherwise if ( $has_flex_width ) {