*/
private $page = '';
+ /**
+ * @var bool
+ */
+ private $updated;
+
/**
* Constructor - Register administration header callback.
*
public function process_default_headers() {
global $_wp_default_headers;
- if ( !empty($this->headers) )
- return;
-
if ( !isset($_wp_default_headers) )
return;
}
/**
- * Execute Javascript depending on step.
+ * Execute JavaScript depending on step.
*
* @since 2.1.0
*/
}
/**
- * Display Javascript based on Step 1 and 3.
+ * Display JavaScript based on Step 1 and 3.
*
* @since 2.6.0
*/
}
/**
- * Display Javascript based on Step 2.
+ * Display JavaScript based on Step 2.
*
* @since 2.6.0
*/
<div class="wrap">
<h2><?php _e( 'Custom Header' ); ?></h2>
+<?php if ( current_user_can( 'customize' ) ) { ?>
+<div class="notice notice-info hide-if-no-customize">
+ <p>
+ <?php
+ printf(
+ __( 'You can now manage and live-preview Custom Header in the <a href="%1$s">Customizer</a>.' ),
+ admin_url( 'customize.php?autofocus[control]=header_image' )
+ );
+ ?>
+ </p>
+</div>
+<?php } ?>
+
<?php if ( ! empty( $this->updated ) ) { ?>
<div id="message" class="updated">
<p><?php printf( __( 'Header updated. <a href="%s">Visit your site</a> to see how it looks.' ), home_url( '/' ) ); ?></p>
else
$style = ' style="display:none;"';
?>
- <h1><a id="name" class="displaying-header-text" <?php echo $style; ?> onclick="return false;" href="<?php bloginfo('url'); ?>"><?php bloginfo( 'name' ); ?></a></h1>
+ <h1><a id="name" class="displaying-header-text" <?php echo $style; ?> onclick="return false;" href="<?php bloginfo('url'); ?>" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1>
<div id="desc" class="displaying-header-text" <?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>
</div>
<?php } ?>
?>
<p>
<label for="choose-from-library-link"><?php _e( 'Or choose an image from your media library:' ); ?></label><br />
- <a id="choose-from-library-link" class="button"
+ <button id="choose-from-library-link" class="button"
data-update-link="<?php echo esc_attr( $modal_update_href ); ?>"
data-choose="<?php esc_attr_e( 'Choose a Custom Header' ); ?>"
- data-update="<?php esc_attr_e( 'Set as header' ); ?>"><?php _e( 'Choose Image' ); ?></a>
+ data-update="<?php esc_attr_e( 'Set as header' ); ?>"><?php _e( 'Choose Image' ); ?></button>
</p>
</form>
</td>
</table>
<form method="post" action="<?php echo esc_url( add_query_arg( 'step', 1 ) ) ?>">
+<?php submit_button( null, 'screen-reader-text', 'save-header-options', false ); ?>
<table class="form-table">
<tbody>
<?php if ( get_uploaded_header_images() ) : ?>
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'] );
$attachment_id = $data['attachment_id'];
$file = $data['file'];
$url = $data['url'];
- $type = $data['type'];
}
if ( file_exists( $file ) ) {
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'];
$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 ) {