Make WordPress Core

Ticket #29127: 29127.twentyten.2.patch

File 29127.twentyten.2.patch, 12.3 KB (added by lancewillett, 9 years ago)

Second pass at Twenty Ten cleanup

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

     
    5454         * If you want to overload this in a child theme then include a file
    5555         * called loop-archive.php and that will be used instead.
    5656         */
    57          get_template_part( 'loop', 'archive' );
     57        get_template_part( 'loop', 'archive' );
    5858?>
    5959
    6060                        </div><!-- #content -->
  • wp-content/themes/twentyten/author.php

     
    2525                the_post();
    2626?>
    2727
    28                                 <h1 class="page-title author"><?php printf( __( 'Author Archives: %s', 'twentyten' ), "<span class='vcard'><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></span>" ); ?></h1>
     28                                <h1 class="page-title author"><?php printf( __( 'Author Archives: %s', 'twentyten' ), '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' ); ?></h1>
    2929
    3030<?php
    3131// If a user has filled out their description, show a bio on their entries.
     
    6363         * If you want to overload this in a child theme then include a file
    6464         * called loop-author.php and that will be used instead.
    6565         */
    66          get_template_part( 'loop', 'author' );
     66        get_template_part( 'loop', 'author' );
    6767?>
    6868                        </div><!-- #content -->
    6969                </div><!-- #container -->
  • wp-content/themes/twentyten/footer.php

     
    2424?>
    2525
    2626                        <div id="site-info">
    27                                 <a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
     27                                <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
    2828                                        <?php bloginfo( 'name' ); ?>
    2929                                </a>
    3030                        </div><!-- #site-info -->
  • wp-content/themes/twentyten/functions.php

     
    567567        if ( function_exists( 'get_post_galleries' ) ) {
    568568                $galleries = get_post_galleries( get_the_ID(), false );
    569569                if ( isset( $galleries[0]['ids'] ) )
    570                         $images = explode( ',', $galleries[0]['ids'] );
     570                        $images = explode( ',', $galleries[0]['ids'] );
    571571        } else {
    572572                $pattern = get_shortcode_regex();
    573573                preg_match( "/$pattern/s", get_the_content(), $match );
  • wp-content/themes/twentyten/header.php

     
    3030
    3131        // Add a page number if necessary:
    3232        if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() )
    33                 echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) );
     33                echo esc_html( ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) ) );
    3434
    3535        ?></title>
    3636<link rel="profile" href="http://gmpg.org/xfn/11" />
     
    6262                                <?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
    6363                                <<?php echo $heading_tag; ?> id="site-title">
    6464                                        <span>
    65                                                 <a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
     65                                                <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
    6666                                        </span>
    6767                                </<?php echo $heading_tag; ?>>
    6868                                <div id="site-description"><?php bloginfo( 'description' ); ?></div>
     
    9696                                                        $header_image_height = HEADER_IMAGE_HEIGHT;
    9797                                                }
    9898                                        ?>
    99                                                 <img src="<?php header_image(); ?>" width="<?php echo $header_image_width; ?>" height="<?php echo $header_image_height; ?>" alt="" />
     99                                                <img src="<?php header_image(); ?>" width="<?php echo esc_attr( $header_image_width ); ?>" height="<?php echo esc_attr( $header_image_height ); ?>" alt="" />
    100100                                        <?php endif; ?>
    101101                        </div><!-- #branding -->
    102102
  • wp-content/themes/twentyten/index.php

     
    2424                         * If you want to overload this in a child theme then include a file
    2525                         * called loop-index.php and that will be used instead.
    2626                         */
    27                          get_template_part( 'loop', 'index' );
     27                        get_template_part( 'loop', 'index' );
    2828                        ?>
    2929                        </div><!-- #content -->
    3030                </div><!-- #container -->
  • wp-content/themes/twentyten/loop-attachment.php

     
    8080                        $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
    8181                else
    8282                        // or get the URL of the first image attachment
    83                         $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID );
     83                        $next_attachment_url = get_attachment_link( $attachments[0]->ID );
    8484        } else {
    8585                // or, if there's only 1 image attachment, get the URL of the image
    8686                $next_attachment_url = wp_get_attachment_url();
     
    111111                                                        <div class="nav-next"><?php next_image_link( false ); ?></div>
    112112                                                </div><!-- #nav-below -->
    113113<?php else : ?>
    114                                                 <a href="<?php echo esc_url( wp_get_attachment_url() ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php echo basename( get_permalink() ); ?></a>
     114                                                <a href="<?php echo esc_url( wp_get_attachment_url() ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php echo esc_html( basename( get_permalink() ) ); ?></a>
    115115<?php endif; ?>
    116116                                                </div><!-- .entry-attachment -->
    117                                                 <div class="entry-caption"><?php if ( !empty( $post->post_excerpt ) ) the_excerpt(); ?></div>
     117                                                <div class="entry-caption"><?php if ( ! empty( $post->post_excerpt ) ) the_excerpt(); ?></div>
    118118
    119119<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
    120120<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
  • wp-content/themes/twentyten/loop-single.php

     
    4646                                                        <h2><?php printf( __( 'About %s', 'twentyten' ), get_the_author() ); ?></h2>
    4747                                                        <?php the_author_meta( 'description' ); ?>
    4848                                                        <div id="author-link">
    49                                                                 <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" rel="author">
     49                                                                <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
    5050                                                                        <?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'twentyten' ), get_the_author() ); ?>
    5151                                                                </a>
    5252                                                        </div><!-- #author-link -->
  • wp-content/themes/twentyten/loop.php

     
    8181                                                        <a class="size-thumbnail" href="<?php the_permalink(); ?>"><?php echo wp_get_attachment_image( $image, 'thumbnail' ); ?></a>
    8282                                                </div><!-- .gallery-thumb -->
    8383                                                <p><em><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'twentyten' ),
    84                                                                 'href="' . get_permalink() . '" title="' . esc_attr( sprintf( __( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ) ) . '" rel="bookmark"',
     84                                                                'href="' . esc_url( get_permalink() ) . '" title="' . esc_attr( sprintf( __( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ) ) . '" rel="bookmark"',
    8585                                                                number_format_i18n( $total_images )
    8686                                                        ); ?></em></p>
    8787                                <?php endif; // end twentyten_get_gallery_images() check ?>
     
    9191
    9292                        <div class="entry-utility">
    9393                        <?php if ( function_exists( 'get_post_format' ) && 'gallery' == get_post_format( $post->ID ) ) : ?>
    94                                 <a href="<?php echo get_post_format_link( 'gallery' ); ?>" title="<?php esc_attr_e( 'View Galleries', 'twentyten' ); ?>"><?php _e( 'More Galleries', 'twentyten' ); ?></a>
     94                                <a href="<?php echo esc_url( get_post_format_link( 'gallery' ) ); ?>" title="<?php esc_attr_e( 'View Galleries', 'twentyten' ); ?>"><?php _e( 'More Galleries', 'twentyten' ); ?></a>
    9595                                <span class="meta-sep">|</span>
    9696                        <?php elseif ( $gallery = get_term_by( 'slug', _x( 'gallery', 'gallery category slug', 'twentyten' ), 'category' ) && in_category( $gallery->term_id ) ) : ?>
    97                                 <a href="<?php echo get_category_link( $gallery ); ?>" title="<?php esc_attr_e( 'View posts in the Gallery category', 'twentyten' ); ?>"><?php _e( 'More Galleries', 'twentyten' ); ?></a>
     97                                <a href="<?php echo esc_url( get_category_link( $gallery ) ); ?>" title="<?php esc_attr_e( 'View posts in the Gallery category', 'twentyten' ); ?>"><?php _e( 'More Galleries', 'twentyten' ); ?></a>
    9898                                <span class="meta-sep">|</span>
    9999                        <?php endif; ?>
    100100                                <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
  • wp-content/themes/twentyten/onecolumn-page.php

     
    2323                         * If you want to overload this in a child theme then include a file
    2424                         * called loop-page.php and that will be used instead.
    2525                         */
    26                          get_template_part( 'loop', 'page' );
     26                        get_template_part( 'loop', 'page' );
    2727                        ?>
    2828
    2929                        </div><!-- #content -->
  • wp-content/themes/twentyten/search.php

     
    2020                                 * If you want to overload this in a child theme then include a file
    2121                                 * called loop-search.php and that will be used instead.
    2222                                 */
    23                                  get_template_part( 'loop', 'search' );
     23                                get_template_part( 'loop', 'search' );
    2424                                ?>
    2525<?php else : ?>
    2626                                <div id="post-0" class="post no-results not-found">
  • wp-content/themes/twentyten/style.css

     
    77Version: 1.6
    88License: GNU General Public License v2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    10 Tags: black, blue, white, two-columns, fixed-layout, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu, flexible-header
     10Tags: black, blue, white, two-columns, fixed-layout, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu, flexible-header, featured-images, featured-image-header
    1111Text Domain: twentyten
    1212*/
    1313
  • wp-content/themes/twentyten/tag.php

     
    2222 * If you want to overload this in a child theme then include a file
    2323 * called loop-tag.php and that will be used instead.
    2424 */
    25  get_template_part( 'loop', 'tag' );
     25get_template_part( 'loop', 'tag' );
    2626?>
    2727                        </div><!-- #content -->
    2828                </div><!-- #container -->