From 11e0a2e9694fee391e5699700f6ec96471e8c3d0 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 4 May 2010 07:01:09 +0000 Subject: [PATCH] Twenty Ten spacing and string cleanups. props zeo, markmcwilliams. see #13198. Add a twentyten_credits filter, props nathanrice, fixes #12804. Also clean up the generator/credits string. git-svn-id: https://develop.svn.wordpress.org/trunk@14433 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-content/themes/twentyten/attachment.php | 2 +- wp-content/themes/twentyten/comments.php | 2 +- wp-content/themes/twentyten/footer.php | 3 +- wp-content/themes/twentyten/functions.php | 52 +++++++++++----------- wp-content/themes/twentyten/header.php | 2 +- wp-content/themes/twentyten/index.php | 2 - wp-content/themes/twentyten/loop.php | 16 +++---- wp-content/themes/twentyten/single.php | 6 +-- 8 files changed, 41 insertions(+), 44 deletions(-) diff --git a/wp-content/themes/twentyten/attachment.php b/wp-content/themes/twentyten/attachment.php index 8676fda9f9..de81ec0119 100644 --- a/wp-content/themes/twentyten/attachment.php +++ b/wp-content/themes/twentyten/attachment.php @@ -96,7 +96,7 @@ -', '' ); ?> +', '' ); ?> diff --git a/wp-content/themes/twentyten/comments.php b/wp-content/themes/twentyten/comments.php index 303d0c62c7..7fa2d232bb 100644 --- a/wp-content/themes/twentyten/comments.php +++ b/wp-content/themes/twentyten/comments.php @@ -29,7 +29,7 @@

' . get_the_title() . '' ); ?>

