X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/8f374b7233bc2815ccc387e448d208c5434eb961..e08b42e8ad054ec67522d7ac1aaae5dc68cb3d01:/wp-admin/custom-header.php diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index fc9d4f12..7f222f7c 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -84,21 +84,15 @@ 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); - - if ( isset( $_REQUEST['context'] ) && $_REQUEST['context'] == 'custom-header' ) { - add_filter( 'attachment_fields_to_edit', array( $this, 'attachment_fields_to_edit' ), 10, 2 ); - add_filter( 'media_upload_tabs', array( $this, 'filter_upload_tabs' ) ); - add_filter( 'media_upload_mime_type_links', '__return_empty_array' ); - } } /** @@ -130,8 +124,8 @@ class Custom_Image_Header { 'title' => __('Header Text'), 'content' => '

' . sprintf( __( 'For most themes, the header text is your Site Title and Tagline, as defined in the General Settings section.' ), admin_url( 'options-general.php' ) ) . '

' . - '

' . __( 'In the Header Text section of this page, you can choose whether to display this text or hide it. You can also choose a color for the text by typing in a legitimate HTML hex value (eg: “#ff0000” for red) or by clicking “Select a Color” and dialing in a color using the color picker.') . '

' . - '

' . __( 'Don’t forget to Save Changes when you’re done!') . '

' + '

' . __( 'In the Header Text section of this page, you can choose whether to display this text or hide it. You can also choose a color for the text by clicking the Select Color button and either typing in a legitimate HTML hex value, e.g. “#ff0000” for red, or by choosing a color using the color picker.' ) . '

' . + '

' . __( 'Don’t forget to click “Save Changes” when you’re done!') . '

' ) ); get_current_screen()->set_help_sidebar( @@ -171,11 +165,10 @@ class Custom_Image_Header { $step = $this->step(); if ( ( 1 == $step || 3 == $step ) ) { - add_thickbox(); - wp_enqueue_script( 'media-upload' ); + wp_enqueue_media(); wp_enqueue_script( 'custom-header' ); if ( current_theme_supports( 'custom-header', 'header-text' ) ) - wp_enqueue_script('farbtastic'); + wp_enqueue_script( 'wp-color-picker' ); } elseif ( 2 == $step ) { wp_enqueue_script('imgareaselect'); } @@ -190,7 +183,7 @@ class Custom_Image_Header { $step = $this->step(); if ( ( 1 == $step || 3 == $step ) && current_theme_supports( 'custom-header', 'header-text' ) ) - wp_enqueue_style('farbtastic'); + wp_enqueue_style( 'wp-color-picker' ); elseif ( 2 == $step ) wp_enqueue_style('imgareaselect'); } @@ -215,12 +208,6 @@ class Custom_Image_Header { return; } - if ( isset( $_POST['resettext'] ) ) { - check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' ); - remove_theme_mod('header_textcolor'); - return; - } - if ( isset( $_POST['removeheader'] ) ) { check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' ); $this->remove_header_image(); @@ -332,7 +319,6 @@ class Custom_Image_Header { function js_1() { ?>