<!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" />
<title>[17989] trunk: Code readability improvements.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { 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 #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#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>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/17989">17989</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2011-05-22 22:30:05 +0000 (Sun, 22 May 2011)</dd>
</dl>
<h3>Log Message</h3>
<pre>Code readability improvements. props niallkennedy, fixes <a href="http://trac.wordpress.org/ticket/17166">#17166</a>, <a href="http://trac.wordpress.org/ticket/17182">#17182</a>, <a href="http://trac.wordpress.org/ticket/17231">#17231</a>, <a href="http://trac.wordpress.org/ticket/16474">#16474</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesexportphp">trunk/wp-admin/includes/export.php</a></li>
<li><a href="#trunkwpincludesgeneraltemplatephp">trunk/wp-includes/general-template.php</a></li>
<li><a href="#trunkwpincludesthemephp">trunk/wp-includes/theme.php</a></li>
<li><a href="#trunkwpsignupphp">trunk/wp-signup.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesexportphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/export.php (17988 => 17989)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/export.php        2011-05-22 22:19:36 UTC (rev 17988)
+++ trunk/wp-admin/includes/export.php        2011-05-22 22:30:05 UTC (rev 17989)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx">         } else {
</span><span class="cx">                 $post_types = get_post_types( array( 'can_export' => true ) );
</span><span class="cx">                 $esses = array_fill( 0, count($post_types), '%s' );
</span><del>-                $where = $wpdb->prepare( "{$wpdb->posts}.post_type IN (". implode(',',$esses) .")", $post_types );
</del><ins>+                $where = $wpdb->prepare( "{$wpdb->posts}.post_type IN (" . implode( ',', $esses ) . ')', $post_types );
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         if ( $args['status'] && ( 'post' == $args['content'] || 'page' == $args['content'] ) )
</span><span class="lines">@@ -123,7 +123,7 @@
</span><span class="cx">                         $str = utf8_encode( $str );
</span><span class="cx">
</span><span class="cx">                 // $str = ent2ncr(esc_html($str));
</span><del>-                $str = "<![CDATA[$str" . ( ( substr( $str, -1 ) == ']' ) ? ' ' : '') . "]]>";
</del><ins>+                $str = "<![CDATA[$str" . ( ( substr( $str, -1 ) == ']' ) ? ' ' : '' ) . ']]>';
</ins><span class="cx">
</span><span class="cx">                 return $str;
</span><span class="cx">         }
</span><span class="lines">@@ -350,7 +350,7 @@
</span><span class="cx">
</span><span class="cx">         // fetch 20 posts at a time rather than loading the entire table into memory
</span><span class="cx">         while ( $next_posts = array_splice( $post_ids, 0, 20 ) ) {
</span><del>-        $where = "WHERE ID IN (" . join( ',', $next_posts ) . ")";
</del><ins>+        $where = 'WHERE ID IN (' . join( ',', $next_posts ) . ')';
</ins><span class="cx">         $posts = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} $where" );
</span><span class="cx">
</span><span class="cx">         // Begin Loop
</span></span></pre></div>
<a id="trunkwpincludesgeneraltemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/general-template.php (17988 => 17989)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/general-template.php        2011-05-22 22:19:36 UTC (rev 17988)
+++ trunk/wp-includes/general-template.php        2011-05-22 22:30:05 UTC (rev 17989)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx">         if ( isset($name) )
</span><span class="cx">                 $templates[] = "header-{$name}.php";
</span><span class="cx">
</span><del>-        $templates[] = "header.php";
</del><ins>+        $templates[] = 'header.php';
</ins><span class="cx">
</span><span class="cx">         // Backward compat code will be removed in a future release
</span><span class="cx">         if ('' == locate_template($templates, true))
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx">         if ( isset($name) )
</span><span class="cx">                 $templates[] = "footer-{$name}.php";
</span><span class="cx">
</span><del>-        $templates[] = "footer.php";
</del><ins>+        $templates[] = 'footer.php';
</ins><span class="cx">
</span><span class="cx">         // Backward compat code will be removed in a future release
</span><span class="cx">         if ('' == locate_template($templates, true))
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx">         if ( isset($name) )
</span><span class="cx">                 $templates[] = "sidebar-{$name}.php";
</span><span class="cx">
</span><del>-        $templates[] = "sidebar.php";
</del><ins>+        $templates[] = 'sidebar.php';
</ins><span class="cx">
</span><span class="cx">         // Backward compat code will be removed in a future release
</span><span class="cx">         if ('' == locate_template($templates, true))
</span><span class="lines">@@ -569,7 +569,7 @@
</span><span class="cx">                 $my_year = substr($m, 0, 4);
</span><span class="cx">                 $my_month = $wp_locale->get_month(substr($m, 4, 2));
</span><span class="cx">                 $my_day = intval(substr($m, 6, 2));
</span><del>-                $title = $my_year . ($my_month ? $t_sep . $my_month : "") . ($my_day ? $t_sep . $my_day : "");
</del><ins>+                $title = $my_year . ( $my_month ? $t_sep . $my_month : '' ) . ( $my_day ? $t_sep . $my_day : '' );
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         // If there's a year
</span><span class="lines">@@ -843,7 +843,7 @@
</span><span class="cx">         else // custom
</span><span class="cx">                 $link_html = "\t$before<a href='$url' title='$title_text'>$text</a>$after\n";
</span><span class="cx">
</span><del>-        $link_html = apply_filters( "get_archives_link", $link_html );
</del><ins>+        $link_html = apply_filters( 'get_archives_link', $link_html );
</ins><span class="cx">
</span><span class="cx">         return $link_html;
</span><span class="cx"> }
</span><span class="lines">@@ -915,8 +915,8 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         //filters
</span><del>-        $where = apply_filters('getarchives_where', "WHERE post_type = 'post' AND post_status = 'publish'", $r );
-        $join = apply_filters('getarchives_join', "", $r);
</del><ins>+        $where = apply_filters( 'getarchives_where', "WHERE post_type = 'post' AND post_status = 'publish'", $r );
+        $join = apply_filters( 'getarchives_join', '', $r );
</ins><span class="cx">
</span><span class="cx">         $output = '';
</span><span class="cx">
</span><span class="lines">@@ -1016,7 +1016,7 @@
</span><span class="cx">                                 }
</span><span class="cx">                 }
</span><span class="cx">         } elseif ( ( 'postbypost' == $type ) || ('alpha' == $type) ) {
</span><del>-                $orderby = ('alpha' == $type) ? "post_title ASC " : "post_date DESC ";
</del><ins>+                $orderby = ('alpha' == $type) ? 'post_title ASC ' : 'post_date DESC ';
</ins><span class="cx">                 $query = "SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit";
</span><span class="cx">                 $key = md5($query);
</span><span class="cx">                 $cache = wp_cache_get( 'wp_get_archives' , 'general');
</span><span class="lines">@@ -1248,7 +1248,7 @@
</span><span class="cx">                         $calendar_output .= '<td>';
</span><span class="cx">
</span><span class="cx">                 if ( in_array($day, $daywithpost) ) // any posts today?
</span><del>-                                $calendar_output .= '<a href="' . get_day_link($thisyear, $thismonth, $day) . "\" title=\"" . esc_attr($ak_titles_for_day[$day]) . "\">$day</a>";
</del><ins>+                                $calendar_output .= '<a href="' . get_day_link( $thisyear, $thismonth, $day ) . '" title="' . esc_attr( $ak_titles_for_day[ $day ] ) . "\">$day</a>";
</ins><span class="cx">                 else
</span><span class="cx">                         $calendar_output .= $day;
</span><span class="cx">                 $calendar_output .= '</td>';
</span><span class="lines">@@ -1997,7 +1997,7 @@
</span><span class="cx">                 if ( $add_args )
</span><span class="cx">                         $link = add_query_arg( $add_args, $link );
</span><span class="cx">                 $link .= $add_fragment;
</span><del>-                $page_links[] = "<a class='prev page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>$prev_text</a>";
</del><ins>+                $page_links[] = '<a class="prev page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $prev_text . '</a>';
</ins><span class="cx">         endif;
</span><span class="cx">         for ( $n = 1; $n <= $total; $n++ ) :
</span><span class="cx">                 $n_display = number_format_i18n($n);
</span><span class="lines">@@ -2014,7 +2014,7 @@
</span><span class="cx">                                 $page_links[] = "<a class='page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>$n_display</a>";
</span><span class="cx">                                 $dots = true;
</span><span class="cx">                         elseif ( $dots && !$show_all ) :
</span><del>-                                $page_links[] = "<span class='page-numbers dots'>...</span>";
</del><ins>+                                $page_links[] = '<span class="page-numbers dots">...</span>';
</ins><span class="cx">                                 $dots = false;
</span><span class="cx">                         endif;
</span><span class="cx">                 endif;
</span><span class="lines">@@ -2025,7 +2025,7 @@
</span><span class="cx">                 if ( $add_args )
</span><span class="cx">                         $link = add_query_arg( $add_args, $link );
</span><span class="cx">                 $link .= $add_fragment;
</span><del>-                $page_links[] = "<a class='next page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>$next_text</a>";
</del><ins>+                $page_links[] = '<a class="next page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $next_text . '</a>';
</ins><span class="cx">         endif;
</span><span class="cx">         switch ( $type ) :
</span><span class="cx">                 case 'array' :
</span></span></pre></div>
<a id="trunkwpincludesthemephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/theme.php (17988 => 17989)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/theme.php        2011-05-22 22:19:36 UTC (rev 17988)
+++ trunk/wp-includes/theme.php        2011-05-22 22:30:05 UTC (rev 17989)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx"> */
</span><span class="cx"> function get_stylesheet_uri() {
</span><span class="cx">         $stylesheet_dir_uri = get_stylesheet_directory_uri();
</span><del>-        $stylesheet_uri = $stylesheet_dir_uri . "/style.css";
</del><ins>+        $stylesheet_uri = $stylesheet_dir_uri . '/style.css';
</ins><span class="cx">         return apply_filters('stylesheet_uri', $stylesheet_uri, $stylesheet_dir_uri);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -827,7 +827,7 @@
</span><span class="cx">
</span><span class="cx">         $templates[] = "category-{$category->slug}.php";
</span><span class="cx">         $templates[] = "category-{$category->term_id}.php";
</span><del>-        $templates[] = "category.php";
</del><ins>+        $templates[] = 'category.php';
</ins><span class="cx">
</span><span class="cx">         return get_query_template( 'category', $templates );
</span><span class="cx"> }
</span><span class="lines">@@ -851,7 +851,7 @@
</span><span class="cx">
</span><span class="cx">         $templates[] = "tag-{$tag->slug}.php";
</span><span class="cx">         $templates[] = "tag-{$tag->term_id}.php";
</span><del>-        $templates[] = "tag.php";
</del><ins>+        $templates[] = 'tag.php';
</ins><span class="cx">
</span><span class="cx">         return get_query_template( 'tag', $templates );
</span><span class="cx"> }
</span><span class="lines">@@ -881,7 +881,7 @@
</span><span class="cx">
</span><span class="cx">         $templates[] = "taxonomy-$taxonomy-{$term->slug}.php";
</span><span class="cx">         $templates[] = "taxonomy-$taxonomy.php";
</span><del>-        $templates[] = "taxonomy.php";
</del><ins>+        $templates[] = 'taxonomy.php';
</ins><span class="cx">
</span><span class="cx">         return get_query_template( 'taxonomy', $templates );
</span><span class="cx"> }
</span><span class="lines">@@ -963,7 +963,7 @@
</span><span class="cx">                 $templates[] = "page-$pagename.php";
</span><span class="cx">         if ( $id )
</span><span class="cx">                 $templates[] = "page-$id.php";
</span><del>-        $templates[] = "page.php";
</del><ins>+        $templates[] = 'page.php';
</ins><span class="cx">
</span><span class="cx">         return get_query_template( 'page', $templates );
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkwpsignupphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-signup.php (17988 => 17989)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-signup.php        2011-05-22 22:19:36 UTC (rev 17988)
+++ trunk/wp-signup.php        2011-05-22 22:30:05 UTC (rev 17989)
</span><span class="lines">@@ -13,7 +13,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function do_signup_header() {
</span><del>-        do_action("signup_header");
</del><ins>+        do_action( 'signup_header' );
</ins><span class="cx"> }
</span><span class="cx"> add_action( 'wp_head', 'do_signup_header' );
</span><span class="cx">
</span><span class="lines">@@ -188,7 +188,7 @@
</span><span class="cx">         <p><?php _e( 'If you&#8217;re not going to use a great site domain, leave it for a new user. Now have at it!' ) ?></p>
</span><span class="cx">         <form id="setupform" method="post" action="wp-signup.php">
</span><span class="cx">                 <input type="hidden" name="stage" value="gimmeanotherblog" />
</span><del>-                <?php do_action( "signup_hidden_fields" ); ?>
</del><ins>+                <?php do_action( 'signup_hidden_fields' ); ?>
</ins><span class="cx">                 <?php show_blog_form($blogname, $blog_title, $errors); ?>
</span><span class="cx">                 <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Create Site' ) ?>" /></p>
</span><span class="cx">         </form>
</span><span class="lines">@@ -252,7 +252,7 @@
</span><span class="cx">         <h2><?php printf( __( 'Get your own %s account in seconds' ), $current_site->site_name ) ?></h2>
</span><span class="cx">         <form id="setupform" method="post" action="wp-signup.php">
</span><span class="cx">                 <input type="hidden" name="stage" value="validate-user-signup" />
</span><del>-                <?php do_action( "signup_hidden_fields" ); ?>
</del><ins>+                <?php do_action( 'signup_hidden_fields' ); ?>
</ins><span class="cx">                 <?php show_user_form($user_name, $user_email, $errors); ?>
</span><span class="cx">
</span><span class="cx">                 <p>
</span><span class="lines">@@ -288,7 +288,7 @@
</span><span class="cx">                 return false;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        wpmu_signup_user($user_name, $user_email, apply_filters( "add_signup_meta", array() ) );
</del><ins>+        wpmu_signup_user($user_name, $user_email, apply_filters( 'add_signup_meta', array() ) );
</ins><span class="cx">
</span><span class="cx">         confirm_user_signup($user_name, $user_email);
</span><span class="cx">         return true;
</span><span class="lines">@@ -323,7 +323,7 @@
</span><span class="cx">                 <input type="hidden" name="stage" value="validate-blog-signup" />
</span><span class="cx">                 <input type="hidden" name="user_name" value="<?php echo esc_attr($user_name) ?>" />
</span><span class="cx">                 <input type="hidden" name="user_email" value="<?php echo esc_attr($user_email) ?>" />
</span><del>-                <?php do_action( "signup_hidden_fields" ); ?>
</del><ins>+                <?php do_action( 'signup_hidden_fields' ); ?>
</ins><span class="cx">                 <?php show_blog_form($blogname, $blog_title, $errors); ?>
</span><span class="cx">                 <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e('Signup') ?>" /></p>
</span><span class="cx">         </form>
</span><span class="lines">@@ -350,7 +350,7 @@
</span><span class="cx">
</span><span class="cx">         $public = (int) $_POST['blog_public'];
</span><span class="cx">         $meta = array ('lang_id' => 1, 'public' => $public);
</span><del>-        $meta = apply_filters( "add_signup_meta", $meta );
</del><ins>+        $meta = apply_filters( 'add_signup_meta', $meta );
</ins><span class="cx">
</span><span class="cx">         wpmu_signup_blog($domain, $path, $blog_title, $user_name, $user_email, $meta);
</span><span class="cx">         confirm_blog_signup($domain, $path, $blog_title, $user_name, $user_email, $meta);
</span><span class="lines">@@ -396,7 +396,7 @@
</span><span class="cx"> $newblogname = isset($_GET['new']) ? strtolower(preg_replace('/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['new'])) : null;
</span><span class="cx">
</span><span class="cx"> $current_user = wp_get_current_user();
</span><del>-if ( $active_signup == "none" ) {
</del><ins>+if ( $active_signup == 'none' ) {
</ins><span class="cx">         _e( 'Registration has been disabled.' );
</span><span class="cx"> } elseif ( $active_signup == 'blog' && !is_user_logged_in() ) {
</span><span class="cx">         if ( is_ssl() )
</span><span class="lines">@@ -426,7 +426,7 @@
</span><span class="cx">                 case 'default':
</span><span class="cx">                 default :
</span><span class="cx">                         $user_email = isset( $_POST[ 'user_email' ] ) ? $_POST[ 'user_email' ] : '';
</span><del>-                        do_action( "preprocess_signup_form" ); // populate the form from invites, elsewhere?
</del><ins>+                        do_action( 'preprocess_signup_form' ); // populate the form from invites, elsewhere?
</ins><span class="cx">                         if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) )
</span><span class="cx">                                 signup_another_blog($newblogname);
</span><span class="cx">                         elseif ( is_user_logged_in() == false && ( $active_signup == 'all' || $active_signup == 'user' ) )
</span></span></pre>
</div>
</div>
</body>
</html>