Make WordPress Core

Ticket #13198: twentyten-white-spaces.diff

File twentyten-white-spaces.diff, 17.6 KB (added by markmcwilliams, 15 years ago)

I went on the hunt for a bit of everything, some coding standards, and some removal of white spaces at the end! I could have done a few things zeo pointed out already? :)

  • wp-content/themes/twentyten/attachment.php

     
    2222
    2323                                        <div class="entry-meta">
    2424                                                <?php
    25                                                         printf(__( '<span class="meta-prep meta-prep-author"> By </span> <span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>', 'twentyten'),
     25                                                        printf(__( '<span class="meta-prep meta-prep-author"> By </span> <span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>', 'twentyten' ),
    2626                                                                get_author_posts_url( get_the_author_meta( 'ID' ) ),
    2727                                                                sprintf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ),
    2828                                                                get_the_author()
     
    3030                                                ?>
    3131                                                <span class="meta-sep"> | </span>
    3232                                                <?php
    33                                                         printf( __( '<span class="meta-prep meta-prep-entry-date">Published </span> <span class="entry-date"><abbr class="published" title="%1$s">%2$s</abbr></span>', 'twentyten'),
     33                                                        printf( __( '<span class="meta-prep meta-prep-entry-date">Published </span> <span class="entry-date"><abbr class="published" title="%1$s">%2$s</abbr></span>', 'twentyten' ),
    3434                                                                esc_attr( get_the_time() ),
    3535                                                                get_the_date()
    3636                                                        );
    3737                                                        if ( wp_attachment_is_image() ) {
    3838                                                                $size = getimagesize( wp_get_attachment_url() );
    39                                                                 printf( __( ' at <a href="%1$s" title="Link to full-size image">%2$s &times; %3$s</a>', 'twentyten'),
     39                                                                printf( __( ' at <a href="%1$s" title="Link to full-size image">%2$s &times; %3$s</a>', 'twentyten' ),
    4040                                                                        wp_get_attachment_url(),
    4141                                                                        $size[0],
    4242                                                                        $size[1]
     
    5050                                                <div class="entry-attachment">
    5151<?php if ( wp_attachment_is_image() ) : ?>
    5252                                                <p class="attachment"><a href="<?php echo twentyten_get_next_attachment_url(); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php
    53                                                         $attachment_size = apply_filters( 'twentyten_attachment_size',  900 );
     53                                                        $attachment_size = apply_filters( 'twentyten_attachment_size', 900 );
    5454                                                        echo wp_get_attachment_image( $post->ID, array( $attachment_size, 9999 ) ); // filterable image width with, essentially, no limit for image height.
    5555                                                ?></a></p>
    5656
     
    6464                                                </div>
    6565                                                <div class="entry-caption"><?php if ( ! empty( $post->post_excerpt ) ) the_excerpt(); ?></div>
    6666
    67 <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' )  ); ?>
     67<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
    6868<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
    6969
    7070                                        </div><!-- .entry-content -->
  • wp-content/themes/twentyten/author.php

     
    1717
    1818                                <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>
    1919
    20 <?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries  ?>
     20<?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries ?>
    2121                                        <div id="entry-author-info">
    2222                                                <div id="author-avatar">
    2323                                                        <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?>
    24                                                 </div><!-- #author-avatar       -->
     24                                                </div><!-- #author-avatar -->
    2525                                                <div id="author-description">
    2626                                                        <h2><?php printf( __( 'About %s', 'twentyten' ), get_the_author() ); ?></h2>
    2727                                                        <?php the_author_meta( 'description' ); ?>
    28                                                 </div><!-- #author-description  -->
     28                                                </div><!-- #author-description -->
    2929                                        </div><!-- .entry-author-info -->
    3030<?php endif; ?>
    3131
  • wp-content/themes/twentyten/comments.php

     
    2929<?php if ( have_comments() ) : ?>
    3030                        <h3 id="comments-title">
    3131<?php
    32     printf( _n('One Response to %2$s', '%1$s Responses to %2$s', get_comments_number(), 'twentyten'),
     32    printf( _n( 'One Response to %2$s', '%1$s Responses to %2$s', get_comments_number(), 'twentyten' ),
    3333        number_format_i18n( get_comments_number() ), '<em>' . get_the_title() . '</em>' );
    3434?>
    3535            </h3>
  • wp-content/themes/twentyten/footer.php

     
    3434<?php wp_footer(); ?>
    3535
    3636</body>
    37 </html>
     37</html>
     38 No newline at end of file
  • wp-content/themes/twentyten/functions.php

     
    104104
    105105        // The height and width of your custom header. You can hook into the theme's own filters to change these values.
    106106        // Add a filter to twentyten_header_image_width and twentyten_header_image_height to change these values.
    107         define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyten_header_image_width',  940 ) );
    108         define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyten_header_image_height',  198 ) );
     107        define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyten_header_image_width', 940 ) );
     108        define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyten_header_image_height', 198 ) );
    109109
    110110        // We'll be using post thumbnails for custom header images on posts and pages.
    111111        // We want them to be 940 pixels wide by 198 pixels tall (larger images will be auto-cropped to fit).
     
    227227 * @return string A pretty 'Continue reading' link.
    228228 */
    229229function twentyten_excerpt_more( $more ) {
    230         return '&nbsp;&hellip; <a href="'. get_permalink() . '">' . __('Continue&nbsp;reading&nbsp;<span class="meta-nav">&rarr;</span>', 'twentyten') . '</a>';
     230        return '&nbsp;&hellip; <a href="'. get_permalink() . '">' . __( 'Continue&nbsp;reading&nbsp;<span class="meta-nav">&rarr;</span>', 'twentyten' ) . '</a>';
    231231}
    232232add_filter( 'excerpt_more', 'twentyten_excerpt_more' );
    233233
     
    268268                        <br />
    269269                <?php endif; ?>
    270270
    271                 <div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><?php printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(),  get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ),'  ','' ); ?></div>
     271                <div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"><?php printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(),  get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ),' ','' ); ?></div>
    272272
    273273                <div class="comment-body"><?php comment_text(); ?></div>
    274274
     
    279279
    280280        <?php else : ?>
    281281        <li class="post pingback">
    282                 <p><?php _e( 'Pingback: ', 'twentyten' ); ?><?php comment_author_link(); ?><?php edit_comment_link ( __('edit', 'twentyten'), '&nbsp;&nbsp;', '' ); ?></p>
     282                <p><?php _e( 'Pingback: ', 'twentyten' ); ?><?php comment_author_link(); ?><?php edit_comment_link ( __('(Edit)', 'twentyten'), ' ', '' ); ?></p>
    283283        <?php endif;
    284284}
    285285endif;
     
    294294function twentyten_widgets_init() {
    295295        // Area 1
    296296        register_sidebar( array (
    297                 'name' => __( 'Primary Widget Area' , 'twentyten' ),
     297                'name' => __( 'Primary Widget Area', 'twentyten' ),
    298298                'id' => 'primary-widget-area',
    299                 'description' => __( 'The primary widget area' , 'twentyten' ),
     299                'description' => __( 'The primary widget area', 'twentyten' ),
    300300                'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
    301301                'after_widget' => "</li>",
    302302                'before_title' => '<h3 class="widget-title">',
     
    305305
    306306        // Area 2
    307307        register_sidebar( array (
    308                 'name' => __( 'Secondary Widget Area' , 'twentyten' ),
     308                'name' => __( 'Secondary Widget Area', 'twentyten' ),
    309309                'id' => 'secondary-widget-area',
    310                 'description' => __( 'The secondary widget area' , 'twentyten' ),
     310                'description' => __( 'The secondary widget area', 'twentyten' ),
    311311                'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
    312312                'after_widget' => "</li>",
    313313                'before_title' => '<h3 class="widget-title">',
     
    316316
    317317        // Area 3
    318318        register_sidebar( array (
    319                 'name' => __( 'First Footer Widget Area' , 'twentyten' ),
     319                'name' => __( 'First Footer Widget Area', 'twentyten' ),
    320320                'id' => 'first-footer-widget-area',
    321                 'description' => __( 'The first footer widget area' , 'twentyten' ),
     321                'description' => __( 'The first footer widget area', 'twentyten' ),
    322322                'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
    323323                'after_widget' => "</li>",
    324324                'before_title' => '<h3 class="widget-title">',
     
    327327
    328328        // Area 4
    329329        register_sidebar( array (
    330                 'name' => __( 'Second Footer Widget Area' , 'twentyten' ),
     330                'name' => __( 'Second Footer Widget Area', 'twentyten' ),
    331331                'id' => 'second-footer-widget-area',
    332                 'description' => __( 'The second footer widget area' , 'twentyten' ),
     332                'description' => __( 'The second footer widget area', 'twentyten' ),
    333333                'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
    334334                'after_widget' => "</li>",
    335335                'before_title' => '<h3 class="widget-title">',
     
    338338
    339339        // Area 5
    340340        register_sidebar( array (
    341                 'name' => __( 'Third Footer Widget Area' , 'twentyten' ),
     341                'name' => __( 'Third Footer Widget Area', 'twentyten' ),
    342342                'id' => 'third-footer-widget-area',
    343                 'description' => __( 'The third footer widget area' , 'twentyten' ),
     343                'description' => __( 'The third footer widget area', 'twentyten' ),
    344344                'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
    345345                'after_widget' => "</li>",
    346346                'before_title' => '<h3 class="widget-title">',
     
    349349
    350350        // Area 6
    351351        register_sidebar( array (
    352                 'name' => __( 'Fourth Footer Widget Area' , 'twentyten' ),
     352                'name' => __( 'Fourth Footer Widget Area', 'twentyten' ),
    353353                'id' => 'fourth-footer-widget-area',
    354                 'description' => __( 'The fourth footer widget area' , 'twentyten' ),
     354                'description' => __( 'The fourth footer widget area', 'twentyten' ),
    355355                'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
    356356                'after_widget' => "</li>",
    357357                'before_title' => '<h3 class="widget-title">',
     
    375375function twentyten_get_next_attachment_url() {
    376376        global $post;
    377377        $post = get_post($post);
    378         $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') ));
     378        $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' ) ));
    379379 
    380380        foreach ( $attachments as $k => $attachment )
    381381                if ( $attachment->ID == $post->ID )
  • wp-content/themes/twentyten/header.php

     
    5555
    5656                                <?php
    5757                                        // Check if this is a post or page, if it has a thumbnail, and if it's a big one
    58                                         if (    is_singular() &&
     58                                        if ( is_singular() &&
    5959                                                        has_post_thumbnail( $post->ID ) &&
    6060                                                        ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail') ) &&
    6161                                                        $image[1] >= HEADER_IMAGE_WIDTH ) :
  • wp-content/themes/twentyten/index.php

     
    11<?php
    2 
    32/**
    43 * The main template file
    54 *
     
    1312 * @subpackage Twenty Ten
    1413 * @since 3.0.0
    1514 */
    16  
    1715?>
    1816 
    1917<?php get_header(); ?>
     
    2826                         */
    2927                         get_template_part( 'loop', 'index' );
    3028                        ?>
     29
    3130                        </div><!-- #content -->
    3231                </div><!-- #container -->
    3332
  • wp-content/themes/twentyten/loop.php

     
    22/**
    33 * The loop that displays posts
    44 *
    5  * The loop displays the posts and the post content.  See
     5 * The loop displays the posts and the post content. See
    66 * http://codex.wordpress.org/The_Loop to understand it and
    77 * http://codex.wordpress.org/Template_Tags to understand
    88 * the tags used in it.
     
    1313 */
    1414?>
    1515
    16 <?php /* Display navigation to next/previous pages when applicable  */ ?>
     16<?php /* Display navigation to next/previous pages when applicable */ ?>
    1717<?php if ( $wp_query->max_num_pages > 1 ) : ?>
    1818        <div id="nav-above" class="navigation">
    1919                <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
     
    2121        </div><!-- #nav-above -->
    2222<?php endif; ?>
    2323
    24 <?php /* If there are no posts to display, such as an empty archive page  */ ?>
     24<?php /* If there are no posts to display, such as an empty archive page */ ?>
    2525<?php if ( ! have_posts() ) : ?>
    2626        <div id="post-0" class="post error404 not-found">
    2727                <h1 class="entry-title"><?php _e( 'Not Found', 'twentyten' ); ?></h1>
     
    3232        </div><!-- #post-0 -->
    3333<?php endif; ?>
    3434
    35 <?php /* Start the Loop  */ ?>
     35<?php /* Start the Loop */ ?>
    3636<?php while ( have_posts() ) : the_post(); ?>
    3737
    38 <?php /* How to Display posts in the Gallery Category  */ ?>
     38<?php /* How to Display posts in the Gallery Category */ ?>
    3939        <?php if ( in_category( _x('gallery', 'gallery category slug', 'twentyten') ) ) : ?>
    4040                <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    4141                        <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
     
    9191                        </div><!-- .entry-summary -->
    9292        <?php else : ?>
    9393                        <div class="entry-content">
    94                                 <?php the_content( __( 'Continue&nbsp;reading&nbsp;<span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
     94                                <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
    9595                        </div><!-- .entry-content -->
    9696        <?php endif; ?>
    9797
     
    112112                        </div><!-- #entry-utility -->
    113113                </div><!-- #post-<?php the_ID(); ?> -->
    114114
    115 <?php /* How to display all other posts  */ ?>
     115<?php /* How to display all other posts */ ?>
    116116        <?php else : ?>
    117117                <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    118118                        <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
     
    136136                        </div><!-- .entry-summary -->
    137137        <?php else : ?>
    138138                        <div class="entry-content">
    139                                 <?php the_content( __( 'Continue&nbsp;reading&nbsp;<span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
     139                                <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
    140140                                <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
    141141                        </div><!-- .entry-content -->
    142142        <?php endif; ?>
     
    155155        <?php endif; // if different categories queried ?>
    156156<?php endwhile; ?>
    157157
    158 <?php /* Display navigation to next/previous pages when applicable  */ ?>
    159 <?php if (  $wp_query->max_num_pages > 1 ) : ?>
     158<?php /* Display navigation to next/previous pages when applicable */ ?>
     159<?php if ( $wp_query->max_num_pages > 1 ) : ?>
    160160                                <div id="nav-below" class="navigation">
    161161                                        <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
    162162                                        <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>
  • wp-content/themes/twentyten/single.php

     
    3939                                        <div id="entry-author-info">
    4040                                                <div id="author-avatar">
    4141                                                        <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?>
    42                                                 </div><!-- #author-avatar       -->
     42                                                </div><!-- #author-avatar -->
    4343                                                <div id="author-description">
    4444                                                        <h2><?php _e( 'About ', 'twentyten' ); ?><?php the_author(); ?></h2>
    4545                                                        <?php the_author_meta( 'description' ); ?>
    4646                                                        <div id="author-link">
    4747                                                                <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>
    4848                                                        </div><!-- #author-link -->
    49                                                 </div><!-- #author-description  -->
     49                                                </div><!-- #author-description -->
    5050                                        </div><!-- .entry-author-info -->
    5151<?php endif; ?>
    5252