From d504e9c257dd9a4db26b066a7d9e44e0c4044593 Mon Sep 17 00:00:00 2001 From: Matt Thomas Date: Tue, 16 Mar 2010 20:17:22 +0000 Subject: [PATCH] Coding standards cleanup in twentyten, see #9015. Props sivel git-svn-id: https://develop.svn.wordpress.org/trunk@13720 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-content/themes/twentyten/archive.php | 2 +- wp-content/themes/twentyten/attachment.php | 20 ++--- wp-content/themes/twentyten/author.php | 12 +-- wp-content/themes/twentyten/category.php | 6 +- wp-content/themes/twentyten/comments.php | 20 ++--- wp-content/themes/twentyten/footer.php | 4 +- wp-content/themes/twentyten/functions.php | 82 +++++++++++++------ wp-content/themes/twentyten/header.php | 26 +++--- wp-content/themes/twentyten/loop.php | 40 ++++----- .../themes/twentyten/onecolumn-page.php | 4 +- wp-content/themes/twentyten/page.php | 4 +- wp-content/themes/twentyten/search.php | 4 +- .../themes/twentyten/sidebar-footer.php | 20 +++-- wp-content/themes/twentyten/sidebar.php | 6 +- wp-content/themes/twentyten/single.php | 16 ++-- wp-content/themes/twentyten/tag.php | 4 +- 16 files changed, 153 insertions(+), 117 deletions(-) diff --git a/wp-content/themes/twentyten/archive.php b/wp-content/themes/twentyten/archive.php index cda1c64e8879..2c0ddc3a52e6 100644 --- a/wp-content/themes/twentyten/archive.php +++ b/wp-content/themes/twentyten/archive.php @@ -23,4 +23,4 @@ - \ No newline at end of file + diff --git a/wp-content/themes/twentyten/attachment.php b/wp-content/themes/twentyten/attachment.php index e129262f394c..fe69187a3521 100644 --- a/wp-content/themes/twentyten/attachment.php +++ b/wp-content/themes/twentyten/attachment.php @@ -5,7 +5,7 @@ -

post_parent); ?>

+

post_parent ); ?>

>

@@ -13,7 +13,7 @@ -
post_excerpt) ) the_excerpt(); ?>
+
post_excerpt ) ) the_excerpt(); ?>
→', 'twentyten' ) ); ?> ' . __( 'Pages:', 'twentyten' ) . '&after=
' ); ?> @@ -60,21 +60,21 @@ } printf( $utility_text, - get_the_category_list(', '), + get_the_category_list( ', ' ), $tag_list, get_permalink(), - the_title_attribute('echo=0'), + the_title_attribute( 'echo=0' ), get_post_comments_feed_link() ); ?> Post a comment or leave a trackback: Trackback URL.', 'twentyten' ), get_trackback_url() ); ?> - + Trackback URL.', 'twentyten' ), get_trackback_url() ); ?> - + post a comment.', 'twentyten' ); ?> - + ", "" ); ?> @@ -87,4 +87,4 @@ - \ No newline at end of file + diff --git a/wp-content/themes/twentyten/author.php b/wp-content/themes/twentyten/author.php index eb744d8fd9f8..300a8243f874 100644 --- a/wp-content/themes/twentyten/author.php +++ b/wp-content/themes/twentyten/author.php @@ -5,16 +5,16 @@ -

%s', 'twentyten' ), "" . get_the_author() . "" ); ?>

+

%s', 'twentyten' ), "" . get_the_author() . "" ); ?>

- +
- +
-

- +

+
@@ -27,4 +27,4 @@ - \ No newline at end of file + diff --git a/wp-content/themes/twentyten/category.php b/wp-content/themes/twentyten/category.php index e638959c5708..32d9a2dcaa99 100644 --- a/wp-content/themes/twentyten/category.php +++ b/wp-content/themes/twentyten/category.php @@ -4,9 +4,9 @@

' . single_cat_title('', false) . ''); + printf( __( 'Category Archives: %s', 'twentyten' ), '' . single_cat_title( '', false ) . '' ); ?>

- ' . $categorydesc . '
' ); ?> + ' . $categorydesc . '' ); ?> @@ -14,4 +14,4 @@ - \ No newline at end of file + diff --git a/wp-content/themes/twentyten/comments.php b/wp-content/themes/twentyten/comments.php index 404c734db815..121076f1b00b 100644 --- a/wp-content/themes/twentyten/comments.php +++ b/wp-content/themes/twentyten/comments.php @@ -13,26 +13,26 @@

