Make WordPress Core


Ignore:
Timestamp:
05/10/2010 05:58:24 AM (15 years ago)
Author:
nbachiyski
Message:

I18n and whitespace fixes for functions.php in TwentyTen

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentyten/functions.php

    r14500 r14534  
    5151add_action( 'after_setup_theme', 'twentyten_setup' );
    5252
    53 if ( ! function_exists('twentyten_setup') ):
     53if ( ! function_exists( 'twentyten_setup' ) ):
    5454/**
    5555 * Sets up theme defaults and registers support for various WordPress features.
     
    122122
    123123    // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.
    124     register_default_headers( array (
    125         'berries' => array (
     124    register_default_headers( array(
     125        'berries' => array(
    126126            'url' => '%s/images/headers/berries.jpg',
    127127            'thumbnail_url' => '%s/images/headers/berries-thumbnail.jpg',
     128            /* translators: header image description */
    128129            'description' => __( 'Berries', 'twentyten' )
    129130        ),
    130         'cherryblossom' => array (
     131        'cherryblossom' => array(
    131132            'url' => '%s/images/headers/cherryblossoms.jpg',
    132133            'thumbnail_url' => '%s/images/headers/cherryblossoms-thumbnail.jpg',
     134            /* translators: header image description */         
    133135            'description' => __( 'Cherry Blossoms', 'twentyten' )
    134136        ),
    135         'concave' => array (
     137        'concave' => array(
    136138            'url' => '%s/images/headers/concave.jpg',
    137139            'thumbnail_url' => '%s/images/headers/concave-thumbnail.jpg',
     140            /* translators: header image description */         
    138141            'description' => __( 'Concave', 'twentyten' )
    139142        ),
    140         'fern' => array (
     143        'fern' => array(
    141144            'url' => '%s/images/headers/fern.jpg',
    142145            'thumbnail_url' => '%s/images/headers/fern-thumbnail.jpg',
     146            /* translators: header image description */         
    143147            'description' => __( 'Fern', 'twentyten' )
    144148        ),
    145         'forestfloor' => array (
     149        'forestfloor' => array(
    146150            'url' => '%s/images/headers/forestfloor.jpg',
    147151            'thumbnail_url' => '%s/images/headers/forestfloor-thumbnail.jpg',
     152            /* translators: header image description */         
    148153            'description' => __( 'Forest Floor', 'twentyten' )
    149154        ),
    150         'inkwell' => array (
     155        'inkwell' => array(
    151156            'url' => '%s/images/headers/inkwell.jpg',
    152157            'thumbnail_url' => '%s/images/headers/inkwell-thumbnail.jpg',
     158            /* translators: header image description */         
    153159            'description' => __( 'Inkwell', 'twentyten' )
    154160        ),
    155         'path' => array (
     161        'path' => array(
    156162            'url' => '%s/images/headers/path.jpg',
    157163            'thumbnail_url' => '%s/images/headers/path-thumbnail.jpg',
     164            /* translators: header image description */         
    158165            'description' => __( 'Path', 'twentyten' )
    159166        ),
    160         'sunset' => array (
     167        'sunset' => array(
    161168            'url' => '%s/images/headers/sunset.jpg',
    162169            'thumbnail_url' => '%s/images/headers/sunset-thumbnail.jpg',
     170            /* translators: header image description */         
    163171            'description' => __( 'Sunset', 'twentyten' )
    164172        )
     
    201209    global $paged; // Contains page number.
    202210    if ( $paged >= 2 )
    203         echo ' | ' . sprintf( __( 'Page %s' , 'twentyten' ), $paged );
     211        echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), $paged );
    204212}
    205213endif;
     
    267275 */
    268276function twentyten_comment( $comment, $args, $depth ) {
    269     $GLOBALS ['comment'] = $comment; ?>
     277    $GLOBALS['comment'] = $comment; ?>
    270278    <?php if ( '' == $comment->comment_type ) : ?>
    271279    <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
     
    273281        <div class="comment-author vcard">
    274282            <?php echo get_avatar( $comment, 40 ); ?>
    275             <?php printf( __( '<cite class="fn">%s</cite> <span class="says">says:</span>', 'twentyten' ), get_comment_author_link() ); ?>
     283            <?php printf( __( '%s <span class="says">says:</span>', 'twentyten' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?>
    276284        </div>
    277285        <?php if ( $comment->comment_approved == '0' ) : ?>
     
    280288        <?php endif; ?>
    281289
    282         <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>
     290        <div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
     291            <?php
     292                /* translators: 1: date, 2: time */
     293                printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(),  get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' );
     294            ?>
     295        </div>
    283296
    284297        <div class="comment-body"><?php comment_text(); ?></div>
     
    291304    <?php else : ?>
    292305    <li class="post pingback">
    293         <p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link ( __('(Edit)', 'twentyten'), ' ' ); ?></p>
     306        <p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __('(Edit)', 'twentyten'), ' ' ); ?></p>
    294307    <?php endif;
    295308}
     
    305318function twentyten_widgets_init() {
    306319    // Area 1
    307     register_sidebar( array (
     320    register_sidebar( array(
    308321        'name' => __( 'Primary Widget Area', 'twentyten' ),
    309322        'id' => 'primary-widget-area',
    310323        'description' => __( 'The primary widget area', 'twentyten' ),
    311324        'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
    312         'after_widget' => "</li>",
     325        'after_widget' => '</li>',
    313326        'before_title' => '<h3 class="widget-title">',
    314327        'after_title' => '</h3>',
     
    316329
    317330    // Area 2
    318     register_sidebar( array (
     331    register_sidebar( array(
    319332        'name' => __( 'Secondary Widget Area', 'twentyten' ),
    320333        'id' => 'secondary-widget-area',
    321334        'description' => __( 'The secondary widget area', 'twentyten' ),
    322335        'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
    323         'after_widget' => "</li>",
     336        'after_widget' => '</li>',
    324337        'before_title' => '<h3 class="widget-title">',
    325338        'after_title' => '</h3>',
     
    327340
    328341    // Area 3
    329     register_sidebar( array (
     342    register_sidebar( array(
    330343        'name' => __( 'First Footer Widget Area', 'twentyten' ),
    331344        'id' => 'first-footer-widget-area',
    332345        'description' => __( 'The first footer widget area', 'twentyten' ),
    333346        'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
    334         'after_widget' => "</li>",
     347        'after_widget' => '</li>',
    335348        'before_title' => '<h3 class="widget-title">',
    336349        'after_title' => '</h3>',
     
    338351
    339352    // Area 4
    340     register_sidebar( array (
     353    register_sidebar( array(
    341354        'name' => __( 'Second Footer Widget Area', 'twentyten' ),
    342355        'id' => 'second-footer-widget-area',
    343356        'description' => __( 'The second footer widget area', 'twentyten' ),
    344357        'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
    345         'after_widget' => "</li>",
     358        'after_widget' => '</li>',
    346359        'before_title' => '<h3 class="widget-title">',
    347360        'after_title' => '</h3>',
     
    349362
    350363    // Area 5
    351     register_sidebar( array (
     364    register_sidebar( array(
    352365        'name' => __( 'Third Footer Widget Area', 'twentyten' ),
    353366        'id' => 'third-footer-widget-area',
    354367        'description' => __( 'The third footer widget area', 'twentyten' ),
    355368        'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
    356         'after_widget' => "</li>",
     369        'after_widget' => '</li>',
    357370        'before_title' => '<h3 class="widget-title">',
    358371        'after_title' => '</h3>',
     
    360373
    361374    // Area 6
    362     register_sidebar( array (
     375    register_sidebar( array(
    363376        'name' => __( 'Fourth Footer Widget Area', 'twentyten' ),
    364377        'id' => 'fourth-footer-widget-area',
    365378        'description' => __( 'The fourth footer widget area', 'twentyten' ),
    366379        'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
    367         'after_widget' => "</li>",
     380        'after_widget' => '</li>',
    368381        'before_title' => '<h3 class="widget-title">',
    369382        'after_title' => '</h3>',
     
    386399function twentyten_get_next_attachment_url() {
    387400    global $post;
    388     $post = get_post($post);
     401    $post = get_post( $post );
    389402    $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' ) ) );
    390403 
Note: See TracChangeset for help on using the changeset viewer.