From c91b9cc8177f68257c937dc36ea242ff77c43559 Mon Sep 17 00:00:00 2001 From: nacin Date: Fri, 28 May 2010 00:27:53 +0000 Subject: [PATCH] Custom header and background help. props jane, see #13467. git-svn-id: http://svn.automattic.com/wordpress/trunk@15019 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/custom-background.php | 17 ++++++++++++++++- wp-admin/custom-header.php | 26 +++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/wp-admin/custom-background.php b/wp-admin/custom-background.php index dd41e38f6..f7a79f029 100644 --- a/wp-admin/custom-background.php +++ b/wp-admin/custom-background.php @@ -33,6 +33,15 @@ class Custom_Background { */ var $admin_image_div_callback; + /** + * Holds the page menu hook. + * + * @var string + * @since 3.0.0 + * @access private + */ + var $page = ''; + /** * PHP4 Constructor - Register administration header callback. * @@ -55,7 +64,7 @@ class Custom_Background { if ( ! current_user_can('edit_theme_options') ) return; - $page = add_theme_page(__('Background'), __('Background'), 'edit_theme_options', 'custom-background', array(&$this, 'admin_page')); + $this->page = $page = add_theme_page(__('Background'), __('Background'), 'edit_theme_options', 'custom-background', array(&$this, 'admin_page')); add_action("load-$page", array(&$this, 'admin_load')); add_action("load-$page", array(&$this, 'take_action'), 49); @@ -71,6 +80,12 @@ class Custom_Background { * @since 3.0.0 */ function admin_load() { + add_contextual_help( $this->page, '

' . __( 'You can set a custom image header for your site. Simply upload the image and crop it, and the new header will go live immediately. ' ) . '

' . + '

' . __( 'If you want to discard your custom header and go back to the default included in your theme, click on the buttons to remove the custom image and restore the original header image. ' ) . '

' . + '

' . __( 'Some themes comes with additional header images bundled. If you see multiple images displayed, select the one you’d like and click the Save Changes button. ' ) . '

' . + '

' . __( 'For more information:' ) . '

' . + '

' . __( 'Documentation' ) . '

' . + '

' . __( 'Support Forums' ) . '

' ); wp_enqueue_script('custom-background'); wp_enqueue_style('farbtastic'); } diff --git a/wp-admin/custom-header.php b/wp-admin/custom-header.php index 6da3d191e..97f7ae095 100644 --- a/wp-admin/custom-header.php +++ b/wp-admin/custom-header.php @@ -42,6 +42,15 @@ class Custom_Image_Header { */ var $default_headers = array(); + /** + * Holds the page menu hook. + * + * @var string + * @since 3.0.0 + * @access private + */ + var $page = ''; + /** * PHP4 Constructor - Register administration header callback. * @@ -64,15 +73,30 @@ class Custom_Image_Header { if ( ! current_user_can('edit_theme_options') ) return; - $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_head-$page", $this->admin_header_callback, 51); } + /** + * Adds contextual help. + * + * @since 3.0.0 + */ + function help() { + add_contextual_help( $this->page, '

' . __( 'You can set a custom image header for your site. Simply upload the image and crop it, and the new header will go live immediately. ' ) . '

' . + '

' . __( 'If you want to discard your custom header and go back to the default included in your theme, click on the buttons to remove the custom image and restore the original header image. ' ) . '

' . + '

' . __( 'Some themes comes with additional header images bundled. If you see multiple images displayed, select the one you’d like and click the Save Changes button. ' ) . '

' . + '

' . __( 'For more information:' ) . '

' . + '

' . __( 'Documentation' ) . '

' . + '

' . __( 'Support Forums' ) . '

' ); + } + /** * Get the current step. *