diff --git a/wp-content/themes/twentyten/footer.php b/wp-content/themes/twentyten/footer.php index c2e47d1c33..76f42e302b 100644 --- a/wp-content/themes/twentyten/footer.php +++ b/wp-content/themes/twentyten/footer.php @@ -23,7 +23,8 @@
- %s.', 'twentyten' ), '' . __( 'WordPress', 'twentyten' ) . '' ); ?> + +
diff --git a/wp-content/themes/twentyten/functions.php b/wp-content/themes/twentyten/functions.php index cd76572e19..2296f983e7 100644 --- a/wp-content/themes/twentyten/functions.php +++ b/wp-content/themes/twentyten/functions.php @@ -104,8 +104,8 @@ function twentyten_setup() { // The height and width of your custom header. You can hook into the theme's own filters to change these values. // Add a filter to twentyten_header_image_width and twentyten_header_image_height to change these values. - define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyten_header_image_width', 940 ) ); - define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyten_header_image_height', 198 ) ); + define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyten_header_image_width', 940 ) ); + define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyten_header_image_height', 198 ) ); // We'll be using post thumbnails for custom header images on posts and pages. // We want them to be 940 pixels wide by 198 pixels tall (larger images will be auto-cropped to fit). @@ -227,7 +227,7 @@ add_filter( 'excerpt_length', 'twentyten_excerpt_length' ); * @return string A pretty 'Continue reading' link. */ function twentyten_excerpt_more( $more ) { - return ' … ' . __('Continue reading ', 'twentyten') . ''; + return ' … ' . __('Continue reading ', 'twentyten') . ''; } add_filter( 'excerpt_more', 'twentyten_excerpt_more' ); @@ -268,7 +268,7 @@ function twentyten_comment( $comment, $args, $depth ) {
-
+
@@ -279,7 +279,7 @@ function twentyten_comment( $comment, $args, $depth ) {
  • -

    +

    __( 'Primary Widget Area' , 'twentyten' ), + 'name' => __( 'Primary Widget Area', 'twentyten' ), 'id' => 'primary-widget-area', - 'description' => __( 'The primary widget area' , 'twentyten' ), + 'description' => __( 'The primary widget area', 'twentyten' ), 'before_widget' => '
  • ', 'after_widget' => "
  • ", 'before_title' => '

    ', @@ -305,9 +305,9 @@ function twentyten_widgets_init() { // Area 2 register_sidebar( array ( - 'name' => __( 'Secondary Widget Area' , 'twentyten' ), + 'name' => __( 'Secondary Widget Area', 'twentyten' ), 'id' => 'secondary-widget-area', - 'description' => __( 'The secondary widget area' , 'twentyten' ), + 'description' => __( 'The secondary widget area', 'twentyten' ), 'before_widget' => '
  • ', 'after_widget' => "
  • ", 'before_title' => '

    ', @@ -316,9 +316,9 @@ function twentyten_widgets_init() { // Area 3 register_sidebar( array ( - 'name' => __( 'First Footer Widget Area' , 'twentyten' ), + 'name' => __( 'First Footer Widget Area', 'twentyten' ), 'id' => 'first-footer-widget-area', - 'description' => __( 'The first footer widget area' , 'twentyten' ), + 'description' => __( 'The first footer widget area', 'twentyten' ), 'before_widget' => '
  • ', 'after_widget' => "
  • ", 'before_title' => '

    ', @@ -327,9 +327,9 @@ function twentyten_widgets_init() { // Area 4 register_sidebar( array ( - 'name' => __( 'Second Footer Widget Area' , 'twentyten' ), + 'name' => __( 'Second Footer Widget Area', 'twentyten' ), 'id' => 'second-footer-widget-area', - 'description' => __( 'The second footer widget area' , 'twentyten' ), + 'description' => __( 'The second footer widget area', 'twentyten' ), 'before_widget' => '
  • ', 'after_widget' => "
  • ", 'before_title' => '

    ', @@ -338,9 +338,9 @@ function twentyten_widgets_init() { // Area 5 register_sidebar( array ( - 'name' => __( 'Third Footer Widget Area' , 'twentyten' ), + 'name' => __( 'Third Footer Widget Area', 'twentyten' ), 'id' => 'third-footer-widget-area', - 'description' => __( 'The third footer widget area' , 'twentyten' ), + 'description' => __( 'The third footer widget area', 'twentyten' ), 'before_widget' => '
  • ', 'after_widget' => "
  • ", 'before_title' => '

    ', @@ -349,9 +349,9 @@ function twentyten_widgets_init() { // Area 6 register_sidebar( array ( - 'name' => __( 'Fourth Footer Widget Area' , 'twentyten' ), + 'name' => __( 'Fourth Footer Widget Area', 'twentyten' ), 'id' => 'fourth-footer-widget-area', - 'description' => __( 'The fourth footer widget area' , 'twentyten' ), + 'description' => __( 'The fourth footer widget area', 'twentyten' ), 'before_widget' => '
  • ', 'after_widget' => "
  • ", 'before_title' => '

    ', @@ -375,17 +375,15 @@ add_action( 'widgets_init', 'twentyten_remove_recent_comments_style' ); function twentyten_get_next_attachment_url() { global $post; $post = get_post($post); - $attachments = array_values(get_children( array('post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') )); + $attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) ); - foreach ( $attachments as $k => $attachment ) + foreach ( $attachments as $k => $attachment ) { if ( $attachment->ID == $post->ID ) break; - - $k = $k + 1; - - if ( isset($attachments[$k]) ) { - return get_attachment_link($attachments[$k]->ID); - } else { - return get_permalink($post->post_parent); - } + } + $k++; + if ( isset( $attachments[ $k ] ) ) + return get_attachment_link( $attachments[ $k ]->ID ); + else + return get_permalink( $post->post_parent ); } \ No newline at end of file diff --git a/wp-content/themes/twentyten/header.php b/wp-content/themes/twentyten/header.php index 30c61973d6..dded2611b7 100644 --- a/wp-content/themes/twentyten/header.php +++ b/wp-content/themes/twentyten/header.php @@ -55,7 +55,7 @@ ID ) && ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail') ) && $image[1] >= HEADER_IMAGE_WIDTH ) : diff --git a/wp-content/themes/twentyten/index.php b/wp-content/themes/twentyten/index.php index 019c4f93d1..26363b0185 100644 --- a/wp-content/themes/twentyten/index.php +++ b/wp-content/themes/twentyten/index.php @@ -1,5 +1,4 @@ diff --git a/wp-content/themes/twentyten/loop.php b/wp-content/themes/twentyten/loop.php index f6ca441384..bb36a94c36 100644 --- a/wp-content/themes/twentyten/loop.php +++ b/wp-content/themes/twentyten/loop.php @@ -13,7 +13,7 @@ */ ?> - + max_num_pages > 1 ) : ?> - +

    @@ -32,10 +32,10 @@
    - + - +
    >

    @@ -91,7 +91,7 @@
    - →', 'twentyten' ) ); ?> + →', 'twentyten' ) ); ?>
    @@ -112,7 +112,7 @@ - +
    >

    @@ -136,7 +136,7 @@
    - →', 'twentyten' ) ); ?> + →', 'twentyten' ) ); ?> '' ) ); ?>
    @@ -155,7 +155,7 @@ - + max_num_pages > 1 ) : ?>