X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/61343b82c4f0da4c68e4c6373daafff4a81efdd1..0f684a09c03e547d3132bddc970cbeafcd1102f4:/wp-admin/custom-header.php diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index 12288430..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' ) ); } /** @@ -84,15 +89,16 @@ class Custom_Image_Header { if ( ! current_user_can('edit_theme_options') ) return; - $this->page = $page = add_theme_page(__('Header'), __('Header'), 'edit_theme_options', 'custom-header', array(&$this, 'admin_page')); + $this->page = $page = add_theme_page(__('Header'), __('Header'), 'edit_theme_options', 'custom-header', array($this, 'admin_page')); - add_action("admin_print_scripts-$page", array(&$this, 'js_includes')); - add_action("admin_print_styles-$page", array(&$this, 'css_includes')); - add_action("admin_head-$page", array(&$this, 'help') ); - add_action("admin_head-$page", array(&$this, 'take_action'), 50); - add_action("admin_head-$page", array(&$this, 'js'), 50); + add_action("admin_print_scripts-$page", array($this, 'js_includes')); + add_action("admin_print_styles-$page", array($this, 'css_includes')); + add_action("admin_head-$page", array($this, 'help') ); + add_action("admin_head-$page", array($this, 'take_action'), 50); + 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 { ?>- admin_image_div_callback ) { - call_user_func( $this->admin_image_div_callback ); + admin_image_div_callback ) { + call_user_func( $this->admin_image_div_callback ); } else { $custom_header = get_custom_header(); $header_image_style = 'background-image:url(' . esc_url( get_header_image() ) . ');'; @@ -490,8 +500,10 @@ class Custom_Image_Header { | |||||||||||||
|