Make WordPress Core

Changeset 18253


Ignore:
Timestamp:
06/10/2011 11:01:16 PM (14 years ago)
Author:
azaozz
Message:

Twenty Eleven code review and cleanup, props dd32, fixes #17748

Location:
trunk/wp-content/themes/twentyeleven
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyeleven/archive.php

    r17959 r18253  
    1818            <div id="content" role="main">
    1919
    20                 <?php
    21                     /* Queue the first post, that way we know
    22                      * what date we're dealing with (if that is the case).
    23                      *
    24                      * We reset this later so we can run the loop
    25                      * properly with a call to rewind_posts().
    26                      */
    27                     if ( have_posts() )
    28                         the_post();
    29                 ?>
    30 
    3120                <header class="page-header">
    3221                    <h1 class="page-title">
     
    4231                    </h1>
    4332                </header>
    44 
    45                 <?php
    46                     /* Since we called the_post() above, we need to
    47                      * rewind the loop back to the beginning that way
    48                      * we can run the loop properly, in full.
    49                      */
    50                     rewind_posts();
    51                 ?>
    5233
    5334                <?php twentyeleven_content_nav( 'nav-above' ); ?>
  • trunk/wp-content/themes/twentyeleven/author.php

    r18244 r18253  
    1515                <?php
    1616                    /* Queue the first post, that way we know
    17                      * what date we're dealing with (if that is the case).
     17                     * what author we're dealing with (if that is the case).
    1818                     *
    1919                     * We reset this later so we can run the loop
  • trunk/wp-content/themes/twentyeleven/content-aside.php

    r18244 r18253  
    1818            </hgroup>
    1919
    20             <?php if ( 'post' == $post->post_type ) : ?>
     20            <?php if ( 'post' == get_post_type() ) : ?>
    2121            <?php endif; ?>
    2222           
  • trunk/wp-content/themes/twentyeleven/content-image.php

    r18244 r18253  
    3030
    3131        <footer class="entry-meta">
    32             <?php if ( 'post' == $post->post_type ) : // Hide category and tag text for pages on Search ?>
     32            <?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
    3333            <div class="entry-meta">
    3434                <?php
  • trunk/wp-content/themes/twentyeleven/content-link.php

    r18244 r18253  
    1818            </hgroup>
    1919
    20             <?php if ( 'post' == $post->post_type ) : ?>
     20            <?php if ( 'post' == get_post_type() ) : ?>
    2121            <?php endif; ?>
    2222
  • trunk/wp-content/themes/twentyeleven/content-quote.php

    r18244 r18253  
    1616            </hgroup>
    1717
    18             <?php if ( 'post' == $post->post_type ) : ?>
     18            <?php if ( 'post' == get_post_type() ) : ?>
    1919            <div class="entry-meta">
    2020                <?php twentyeleven_posted_on(); ?>
     
    4242        <footer class="entry-meta">
    4343            <?php $show_sep = false; ?>
    44             <?php if ( 'post' == $post->post_type ) : // Hide category and tag text for pages on Search ?>
     44            <?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
    4545            <?php
    4646                /* translators: used between list items, there is a space after the comma */
  • trunk/wp-content/themes/twentyeleven/content-single.php

    r18244 r18253  
    1313        <h1 class="entry-title"><?php the_title(); ?></h1>
    1414
     15        <?php if ( 'post' == get_post_type() ) : /* Bit of a disconnect here, Some files include this test, not all do. */ ?>
    1516        <div class="entry-meta">
    1617            <?php twentyeleven_posted_on(); ?>
    1718        </div><!-- .entry-meta -->
     19        <?php endif; ?>
    1820    </header><!-- .entry-header -->
    1921
  • trunk/wp-content/themes/twentyeleven/content-status.php

    r18244 r18253  
    1616                <h2 class="entry-format"><?php _e( 'Status', 'twentyeleven' ); ?></h2>
    1717            </hgroup>
    18 
    19             <?php if ( 'post' == $post->post_type ) : ?>
    20             <?php endif; ?>
    2118           
    2219            <?php if ( comments_open() ) : ?>
     
    3330        <?php else : ?>
    3431        <div class="entry-content">
    35             <div class="avatar"><?php echo get_avatar( $post->post_author, apply_filters( 'twentyeleven_status_avatar', '65' ) ); ?></div>
     32            <div class="avatar"><?php echo get_avatar( get_the_author_meta( 'ID' ), apply_filters( 'twentyeleven_status_avatar', '65' ) ); ?></div>
    3633           
    3734            <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
  • trunk/wp-content/themes/twentyeleven/content.php

    r18244 r18253  
    1313            <?php if ( is_sticky() ) : ?>
    1414                <hgroup>
    15                     <h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
     15                    <h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) /* Y NO ARRAY! */ ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
    1616                    <h2 class="entry-format"><?php _e( 'Featured', 'twentyeleven' ); ?></h2>
    1717                </hgroup>
     
    2020            <?php endif; ?>
    2121
    22             <?php if ( 'post' == $post->post_type ) : ?>
     22            <?php if ( 'post' == get_post_type() ) : ?>
    2323            <div class="entry-meta">
    2424                <?php twentyeleven_posted_on(); ?>
     
    4545
    4646        <footer class="entry-meta">
    47             <?php $show_sep = false; ?>
    48             <?php if ( 'post' == $post->post_type ) : // Hide category and tag text for pages on Search ?>
     47            <?php $show_sep = false; //  perhaps a implode(' | ', $utilities) could be used instead of this $show_sep business? ?>
     48            <?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
    4949            <?php
    5050                /* translators: used between list items, there is a space after the comma */
     
    6969            </span>
    7070            <?php endif; // End if $tags_list ?>
    71             <?php endif; // End if 'post' == $post->post_type ?>
     71            <?php endif; // End if 'post' == get_post_type() ?>
    7272
    7373            <?php if ( comments_open() ) : ?>
  • trunk/wp-content/themes/twentyeleven/inc/theme-options.php

    r18235 r18253  
    1515 * @since Twenty Eleven 1.0
    1616 *
    17  * @param string $hook_suffix The action passes the current page to the function. We don't
    18  *  do anything if we're not on our theme options page.
    1917 */
    2018function twentyeleven_admin_enqueue_scripts( $hook_suffix ) {
    21     if ( $hook_suffix != 'appearance_page_theme_options' )
    22         return;
    23 
    2419    wp_enqueue_style( 'twentyeleven-theme-options', get_template_directory_uri() . '/inc/theme-options.css', false, '2011-04-28' );
    2520    wp_enqueue_script( 'twentyeleven-theme-options', get_template_directory_uri() . '/inc/theme-options.js', array( 'farbtastic' ), '2011-06-10' );
    2621    wp_enqueue_style( 'farbtastic' );
    2722}
    28 add_action( 'admin_enqueue_scripts', 'twentyeleven_admin_enqueue_scripts' );
     23add_action( 'admin_print_styles-appearance_page_theme_options', 'twentyeleven_admin_enqueue_scripts' );
    2924
    3025/**
     
    310305    // Link color must be 3 or 6 hexadecimal characters
    311306    if ( isset( $input['link_color'] ) && preg_match( '/^#?([a-f0-9]{3}){1,2}$/i', $input['link_color'] ) )
    312             $output['link_color'] = '#' . strtolower( ltrim( $input['link_color'], '#' ) );
     307        $output['link_color'] = '#' . strtolower( ltrim( $input['link_color'], '#' ) );
    313308
    314309    // Theme layout must be in our array of theme layout options
  • trunk/wp-content/themes/twentyeleven/single.php

    r18174 r18253  
    1313            <div id="content" role="main">
    1414
    15                 <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
     15                <?php while ( have_posts() ) : the_post(); ?>
    1616
    1717                    <nav id="nav-single">
Note: See TracChangeset for help on using the changeset viewer.