<!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>[13147] trunk/wp-content/themes/twentyten:
Replace $authordata usage with API, Restore "Also posted in.."/"
Also tagged..." on taxonomy archives,
Handle Excerpts for Asides correctly on Archives.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13147">13147</a></dd>
<dt>Author</dt> <dd>dd32</dd>
<dt>Date</dt> <dd>2010-02-14 10:02:38 +0000 (Sun, 14 Feb 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Replace $authordata usage with API, Restore "Also posted in.."/"Also tagged..." on taxonomy archives, Handle Excerpts for Asides correctly on Archives. See <a href="http://trac.wordpress.org/ticket/9015">#9015</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpcontentthemestwentytenattachmentphp">trunk/wp-content/themes/twentyten/attachment.php</a></li>
<li><a href="#trunkwpcontentthemestwentytenauthorphp">trunk/wp-content/themes/twentyten/author.php</a></li>
<li><a href="#trunkwpcontentthemestwentytenfunctionsphp">trunk/wp-content/themes/twentyten/functions.php</a></li>
<li><a href="#trunkwpcontentthemestwentytenloopphp">trunk/wp-content/themes/twentyten/loop.php</a></li>
<li><a href="#trunkwpcontentthemestwentytensinglephp">trunk/wp-content/themes/twentyten/single.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpcontentthemestwentytenattachmentphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-content/themes/twentyten/attachment.php (13146 => 13147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-content/themes/twentyten/attachment.php        2010-02-14 09:32:23 UTC (rev 13146)
+++ trunk/wp-content/themes/twentyten/attachment.php        2010-02-14 10:02:38 UTC (rev 13147)
</span><span class="lines">@@ -12,7 +12,7 @@
</span><span class="cx">
</span><span class="cx">                                         <div class="entry-meta">
</span><span class="cx">                                                 <span class="meta-prep meta-prep-author"><?php _e( 'By ', 'twentyten' ); ?></span>
</span><del>-                                                <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( $authordata->ID, $authordata->user_nicename ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), $authordata->display_name ); ?>"><?php the_author(); ?></a></span>
</del><ins>+                                                <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( get_the_author_meta('ID') ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), $authordata->display_name ); ?>"><?php the_author(); ?></a></span>
</ins><span class="cx">                                                 <span class="meta-sep"><?php _e( ' | ', 'twentyten' ); ?></span>
</span><span class="cx">                                                 <span class="meta-prep meta-prep-entry-date"><?php _e( 'Published ', 'twentyten' ); ?></span>
</span><span class="cx">                                                 <span class="entry-date"><abbr class="published" title="<?php the_time() ?>"><?php echo get_the_date(); ?></abbr></span>
</span></span></pre></div>
<a id="trunkwpcontentthemestwentytenauthorphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-content/themes/twentyten/author.php (13146 => 13147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-content/themes/twentyten/author.php        2010-02-14 09:32:23 UTC (rev 13146)
+++ trunk/wp-content/themes/twentyten/author.php        2010-02-14 10:02:38 UTC (rev 13147)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx">
</span><span class="cx"> <?php the_post(); ?>
</span><span class="cx">
</span><del>-                                <h1 class="page-title author"><?php printf( __( 'Author Archives: <span class="vcard">%s</span>', 'twentyten' ), "<a class='url fn n' href='$authordata->user_url' title='" . esc_attr(get_the_author()) . "' rel='me'>" . get_the_author() . "</a>" ); ?></h1>
</del><ins>+                                <h1 class="page-title author"><?php printf( __( 'Author Archives: <span class="vcard">%s</span>', 'twentyten' ), "<a class='url fn n' href='" . get_author_posts_url( get_the_author_meta('ID') ) . "' title='" . esc_attr(get_the_author()) . "' rel='me'>" . get_the_author() . "</a>" ); ?></h1>
</ins><span class="cx">
</span><span class="cx"> <?php if ( get_the_author_meta('description') ) : // If a user has filled out their decscription show a bio on their entries ?>
</span><span class="cx">                                         <div id="entry-author-info">
</span></span></pre></div>
<a id="trunkwpcontentthemestwentytenfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-content/themes/twentyten/functions.php (13146 => 13147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-content/themes/twentyten/functions.php        2010-02-14 09:32:23 UTC (rev 13146)
+++ trunk/wp-content/themes/twentyten/functions.php        2010-02-14 10:02:38 UTC (rev 13147)
</span><span class="lines">@@ -118,42 +118,38 @@
</span><span class="cx"> }
</span><span class="cx"> add_filter( 'gallery_style', 'twentyten_remove_gallery_css' );
</span><span class="cx">
</span><del>-
-// For category lists on category archives: Returns other categories except the current one (redundant)
-function cats_meow( $glue ) {
-        $current_cat = single_cat_title( '', false );
-        $separator = "\n";
-        $cats = explode( $separator, get_the_category_list($separator) );
-        foreach ( $cats as $i => $str ) {
-                if ( strstr( $str, ">$current_cat<" ) ) {
-                        unset( $cats[$i] );
-                        break;
</del><ins>+function twentyten_cat_list() {
+        return twentyten_term_list('category', ', ', __('Posted in %s', 'twentyten'), __('Also posted in %s', 'twentyten') );
+}
+function twentyten_tag_list() {
+        return twentyten_term_list('post_tag', ', ', __('Tagged %s', 'twentyten'), __('Also tagged %s', 'twentyten') );
+}
+function twentyten_term_list($taxonomy, $glue = ', ', $text = '', $also_text = '') {
+        global $wp_query, $post;
+        $current_term = $wp_query->queried_object;
+        $terms = wp_get_object_terms($post->ID, $taxonomy);
+        // If we're viewing a Taxonomy page..
+        if ( isset($current_term->taxonomy) && $taxonomy == $current_term->taxonomy ) {
+                // Remove the term from display.
+                foreach ( (array)$terms as $key => $term ) {
+                        if ( $term->term_id == $current_term->term_id ) {
+                                unset($terms[$key]);
+                                break;
+                        }
</ins><span class="cx">                 }
</span><ins>+                // Change to Also text as we've now removed something from the terms list.
+                $text = $also_text;
</ins><span class="cx">         }
</span><del>-        if ( empty($cats) )
-                return false;
-
-        return trim( join( $glue, $cats ) );
-} // end cats_meow
-
-
-// For tag lists on tag archives: Returns other tags except the current one (redundant)
-function tag_ur_it( $glue ) {
-        $current_tag = single_tag_title( '', '', false );
-        $separator = "\n";
-        $tags = explode( $separator, get_the_tag_list( "", "$separator", "" ) );
-        foreach ( $tags as $i => $str ) {
-                if ( strstr( $str, ">$current_tag<" ) ) {
-                        unset( $tags[$i] );
-                        break;
-                }
</del><ins>+        $tlist = array();
+        $rel = 'category' == $taxonomy ? 'rel="category"' : 'rel="tag"';
+        foreach ( (array)$terms as $term ) {
+                $tlist[] = '<a href="' . get_term_link( $term, $taxonomy ) . '" title="' . esc_attr( sprintf( __( 'View all posts in %s', 'twentyten' ), $term->name ) ) . '" ' . $rel . '>' . $term->name . '</a>';
</ins><span class="cx">         }
</span><del>-        if ( empty($tags) )
-                return false;
</del><ins>+        if ( !empty($tlist) )
+                return sprintf($text, join($glue, $tlist));
+        return '';
+}
</ins><span class="cx">
</span><del>-        return trim( join( $glue, $tags ) );
-} // end tag_ur_it
-
</del><span class="cx"> // Register widgetized areas
</span><span class="cx"> function twentyten_widgets_init() {
</span><span class="cx">         // Area 1
</span></span></pre></div>
<a id="trunkwpcontentthemestwentytenloopphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-content/themes/twentyten/loop.php (13146 => 13147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-content/themes/twentyten/loop.php        2010-02-14 09:32:23 UTC (rev 13146)
+++ trunk/wp-content/themes/twentyten/loop.php        2010-02-14 10:02:38 UTC (rev 13147)
</span><span class="lines">@@ -14,7 +14,7 @@
</span><span class="cx">                         <span class="meta-prep meta-prep-author"><?php _e( 'Posted on ', 'twentyten' ); ?></span>
</span><span class="cx">                         <a href="<?php the_permalink(); ?>" title="<?php the_time(); ?>" rel="bookmark"><span class="entry-date"><?php echo get_the_date(); ?></span></a>
</span><span class="cx">                         <span class="meta-sep"> <?php _e( 'by ', 'twentyten' ); ?> </span>
</span><del>-                        <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( $authordata->ID ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php the_author(); ?></a></span>
</del><ins>+                        <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( get_the_author_meta('ID') ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php the_author(); ?></a></span>
</ins><span class="cx">                 </div><!-- .entry-meta -->
</span><span class="cx">
</span><span class="cx">                 <div class="entry-content">
</span><span class="lines">@@ -46,16 +46,22 @@
</span><span class="cx">
</span><span class="cx"> <?php } elseif ( in_category( 'asides' ) ) { ?>
</span><span class="cx">         <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
</span><ins>+<?php if ( is_archive() || is_search() ) : //Only display Excerpts for archives & search ?>
+                <div class="entry-summary">
+                        <?php the_excerpt( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
+                </div><!-- .entry-summary -->
+<?php else : ?>
</ins><span class="cx">                 <div class="entry-content">
</span><span class="cx">                         <?php the_content( __( 'Continue&nbsp;reading&nbsp;<span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
</span><span class="cx">                 </div><!-- .entry-content -->
</span><ins>+<?php endif; ?>
</ins><span class="cx">
</span><span class="cx">                 <div class="entry-utility">
</span><span class="cx">                         <span class="meta-prep meta-prep-author"><?php _e( 'Posted on ', 'twentyten' ); ?></span>
</span><span class="cx">                         <a href="<?php the_permalink(); ?>" title="<?php the_time(); ?>" rel="bookmark"><span class="entry-date"><?php echo get_the_date(); ?></span></a>
</span><span class="cx">                         <span class="meta-sep"> <?php _e( ' by ', 'twentyten' ); ?> </span>
</span><del>-                        <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( $authordata->ID ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php the_author(); ?></a></span>
-                        <span class="meta-sep"><?php __( ' | ', 'twentyten' ); ?></span>
</del><ins>+                        <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( get_the_author_meta('ID') ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php the_author(); ?></a></span>
+                        <span class="meta-sep"><?php _e( ' | ', 'twentyten' ); ?></span>
</ins><span class="cx">                         <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
</span><span class="cx">                         <?php edit_post_link( __( 'Edit', 'twentyten' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t\n" ); ?>
</span><span class="cx">                 </div><!-- #entry-utility -->
</span><span class="lines">@@ -71,7 +77,7 @@
</span><span class="cx">                         <a href="<?php
</span><span class="cx"> the_permalink(); ?>" title="<?php the_time(); ?>" rel="bookmark"><span class="entry-date"><?php echo get_the_date(); ?></span></a>
</span><span class="cx">                         <span class="meta-sep"><?php _e( ' by ', 'twentyten' ); ?></span>
</span><del>-                        <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( $authordata->ID ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php the_author(); ?></a></span>
</del><ins>+                        <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( get_the_author_meta('ID') ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php the_author(); ?></a></span>
</ins><span class="cx">                 </div><!-- .entry-meta -->
</span><span class="cx">
</span><span class="cx"> <?php if ( is_archive() || is_search() ) : //Only display Excerpts for archives & search ?>
</span><span class="lines">@@ -86,9 +92,13 @@
</span><span class="cx"> <?php endif; ?>
</span><span class="cx">
</span><span class="cx">                 <div class="entry-utility">
</span><del>-                        <span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php _e( 'Posted in ', 'twentyten' ); ?></span><?php echo get_the_category_list( ', ' ); ?></span>
-                        <span class="meta-sep"><?php __( ' | ', 'twentyten' ); ?></span>
-                        <?php the_tags( '<span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links">' . __('Tagged ', 'twentyten' ) . '</span>', ", ", "</span>\n\t\t\t\t\t\t<span class=\"meta-sep\">|</span>\n" ); ?>
</del><ins>+                        <span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php echo twentyten_cat_list(); ?></span></span>
+                        <span class="meta-sep"><?php _e( ' | ', 'twentyten' ); ?></span>
+                        <?php $tags_text = twentyten_tag_list(); ?>
+                        <?php if ( !empty($tags_text) ) : ?>
+                        <span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links"><?php echo $tags_text; ?></span></span>
+                        <span class="meta-sep"><?php _e( ' | ', 'twentyten' ); ?></span>
+                        <?php endif; //$tags_text ?>
</ins><span class="cx">                         <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
</span><span class="cx">                         <?php edit_post_link( __( 'Edit', 'twentyten' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t\n" ); ?>
</span><span class="cx">                 </div><!-- #entry-utility -->
</span></span></pre></div>
<a id="trunkwpcontentthemestwentytensinglephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-content/themes/twentyten/single.php (13146 => 13147)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-content/themes/twentyten/single.php        2010-02-14 09:32:23 UTC (rev 13146)
+++ trunk/wp-content/themes/twentyten/single.php        2010-02-14 10:02:38 UTC (rev 13147)
</span><span class="lines">@@ -15,7 +15,7 @@
</span><span class="cx">
</span><span class="cx">                                         <div class="entry-meta">
</span><span class="cx">                                                 <span class="meta-prep meta-prep-author"><?php _e( 'Posted by ', 'twentyten' ); ?></span>
</span><del>-                                                <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( $authordata->ID, $authordata->user_nicename ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php the_author(); ?></a></span>
</del><ins>+                                                <span class="author vcard"><a class="url fn n" href="<?php echo get_author_posts_url( get_the_author_meta('ID') ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php the_author(); ?></a></span>
</ins><span class="cx">                                                 <span class="meta-sep"><?php _e( ' on ', 'twentyten' ); ?> </span>
</span><span class="cx">                                                 <a href="<?php the_permalink(); ?>" title="<?php the_time(); ?>" rel="bookmark"><span class="entry-date"><?php echo get_the_date(); ?></span></a>
</span><span class="cx">                                                 <?php edit_post_link( __( 'Edit', 'twentyten' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t" ); ?>
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx">                                                         <h2><?php _e( 'About ', 'twentyten' ); ?><?php the_author(); ?></h2>
</span><span class="cx">                                                         <?php the_author_meta('description'); ?>
</span><span class="cx">                                                         <div id="author-link">
</span><del>-                                                                <a href="<?php echo get_author_posts_url( $authordata->ID ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php _e( 'View all posts by ', 'twentyten' ); ?><?php the_author(); ?> &rarr;</a>
</del><ins>+                                                                <a href="<?php echo get_author_posts_url( get_the_author_meta('ID') ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ); ?>"><?php _e( 'View all posts by ', 'twentyten' ); ?><?php the_author(); ?> &rarr;</a>
</ins><span class="cx">                                                         </div><!-- #author-link        -->
</span><span class="cx">                                                 </div><!-- #author-description        -->
</span><span class="cx">                                         </div><!-- .entry-author-info -->
</span></span></pre>
</div>
</div>
</body>
</html>