Make WordPress Core


Ignore:
Timestamp:
05/04/2010 07:01:09 AM (14 years ago)
Author:
nacin
Message:

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.

File:
1 edited

Legend:

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

    r14384 r14433  
    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.
     
    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 ' &hellip; <a href="'. get_permalink() . '">' . __('Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten') . '</a>';
    231231}
    232232add_filter( 'excerpt_more', 'twentyten_excerpt_more' );
     
    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>
     
    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}
     
    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>",
     
    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>",
     
    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>",
     
    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>",
     
    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>",
     
    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>",
     
    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 
    380     foreach ( $attachments as $k => $attachment )
     380    foreach ( $attachments as $k => $attachment ) {
    381381        if ( $attachment->ID == $post->ID )
    382382            break;
    383 
    384         $k = $k + 1;
    385  
    386         if ( isset($attachments[$k]) ) {
    387             return get_attachment_link($attachments[$k]->ID);       
    388         } else {
    389             return get_permalink($post->post_parent);
    390         }
    391 }
     383    }
     384    $k++;
     385    if ( isset( $attachments[ $k ] ) )
     386        return get_attachment_link( $attachments[ $k ]->ID );
     387    else
     388        return get_permalink( $post->post_parent );
     389}
Note: See TracChangeset for help on using the changeset viewer.