Changeset 14534 for trunk/wp-content/themes/twentyten/functions.php
- Timestamp:
- 05/10/2010 05:58:24 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentyten/functions.php
r14500 r14534 51 51 add_action( 'after_setup_theme', 'twentyten_setup' ); 52 52 53 if ( ! function_exists( 'twentyten_setup') ):53 if ( ! function_exists( 'twentyten_setup' ) ): 54 54 /** 55 55 * Sets up theme defaults and registers support for various WordPress features. … … 122 122 123 123 // 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( 126 126 'url' => '%s/images/headers/berries.jpg', 127 127 'thumbnail_url' => '%s/images/headers/berries-thumbnail.jpg', 128 /* translators: header image description */ 128 129 'description' => __( 'Berries', 'twentyten' ) 129 130 ), 130 'cherryblossom' => array 131 'cherryblossom' => array( 131 132 'url' => '%s/images/headers/cherryblossoms.jpg', 132 133 'thumbnail_url' => '%s/images/headers/cherryblossoms-thumbnail.jpg', 134 /* translators: header image description */ 133 135 'description' => __( 'Cherry Blossoms', 'twentyten' ) 134 136 ), 135 'concave' => array 137 'concave' => array( 136 138 'url' => '%s/images/headers/concave.jpg', 137 139 'thumbnail_url' => '%s/images/headers/concave-thumbnail.jpg', 140 /* translators: header image description */ 138 141 'description' => __( 'Concave', 'twentyten' ) 139 142 ), 140 'fern' => array 143 'fern' => array( 141 144 'url' => '%s/images/headers/fern.jpg', 142 145 'thumbnail_url' => '%s/images/headers/fern-thumbnail.jpg', 146 /* translators: header image description */ 143 147 'description' => __( 'Fern', 'twentyten' ) 144 148 ), 145 'forestfloor' => array 149 'forestfloor' => array( 146 150 'url' => '%s/images/headers/forestfloor.jpg', 147 151 'thumbnail_url' => '%s/images/headers/forestfloor-thumbnail.jpg', 152 /* translators: header image description */ 148 153 'description' => __( 'Forest Floor', 'twentyten' ) 149 154 ), 150 'inkwell' => array 155 'inkwell' => array( 151 156 'url' => '%s/images/headers/inkwell.jpg', 152 157 'thumbnail_url' => '%s/images/headers/inkwell-thumbnail.jpg', 158 /* translators: header image description */ 153 159 'description' => __( 'Inkwell', 'twentyten' ) 154 160 ), 155 'path' => array 161 'path' => array( 156 162 'url' => '%s/images/headers/path.jpg', 157 163 'thumbnail_url' => '%s/images/headers/path-thumbnail.jpg', 164 /* translators: header image description */ 158 165 'description' => __( 'Path', 'twentyten' ) 159 166 ), 160 'sunset' => array 167 'sunset' => array( 161 168 'url' => '%s/images/headers/sunset.jpg', 162 169 'thumbnail_url' => '%s/images/headers/sunset-thumbnail.jpg', 170 /* translators: header image description */ 163 171 'description' => __( 'Sunset', 'twentyten' ) 164 172 ) … … 201 209 global $paged; // Contains page number. 202 210 if ( $paged >= 2 ) 203 echo ' | ' . sprintf( __( 'Page %s' 211 echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), $paged ); 204 212 } 205 213 endif; … … 267 275 */ 268 276 function twentyten_comment( $comment, $args, $depth ) { 269 $GLOBALS 277 $GLOBALS['comment'] = $comment; ?> 270 278 <?php if ( '' == $comment->comment_type ) : ?> 271 279 <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>"> … … 273 281 <div class="comment-author vcard"> 274 282 <?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() ) ); ?> 276 284 </div> 277 285 <?php if ( $comment->comment_approved == '0' ) : ?> … … 280 288 <?php endif; ?> 281 289 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> 283 296 284 297 <div class="comment-body"><?php comment_text(); ?></div> … … 291 304 <?php else : ?> 292 305 <li class="post pingback"> 293 <p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link 306 <p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __('(Edit)', 'twentyten'), ' ' ); ?></p> 294 307 <?php endif; 295 308 } … … 305 318 function twentyten_widgets_init() { 306 319 // Area 1 307 register_sidebar( array 320 register_sidebar( array( 308 321 'name' => __( 'Primary Widget Area', 'twentyten' ), 309 322 'id' => 'primary-widget-area', 310 323 'description' => __( 'The primary widget area', 'twentyten' ), 311 324 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 312 'after_widget' => "</li>",325 'after_widget' => '</li>', 313 326 'before_title' => '<h3 class="widget-title">', 314 327 'after_title' => '</h3>', … … 316 329 317 330 // Area 2 318 register_sidebar( array 331 register_sidebar( array( 319 332 'name' => __( 'Secondary Widget Area', 'twentyten' ), 320 333 'id' => 'secondary-widget-area', 321 334 'description' => __( 'The secondary widget area', 'twentyten' ), 322 335 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 323 'after_widget' => "</li>",336 'after_widget' => '</li>', 324 337 'before_title' => '<h3 class="widget-title">', 325 338 'after_title' => '</h3>', … … 327 340 328 341 // Area 3 329 register_sidebar( array 342 register_sidebar( array( 330 343 'name' => __( 'First Footer Widget Area', 'twentyten' ), 331 344 'id' => 'first-footer-widget-area', 332 345 'description' => __( 'The first footer widget area', 'twentyten' ), 333 346 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 334 'after_widget' => "</li>",347 'after_widget' => '</li>', 335 348 'before_title' => '<h3 class="widget-title">', 336 349 'after_title' => '</h3>', … … 338 351 339 352 // Area 4 340 register_sidebar( array 353 register_sidebar( array( 341 354 'name' => __( 'Second Footer Widget Area', 'twentyten' ), 342 355 'id' => 'second-footer-widget-area', 343 356 'description' => __( 'The second footer widget area', 'twentyten' ), 344 357 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 345 'after_widget' => "</li>",358 'after_widget' => '</li>', 346 359 'before_title' => '<h3 class="widget-title">', 347 360 'after_title' => '</h3>', … … 349 362 350 363 // Area 5 351 register_sidebar( array 364 register_sidebar( array( 352 365 'name' => __( 'Third Footer Widget Area', 'twentyten' ), 353 366 'id' => 'third-footer-widget-area', 354 367 'description' => __( 'The third footer widget area', 'twentyten' ), 355 368 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 356 'after_widget' => "</li>",369 'after_widget' => '</li>', 357 370 'before_title' => '<h3 class="widget-title">', 358 371 'after_title' => '</h3>', … … 360 373 361 374 // Area 6 362 register_sidebar( array 375 register_sidebar( array( 363 376 'name' => __( 'Fourth Footer Widget Area', 'twentyten' ), 364 377 'id' => 'fourth-footer-widget-area', 365 378 'description' => __( 'The fourth footer widget area', 'twentyten' ), 366 379 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 367 'after_widget' => "</li>",380 'after_widget' => '</li>', 368 381 'before_title' => '<h3 class="widget-title">', 369 382 'after_title' => '</h3>', … … 386 399 function twentyten_get_next_attachment_url() { 387 400 global $post; 388 $post = get_post( $post);401 $post = get_post( $post ); 389 402 $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' ) ) ); 390 403
Note: See TracChangeset
for help on using the changeset viewer.