' . get_the_title() . ''), - sprintf(__('One Response to %s', 'twentyten'), '' . get_the_title() . ''), - sprintf(__('%% Responses to %s', 'twentyten'), '' . get_the_title() . '') + sprintf( __( 'No Responses to %s', 'twentyten' ), '' . get_the_title() . '' ), + sprintf( __( 'One Response to %s', 'twentyten' ), '' . get_the_title() . '' ), + sprintf( __( '%% Responses to %s', 'twentyten' ), '' . get_the_title() . '' ) ); ?>

1 ) : // are there comments to navigate through ?>
    - 'twentyten_comment') ); ?> + 'twentyten_comment' ) ); ?>
1 ) : // are there comments to navigate through ?> @@ -42,11 +42,11 @@ -

+

- \ No newline at end of file + diff --git a/wp-content/themes/twentyten/footer.php b/wp-content/themes/twentyten/footer.php index 2bac7ad62756..ed2c0457e3be 100644 --- a/wp-content/themes/twentyten/footer.php +++ b/wp-content/themes/twentyten/footer.php @@ -6,11 +6,11 @@
- +
- %s.', 'twentyten'), '' . __( 'WordPress', 'twentyten' ) . '' ); ?> + %s.', 'twentyten' ), '' . __( 'WordPress', 'twentyten' ) . '' ); ?>
diff --git a/wp-content/themes/twentyten/functions.php b/wp-content/themes/twentyten/functions.php index 882b1d985c1e..8a1c78828c32 100644 --- a/wp-content/themes/twentyten/functions.php +++ b/wp-content/themes/twentyten/functions.php @@ -8,8 +8,8 @@ function twentyten_init() { // Your Changeable header business starts here // No CSS, just IMG call - define( 'HEADER_TEXTCOLOR', ''); - define( 'HEADER_IMAGE', '%s/images/headers/forestfloor.jpg'); // %s is theme dir uri + define( 'HEADER_TEXTCOLOR', '' ); + define( 'HEADER_IMAGE', '%s/images/headers/forestfloor.jpg' ); // %s is theme dir uri define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyten_header_image_width', 940 ) ); define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyten_header_image_height', 198 ) ); define( 'NO_HEADER_TEXT', true ); @@ -17,14 +17,48 @@ function twentyten_init() { add_custom_image_header( '', 'twentyten_admin_header_style' ); // and thus ends the changeable header business - register_default_headers( array('berries' => array('url' => '%s/images/headers/berries.jpg', 'thumbnail_url' => '%s/images/headers/berries-thumbnail.jpg', 'description' => __('Berries')), - 'cherryblossom' => array( 'url' => '%s/images/headers/cherryblossoms.jpg', 'thumbnail_url' => '%s/images/headers/cherryblossoms-thumbnail.jpg', 'description' => __('Cherry Blossoms')), - 'concave' => array('url' => '%s/images/headers/concave.jpg', 'thumbnail_url' => '%s/images/headers/concave-thumbnail.jpg', 'description' => __('Concave')), - 'fern' => array('url' => '%s/images/headers/fern.jpg', 'thumbnail_url' => '%s/images/headers/fern-thumbnail.jpg', 'description' => __('Fern')), - 'forestfloor' => array('url' => '%s/images/headers/forestfloor.jpg', 'thumbnail_url' => '%s/images/headers/forestfloor-thumbnail.jpg', 'description' => __('Forest Floor')), - 'inkwell' => array('url' => '%s/images/headers/inkwell.jpg', 'thumbnail_url' => '%s/images/headers/inkwell-thumbnail.jpg', 'description' => __('Ink Well')), - 'path' => array('url' => '%s/images/headers/path.jpg', 'thumbnail_url' => '%s/images/headers/path-thumbnail.jpg', 'description' => __('Path')), - 'sunset' => array('url' => '%s/images/headers/sunset.jpg', 'thumbnail_url' => '%s/images/headers/sunset-thumbnail.jpg', 'description' => __('Sunset')) ) ); + register_default_headers( array ( + 'berries' => array ( + 'url' => '%s/images/headers/berries.jpg', + 'thumbnail_url' => '%s/images/headers/berries-thumbnail.jpg', + 'description' => __( 'Berries' ) + ), + 'cherryblossom' => array ( + 'url' => '%s/images/headers/cherryblossoms.jpg', + 'thumbnail_url' => '%s/images/headers/cherryblossoms-thumbnail.jpg', + 'description' => __( 'Cherry Blossoms' ) + ), + 'concave' => array ( + 'url' => '%s/images/headers/concave.jpg', + 'thumbnail_url' => '%s/images/headers/concave-thumbnail.jpg', + 'description' => __( 'Concave' ) + ), + 'fern' => array ( + 'url' => '%s/images/headers/fern.jpg', + 'thumbnail_url' => '%s/images/headers/fern-thumbnail.jpg', + 'description' => __( 'Fern' ) + ), + 'forestfloor' => array ( + 'url' => '%s/images/headers/forestfloor.jpg', + 'thumbnail_url' => '%s/images/headers/forestfloor-thumbnail.jpg', + 'description' => __( 'Forest Floor' ) + ), + 'inkwell' => array ( + 'url' => '%s/images/headers/inkwell.jpg', + 'thumbnail_url' => '%s/images/headers/inkwell-thumbnail.jpg', + 'description' => __( 'Ink Well' ) + ), + 'path' => array ( + 'url' => '%s/images/headers/path.jpg', + 'thumbnail_url' => '%s/images/headers/path-thumbnail.jpg', + 'description' => __( 'Path' ) + ), + 'sunset' => array ( + 'url' => '%s/images/headers/sunset.jpg', + 'thumbnail_url' => '%s/images/headers/sunset-thumbnail.jpg', + 'description' => __( 'Sunset' ) + ) + ) ); add_custom_background(); @@ -75,8 +109,8 @@ function twentyten_admin_header_style() { // Get the page number if ( ! function_exists( 'twentyten_get_page_number' ) ) : function twentyten_get_page_number() { - if ( get_query_var('paged') ) - return ' | ' . __( 'Page ' , 'twentyten') . get_query_var('paged'); + if ( get_query_var( 'paged' ) ) + return ' | ' . __( 'Page ' , 'twentyten' ) . get_query_var( 'paged' ); } endif; @@ -98,7 +132,7 @@ function twentyten_excerpt_length( $length ) { // Make a nice read more link on excerpts if ( ! function_exists( 'twentyten_excerpt_more' ) ) : -function twentyten_excerpt_more($more) { +function twentyten_excerpt_more( $more ) { return ' … ' . 'Continue reading ' . ''; } endif; @@ -121,7 +155,7 @@ function twentyten_comment( $comment, $args, $depth ) {
-
+
@@ -147,27 +181,27 @@ function twentyten_remove_gallery_css( $css ) { if ( ! function_exists( 'twentyten_cat_list' ) ) : function twentyten_cat_list() { - return twentyten_term_list('category', ', ', __('Posted in %s', 'twentyten'), __('Also posted in %s', 'twentyten') ); + return twentyten_term_list( 'category', ', ', __( 'Posted in %s', 'twentyten' ), __( 'Also posted in %s', 'twentyten' ) ); } endif; if ( ! function_exists( 'twentyten_tag_list' ) ) : function twentyten_tag_list() { - return twentyten_term_list('post_tag', ', ', __('Tagged %s', 'twentyten'), __('Also tagged %s', 'twentyten') ); + return twentyten_term_list( 'post_tag', ', ', __( 'Tagged %s', 'twentyten' ), __( 'Also tagged %s', 'twentyten' ) ); } endif; if ( ! function_exists( 'twentyten_term_list' ) ) : -function twentyten_term_list($taxonomy, $glue = ', ', $text = '', $also_text = '') { +function twentyten_term_list( $taxonomy, $glue = ', ', $text = '', $also_text = '' ) { global $wp_query, $post; $current_term = $wp_query->get_queried_object(); - $terms = wp_get_object_terms($post->ID, $taxonomy); + $terms = wp_get_object_terms( $post->ID, $taxonomy ); // If we're viewing a Taxonomy page.. - if ( isset($current_term->taxonomy) && $taxonomy == $current_term->taxonomy ) { + if ( isset( $current_term->taxonomy ) && $taxonomy == $current_term->taxonomy ) { // Remove the term from display. - foreach ( (array)$terms as $key => $term ) { + foreach ( (array) $terms as $key => $term ) { if ( $term->term_id == $current_term->term_id ) { - unset($terms[$key]); + unset( $terms[$key] ); break; } } @@ -176,11 +210,11 @@ function twentyten_term_list($taxonomy, $glue = ', ', $text = '', $also_text = ' } $tlist = array(); $rel = 'category' == $taxonomy ? 'rel="category"' : 'rel="tag"'; - foreach ( (array)$terms as $term ) { + foreach ( (array) $terms as $term ) { $tlist[] = '' . $term->name . ''; } - if ( !empty($tlist) ) - return sprintf($text, join($glue, $tlist)); + if ( ! empty( $tlist ) ) + return sprintf( $text, join( $glue, $tlist ) ); return ''; } endif; diff --git a/wp-content/themes/twentyten/header.php b/wp-content/themes/twentyten/header.php index c6e7165c7fd3..becfbc80dcae 100644 --- a/wp-content/themes/twentyten/header.php +++ b/wp-content/themes/twentyten/header.php @@ -1,25 +1,25 @@ > - + <?php if ( is_single() ) { - single_post_title(); echo ' | '; bloginfo('name'); + single_post_title(); echo ' | '; bloginfo( 'name' ); } elseif ( is_home() || is_front_page() ) { - bloginfo('name'); echo ' | '; bloginfo('description'); twentyten_the_page_number(); + bloginfo( 'name' ); echo ' | '; bloginfo( 'description' ); twentyten_the_page_number(); } elseif ( is_page() ) { - single_post_title(''); echo ' | '; bloginfo('name'); + single_post_title( '' ); echo ' | '; bloginfo( 'name' ); } elseif ( is_search() ) { - printf(__('Search results for "%s"', 'twentyten'), esc_html($s)); twentyten_the_page_number(); echo ' | '; bloginfo('name'); + printf( __( 'Search results for "%s"', 'twentyten' ), esc_html( $s ) ); twentyten_the_page_number(); echo ' | '; bloginfo( 'name' ); } elseif ( is_404() ) { - _e('Not Found', 'twentyten'); echo ' | '; bloginfo('name'); + _e( 'Not Found', 'twentyten' ); echo ' | '; bloginfo( 'name' ); } else { - wp_title(''); echo ' | '; bloginfo('name'); twentyten_the_page_number(); + wp_title( '' ); echo ' | '; bloginfo( 'name' ); twentyten_the_page_number(); } ?> - - + + @@ -30,15 +30,15 @@ - \ No newline at end of file + diff --git a/wp-content/themes/twentyten/search.php b/wp-content/themes/twentyten/search.php index e84fb82abbe8..d7715c4c54ba 100644 --- a/wp-content/themes/twentyten/search.php +++ b/wp-content/themes/twentyten/search.php @@ -4,7 +4,7 @@
-

' . get_search_query() . ''); ?>

+

' . get_search_query() . '' ); ?>

@@ -19,4 +19,4 @@
- \ No newline at end of file + diff --git a/wp-content/themes/twentyten/sidebar-footer.php b/wp-content/themes/twentyten/sidebar-footer.php index 53a04c278657..2934da93b5ec 100644 --- a/wp-content/themes/twentyten/sidebar-footer.php +++ b/wp-content/themes/twentyten/sidebar-footer.php @@ -1,11 +1,13 @@ - +
- +

- +
@@ -51,10 +51,10 @@ } printf( $utility_text, - get_the_category_list(', '), + get_the_category_list( ', ' ), $tag_list, get_permalink(), - the_title_attribute('echo=0'), + the_title_attribute( 'echo=0' ), get_post_comments_feed_link() ); ?> @@ -74,4 +74,4 @@
- \ No newline at end of file + diff --git a/wp-content/themes/twentyten/tag.php b/wp-content/themes/twentyten/tag.php index 7bdd50285ca1..d4834146c7ab 100644 --- a/wp-content/themes/twentyten/tag.php +++ b/wp-content/themes/twentyten/tag.php @@ -6,7 +6,7 @@

' . single_tag_title('', false) . ''); + printf( __( 'Tag Archives: %s', 'twentyten' ), '' . single_tag_title( '', false ) . '' ); ?>

@@ -17,4 +17,4 @@ - \ No newline at end of file +