' . __( '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' ) . '
' . '' . __( 'Remember to click "Save Changes" to save any changes you have made to the theme options.', 'twentyeleven' ) . '
'; $sidebar = '' . __( 'For more information:', 'twentyeleven' ) . '
' . '' . __( 'Documentation on Theme Customization', 'twentyeleven' ) . '
' . '' . __( 'Support forums', 'twentyeleven' ) . '
'; $screen = get_current_screen(); if ( method_exists( $screen, 'add_help_tab' ) ) { // WordPress 3.3.0. $screen->add_help_tab( array( 'title' => __( 'Overview', 'twentyeleven' ), 'id' => 'theme-options-help', 'content' => $help, ) ); $screen->set_help_sidebar( $sidebar ); } else { // WordPress 3.2.0. add_contextual_help( $screen, $help . $sidebar ); } } /** * Return an array of color schemes registered for Twenty Eleven. * * @since Twenty Eleven 1.0 */ function twentyeleven_color_schemes() { $color_scheme_options = array( 'light' => array( 'value' => 'light', 'label' => __( 'Light', 'twentyeleven' ), 'thumbnail' => get_template_directory_uri() . '/inc/images/light.png', 'default_link_color' => '#1b8be0', ), 'dark' => array( 'value' => 'dark', 'label' => __( 'Dark', 'twentyeleven' ), 'thumbnail' => get_template_directory_uri() . '/inc/images/dark.png', 'default_link_color' => '#e4741f', ), ); /** * Filters the Twenty Eleven color scheme options. * * @since Twenty Eleven 1.0 * * @param array $color_scheme_options An associative array of color scheme options. */ return apply_filters( 'twentyeleven_color_schemes', $color_scheme_options ); } /** * Return an array of layout options registered for Twenty Eleven. * * @since Twenty Eleven 1.0 */ function twentyeleven_layouts() { $layout_options = array( 'content-sidebar' => array( 'value' => 'content-sidebar', 'label' => __( 'Content on left', 'twentyeleven' ), 'thumbnail' => get_template_directory_uri() . '/inc/images/content-sidebar.png', ), 'sidebar-content' => array( 'value' => 'sidebar-content', 'label' => __( 'Content on right', 'twentyeleven' ), 'thumbnail' => get_template_directory_uri() . '/inc/images/sidebar-content.png', ), 'content' => array( 'value' => 'content', 'label' => __( 'One-column, no sidebar', 'twentyeleven' ), 'thumbnail' => get_template_directory_uri() . '/inc/images/content.png', ), ); /** * Filters the Twenty Eleven layout options. * * @since Twenty Eleven 1.0 * * @param array $layout_options An associative array of layout options. */ return apply_filters( 'twentyeleven_layouts', $layout_options ); } /** * Return the default options for Twenty Eleven. * * @since Twenty Eleven 1.0 * * @return array An array of default theme options. */ function twentyeleven_get_default_theme_options() { $default_theme_options = array( 'color_scheme' => 'light', 'link_color' => twentyeleven_get_default_link_color( 'light' ), 'theme_layout' => 'content-sidebar', ); if ( is_rtl() ) { $default_theme_options['theme_layout'] = 'sidebar-content'; } /** * Filters the Twenty Eleven default options. * * @since Twenty Eleven 1.0 * * @param array $default_theme_options An array of default theme options. */ return apply_filters( 'twentyeleven_default_theme_options', $default_theme_options ); } /** * Return the default link color for Twenty Eleven, based on color scheme. * * @since Twenty Eleven 1.0 * * @param string $color_scheme Optional. Color scheme. * Default null (or the active color scheme). * @return string The default link color. */ function twentyeleven_get_default_link_color( $color_scheme = null ) { if ( null === $color_scheme ) { $options = twentyeleven_get_theme_options(); $color_scheme = $options['color_scheme']; } $color_schemes = twentyeleven_color_schemes(); if ( ! isset( $color_schemes[ $color_scheme ] ) ) { return false; } return $color_schemes[ $color_scheme ]['default_link_color']; } /** * Return the options array for Twenty Eleven. * * @since Twenty Eleven 1.0 */ function twentyeleven_get_theme_options() { return get_option( 'twentyeleven_theme_options', twentyeleven_get_default_theme_options() ); } /** * Render the Color Scheme setting field. * * @since Twenty Eleven 1.3 */ function twentyeleven_settings_field_color_scheme() { $options = twentyeleven_get_theme_options(); foreach ( twentyeleven_color_schemes() as $scheme ) { ?>