<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[17740] trunk/wp-content/themes/twentyeleven/inc/theme-options.php:
Rename twentyeleven_color_schemes hook to twentyeleven_enqueue_color_scheme
, so its purpose is clear.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/17740">17740</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2011-04-28 11:05:53 +0000 (Thu, 28 Apr 2011)</dd>
</dl>
<h3>Log Message</h3>
<pre>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 <a href="http://trac.wordpress.org/ticket/17198">#17198</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpcontentthemestwentyelevenincthemeoptionsphp">trunk/wp-content/themes/twentyeleven/inc/theme-options.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpcontentthemestwentyelevenincthemeoptionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-content/themes/twentyeleven/inc/theme-options.php (17739 => 17740)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-content/themes/twentyeleven/inc/theme-options.php        2011-04-28 10:13:38 UTC (rev 17739)
+++ trunk/wp-content/themes/twentyeleven/inc/theme-options.php        2011-04-28 11:05:53 UTC (rev 17740)
</span><span class="lines">@@ -260,16 +260,16 @@
</span><span class="cx"> *
</span><span class="cx"> * @since Twenty Eleven 1.0
</span><span class="cx"> */
</span><del>-function twentyeleven_color_styles() {
</del><ins>+function twentyeleven_enqueue_color_scheme() {
</ins><span class="cx">         $options = twentyeleven_get_theme_options();
</span><span class="cx">         $color_scheme = $options['color_scheme'];
</span><span class="cx">
</span><span class="cx">         if ( 'dark' == $color_scheme )
</span><del>-                wp_enqueue_style( 'dark', get_template_directory_uri() . '/colors/dark.css', null, null );
</del><ins>+                wp_enqueue_style( 'dark', get_template_directory_uri() . '/colors/dark.css', array(), null );
</ins><span class="cx">
</span><del>-        do_action( 'twentyeleven_color_schemes', $color_scheme );
</del><ins>+        do_action( 'twentyeleven_enqueue_color_scheme', $color_scheme );
</ins><span class="cx"> }
</span><del>-add_action( 'wp_enqueue_scripts', 'twentyeleven_color_styles' );
</del><ins>+add_action( 'wp_enqueue_scripts', 'twentyeleven_enqueue_color_scheme' );
</ins><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * Add a style block to the theme for the current link color.
</span><span class="lines">@@ -278,7 +278,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @since Twenty Eleven 1.0
</span><span class="cx"> */
</span><del>-function twentyeleven_link_color() {
</del><ins>+function twentyeleven_print_link_color_style() {
</ins><span class="cx">         $options = twentyeleven_get_theme_options();
</span><span class="cx">         $link_color = $options['link_color'];
</span><span class="cx">
</span><span class="lines">@@ -297,30 +297,26 @@
</span><span class="cx">         </style>
</span><span class="cx"> <?php
</span><span class="cx"> }
</span><del>-add_action( 'wp_head', 'twentyeleven_link_color' );
</del><ins>+add_action( 'wp_head', 'twentyeleven_print_link_color_style' );
</ins><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * Adds Twenty Eleven layout classes to the array of body classes.
</span><span class="cx"> *
</span><span class="cx"> * @since Twenty Eleven 1.0
</span><span class="cx"> */
</span><del>-function twentyeleven_layout_classes( $classes ) {
</del><ins>+function twentyeleven_layout_classes( $existing_classes ) {
</ins><span class="cx">         $options = twentyeleven_get_theme_options();
</span><span class="cx">         $current_layout = $options['theme_layout'];
</span><span class="cx">
</span><del>-        $twentyeleven_classes = array();
-
-        $two_column_layouts = array( 'content-sidebar', 'sidebar-content' );
-
-        if ( in_array( $current_layout, $two_column_layouts ) )
-                $twentyeleven_classes[] = 'two-column';
</del><ins>+        if ( in_array( $current_layout, array( 'content-sidebar', 'sidebar-content' ) ) )
+                $classes = array( 'two-column' );
</ins><span class="cx">         else
</span><del>-                $twentyeleven_classes[] = 'one-column';
</del><ins>+                $classes = array( 'one-column' );
</ins><span class="cx">
</span><del>-        $twentyeleven_classes[] = $current_layout;
</del><ins>+        $classes[] = $current_layout;
</ins><span class="cx">
</span><del>-        $twentyeleven_classes = apply_filters( 'twentyeleven_layout_classes', $twentyeleven_classes, $current_layout );
</del><ins>+        $classes = apply_filters( 'twentyeleven_layout_classes', $classes, $current_layout );
</ins><span class="cx">
</span><del>-        return array_merge( $classes, $twentyeleven_classes );
</del><ins>+        return array_merge( $existing_classes, $classes );
</ins><span class="cx"> }
</span><span class="cx"> add_filter( 'body_class', 'twentyeleven_layout_classes' );
</span><span class="cx">\ No newline at end of file
</span></span></pre>
</div>
</div>
</body>
</html>