Make WordPress Core


Ignore:
Timestamp:
11/10/2011 02:01:46 PM (15 years ago)
Author:
ryan
Message:

Contextual help for Twenty Eleven theme options page. see #19020

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyeleven/inc/theme-options.php

    r18978 r19237  
    108108                return;
    109109
    110         $help = '<p>' . __( 'Some themes provide customization options that are grouped together on a Theme Options screen. If you change themes, options may change or disappear, as they are theme-specific. Your current theme, Twenty Eleven, provides the following Theme Options:', 'twentyeleven' ) . '</p>' .
     110        add_action( "load-$theme_page", 'twentyeleven_theme_options_help' );
     111}
     112add_action( 'admin_menu', 'twentyeleven_theme_options_add_page' );
     113
     114function twentyeleven_theme_options_help() {
     115        if ( ! method_exists( get_current_screen(), 'add_help_tab' ) )
     116                return;
     117
     118        get_current_screen()->add_help_tab( array(
     119                'title' => __('Screen Info'),
     120                'id' => 'theme-options-help',
     121                'content' =>
     122                        '<p>' . __( 'Some themes provide customization options that are grouped together on a Theme Options screen. If you change themes, options may change or disappear, as they are theme-specific. Your current theme, Twenty Eleven, provides the following Theme Options:', 'twentyeleven' ) . '</p>' .
    111123                        '<ol>' .
    112124                                '<li>' . __( '<strong>Color Scheme</strong>: You can choose a color palette of "Light" (light background with dark text) or "Dark" (dark background with light text) for your site.', 'twentyeleven' ) . '</li>' .
     
    114126                                '<li>' . __( '<strong>Default Layout</strong>: You can choose if you want your site&#8217;s default layout to have a sidebar on the left, the right, or not at all.', 'twentyeleven' ) . '</li>' .
    115127                        '</ol>' .
    116                         '<p>' . __( 'Remember to click "Save Changes" to save any changes you have made to the theme options.', 'twentyeleven' ) . '</p>' .
    117                         '<p><strong>' . __( 'For more information:', 'twentyeleven' ) . '</strong></p>' .
    118                         '<p>' . __( '<a href="http://codex.wordpress.org/Appearance_Theme_Options_Screen" target="_blank">Documentation on Theme Options</a>', 'twentyeleven' ) . '</p>' .
    119                         '<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>', 'twentyeleven' ) . '</p>';
    120 
    121         add_contextual_help( $theme_page, $help );
    122 }
    123 add_action( 'admin_menu', 'twentyeleven_theme_options_add_page' );
     128                        '<p>' . __( 'Remember to click "Save Changes" to save any changes you have made to the theme options.', 'twentyeleven' ) . '</p>'
     129                )
     130        );
     131
     132        get_current_screen()->set_help_sidebar(
     133                '<p><strong>' . __( 'For more information:', 'twentyeleven' ) . '</strong></p>' .
     134                '<p>' . __( '<a href="http://codex.wordpress.org/Appearance_Theme_Options_Screen" target="_blank">Documentation on Theme Options</a>', 'twentyeleven' ) . '</p>' .
     135                '<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>', 'twentyeleven' ) . '</p>'
     136        );
     137}
    124138
    125139/**
Note: See TracChangeset for help on using the changeset viewer.