WordPress.org

Make WordPress Core

Changeset 17740


Ignore:
Timestamp:
04/28/2011 11:05:53 AM (9 years ago)
Author:
nacin
Message:

Rename twentyeleven_color_schemes hook to twentyeleven_enqueue_color_scheme, so its purpose is clear. Also rename twentyeleven_color_styles() to twentyeleven_enqueue_color_scheme(), and twentyeleven_link_color() (which sounds like a getter) to twentyeleven_print_link_color_style(). Some tidying in twentyeleven_layout_classes(). see #17198.

File:
1 edited

Legend:

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

    r17737 r17740  
    261261 * @since Twenty Eleven 1.0
    262262 */
    263 function twentyeleven_color_styles() {
     263function twentyeleven_enqueue_color_scheme() {
    264264    $options = twentyeleven_get_theme_options();
    265265    $color_scheme = $options['color_scheme'];
    266266
    267267    if ( 'dark' == $color_scheme )
    268         wp_enqueue_style( 'dark', get_template_directory_uri() . '/colors/dark.css', null, null );
    269 
    270     do_action( 'twentyeleven_color_schemes', $color_scheme );
    271 }
    272 add_action( 'wp_enqueue_scripts', 'twentyeleven_color_styles' );
     268        wp_enqueue_style( 'dark', get_template_directory_uri() . '/colors/dark.css', array(), null );
     269
     270    do_action( 'twentyeleven_enqueue_color_scheme', $color_scheme );
     271}
     272add_action( 'wp_enqueue_scripts', 'twentyeleven_enqueue_color_scheme' );
    273273
    274274/**
     
    279279 * @since Twenty Eleven 1.0
    280280 */
    281 function twentyeleven_link_color() {
     281function twentyeleven_print_link_color_style() {
    282282    $options = twentyeleven_get_theme_options();
    283283    $link_color = $options['link_color'];
     
    298298<?php
    299299}
    300 add_action( 'wp_head', 'twentyeleven_link_color' );
     300add_action( 'wp_head', 'twentyeleven_print_link_color_style' );
    301301
    302302/**
     
    305305 * @since Twenty Eleven 1.0
    306306 */
    307 function twentyeleven_layout_classes( $classes ) {
     307function twentyeleven_layout_classes( $existing_classes ) {
    308308    $options = twentyeleven_get_theme_options();
    309309    $current_layout = $options['theme_layout'];
    310310
    311     $twentyeleven_classes = array();
    312 
    313     $two_column_layouts = array( 'content-sidebar', 'sidebar-content' );
    314 
    315     if ( in_array( $current_layout, $two_column_layouts ) )
    316         $twentyeleven_classes[] = 'two-column';
     311    if ( in_array( $current_layout, array( 'content-sidebar', 'sidebar-content' ) ) )
     312        $classes = array( 'two-column' );
    317313    else
    318         $twentyeleven_classes[] = 'one-column';
    319 
    320     $twentyeleven_classes[] = $current_layout;
    321 
    322     $twentyeleven_classes = apply_filters( 'twentyeleven_layout_classes', $twentyeleven_classes, $current_layout );
    323 
    324     return array_merge( $classes, $twentyeleven_classes );
     314        $classes = array( 'one-column' );
     315
     316    $classes[] = $current_layout;
     317
     318    $classes = apply_filters( 'twentyeleven_layout_classes', $classes, $current_layout );
     319
     320    return array_merge( $existing_classes, $classes );
    325321}
    326322add_filter( 'body_class', 'twentyeleven_layout_classes' );
Note: See TracChangeset for help on using the changeset viewer.