Contextual help back compat for twentyeleven. Props nacin.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
02a1dd7ccb
commit
f70f569825
|
@ -112,28 +112,35 @@ function twentyeleven_theme_options_add_page() {
|
||||||
add_action( 'admin_menu', 'twentyeleven_theme_options_add_page' );
|
add_action( 'admin_menu', 'twentyeleven_theme_options_add_page' );
|
||||||
|
|
||||||
function twentyeleven_theme_options_help() {
|
function twentyeleven_theme_options_help() {
|
||||||
if ( ! method_exists( get_current_screen(), 'add_help_tab' ) )
|
|
||||||
return;
|
|
||||||
|
|
||||||
get_current_screen()->add_help_tab( array(
|
$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>' .
|
||||||
'title' => __( 'Overview', 'twentyeleven' ),
|
|
||||||
'id' => 'theme-options-help',
|
|
||||||
'content' =>
|
|
||||||
'<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>' .
|
|
||||||
'<ol>' .
|
'<ol>' .
|
||||||
'<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>' .
|
'<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>' .
|
||||||
'<li>' . __( '<strong>Link Color</strong>: You can choose the color used for text links on your site. You can enter the HTML color or hex code, or you can choose visually by clicking the "Select a Color" button to pick from a color wheel.', 'twentyeleven' ) . '</li>' .
|
'<li>' . __( '<strong>Link Color</strong>: You can choose the color used for text links on your site. You can enter the HTML color or hex code, or you can choose visually by clicking the "Select a Color" button to pick from a color wheel.', 'twentyeleven' ) . '</li>' .
|
||||||
'<li>' . __( '<strong>Default Layout</strong>: You can choose if you want your site’s default layout to have a sidebar on the left, the right, or not at all.', 'twentyeleven' ) . '</li>' .
|
'<li>' . __( '<strong>Default Layout</strong>: You can choose if you want your site’s default layout to have a sidebar on the left, the right, or not at all.', 'twentyeleven' ) . '</li>' .
|
||||||
'</ol>' .
|
'</ol>' .
|
||||||
'<p>' . __( 'Remember to click "Save Changes" to save any changes you have made to the theme options.', 'twentyeleven' ) . '</p>'
|
'<p>' . __( 'Remember to click "Save Changes" to save any changes you have made to the theme options.', 'twentyeleven' ) . '</p>';
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
get_current_screen()->set_help_sidebar(
|
$sidebar = '<p><strong>' . __( 'For more information:', 'twentyeleven' ) . '</strong></p>' .
|
||||||
'<p><strong>' . __( 'For more information:', 'twentyeleven' ) . '</strong></p>' .
|
|
||||||
'<p>' . __( '<a href="http://codex.wordpress.org/Appearance_Theme_Options_Screen" target="_blank">Documentation on Theme Options</a>', 'twentyeleven' ) . '</p>' .
|
'<p>' . __( '<a href="http://codex.wordpress.org/Appearance_Theme_Options_Screen" target="_blank">Documentation on Theme Options</a>', 'twentyeleven' ) . '</p>' .
|
||||||
'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>', 'twentyeleven' ) . '</p>'
|
'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>', 'twentyeleven' ) . '</p>';
|
||||||
);
|
|
||||||
|
$screen = get_current_screen();
|
||||||
|
|
||||||
|
if ( method_exists( $screen, 'add_help_tab' ) ) {
|
||||||
|
// WordPress 3.3
|
||||||
|
$screen->add_help_tab( array(
|
||||||
|
'title' => __( 'Overview', 'twentyeleven' ),
|
||||||
|
'id' => 'theme-options-help',
|
||||||
|
'content' => $help,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$screen->set_help_sidebar( $sidebar );
|
||||||
|
} else {
|
||||||
|
// WordPress 3.2
|
||||||
|
add_contextual_help( $screen, $help . $sidebar );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue