diff --git a/wp-content/themes/twentyeleven/inc/theme-options.php b/wp-content/themes/twentyeleven/inc/theme-options.php index 34e29f7a07..ae12764654 100644 --- a/wp-content/themes/twentyeleven/inc/theme-options.php +++ b/wp-content/themes/twentyeleven/inc/theme-options.php @@ -46,6 +46,26 @@ function twentyeleven_theme_options_init() { 'twentyeleven_theme_options', // Database option, see twentyeleven_get_theme_options() 'twentyeleven_theme_options_validate' // The sanitization callback, see twentyeleven_theme_options_validate() ); + + // Register our settings field group + add_settings_section( + 'general', // Unique identifier for the settings section + '', // Section title (we don't want one) + '__return_false', // Section callback (we don't want anything) + 'theme_options' // Menu slug, used to uniquely identify the page; see twentyeleven_theme_options_add_page() + ); + + // Register our individual settings fields + add_settings_field( + 'color_scheme', // Unique identifier for the field for this section + __( 'Color Scheme', 'twentyeleven' ), // Setting field label + 'twentyeleven_settings_field_color_scheme', // Function that renders the settings field + 'theme_options', // Menu slug, used to uniquely identify the page; see twentyeleven_theme_options_add_page() + 'general' // Settings section. Same as the first argument in the add_settings_section() above + ); + + add_settings_field( 'link_color', __( 'Link Color', 'twentyeleven' ), 'twentyeleven_settings_field_link_color', 'theme_options', 'general' ); + add_settings_field( 'layout', __( 'Layout', 'twentyeleven' ), 'twentyeleven_settings_field_layout', 'theme_options', 'general' ); } add_action( 'admin_init', 'twentyeleven_theme_options_init' ); @@ -201,6 +221,69 @@ function twentyeleven_get_theme_options() { return get_option( 'twentyeleven_theme_options', twentyeleven_get_default_theme_options() ); } +/** + * Renders the Color Scheme setting field. + * + * @since Twenty Eleven 1.2 + */ +function twentyeleven_settings_field_color_scheme() { + $options = twentyeleven_get_theme_options(); + + foreach ( twentyeleven_color_schemes() as $scheme ) { + ?> +
+ +
+ + + + + +
+ ' . twentyeleven_get_default_link_color( $options['color_scheme'] ) . '' ); ?> + +
+ +
+ - - - - - - - - - - - - - - -
-
- -
- -
- -
-
-
- - - - -
- ' . twentyeleven_get_default_link_color( $options['color_scheme'] ) . '' ); ?> -
-
-
- -
- -
- -
-
- -