X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/fa11948979fd6a4ea5705dc613b239699a459db3..0f684a09c03e547d3132bddc970cbeafcd1102f4:/wp-admin/custom-header.php diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index 7b1a4b30..1c9971f5 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -43,7 +43,7 @@ class Custom_Image_Header { var $default_headers = array(); /** - * Holds custom headers uploaded by the user + * Holds custom headers uploaded by the user. * * @var array * @since 3.2.0 @@ -73,6 +73,11 @@ class Custom_Image_Header { $this->admin_image_div_callback = $admin_image_div_callback; add_action( 'admin_menu', array( $this, 'init' ) ); + + add_action( 'customize_save_after', array( $this, 'customize_set_last_used' ) ); + add_action( 'wp_ajax_custom-header-crop', array( $this, 'ajax_header_crop' ) ); + add_action( 'wp_ajax_custom-header-add', array( $this, 'ajax_header_add' ) ); + add_action( 'wp_ajax_custom-header-remove', array( $this, 'ajax_header_remove' ) ); } /** @@ -93,6 +98,7 @@ class Custom_Image_Header { add_action("admin_head-$page", array($this, 'js'), 50); if ( $this->admin_header_callback ) add_action("admin_head-$page", $this->admin_header_callback, 51); + } /** @@ -131,7 +137,7 @@ class Custom_Image_Header { get_current_screen()->set_help_sidebar( '
' . __( 'For more information:' ) . '
' . '' . __( 'Documentation on Custom Header' ) . '
' . - '' . __( 'Support Forums' ) . '
' + '' . __( 'Support Forums' ) . '
' ); } @@ -177,7 +183,7 @@ class Custom_Image_Header { /** * Set up the enqueue for the CSS files * - * @since 2.7 + * @since 2.7.0 */ function css_includes() { $step = $this->step(); @@ -248,6 +254,10 @@ class Custom_Image_Header { if ( !isset($_wp_default_headers) ) return; + if ( ! empty( $this->default_headers ) ) { + return; + } + $this->default_headers = $_wp_default_headers; $template_directory_uri = get_template_directory_uri(); $stylesheet_directory_uri = get_stylesheet_directory_uri(); @@ -255,7 +265,6 @@ class Custom_Image_Header { $this->default_headers[$header]['url'] = sprintf( $this->default_headers[$header]['url'], $template_directory_uri, $stylesheet_directory_uri ); $this->default_headers[$header]['thumbnail_url'] = sprintf( $this->default_headers[$header]['thumbnail_url'], $template_directory_uri, $stylesheet_directory_uri ); } - } /** @@ -450,8 +459,7 @@ class Custom_Image_Header { ?>
@@ -548,7 +557,7 @@ class Custom_Image_Header {
@@ -559,7 +568,7 @@ class Custom_Image_Header { | |||||
@@ -574,7 +583,7 @@ class Custom_Image_Header { | |||||
@@ -585,7 +594,7 @@ class Custom_Image_Header { $default_image = get_theme_support( 'custom-header', 'default-image' ); if ( $default_image && get_header_image() != $default_image ) : ?> - | |||||
@@ -602,7 +611,7 @@ class Custom_Image_Header {
|