From 4a47793d2c5848aea6f1b6c49c18d8e0513530a0 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Fri, 21 May 2010 18:56:27 +0000 Subject: [PATCH] In Twenty Ten, final pass on inline docs et al. props jorbin, zeo. fixes #12695. git-svn-id: https://develop.svn.wordpress.org/trunk@14786 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-content/themes/twentyten/attachment.php | 4 +- wp-content/themes/twentyten/author.php | 4 +- wp-content/themes/twentyten/comments.php | 8 ++-- .../themes/twentyten/editor-style-rtl.css | 6 +++ wp-content/themes/twentyten/editor-style.css | 6 +++ wp-content/themes/twentyten/footer.php | 12 +++-- wp-content/themes/twentyten/functions.php | 44 +++++++++---------- wp-content/themes/twentyten/header.php | 38 +++++++++++----- wp-content/themes/twentyten/loop.php | 18 +++++--- wp-content/themes/twentyten/search.php | 2 +- wp-content/themes/twentyten/single.php | 4 +- 11 files changed, 93 insertions(+), 53 deletions(-) diff --git a/wp-content/themes/twentyten/attachment.php b/wp-content/themes/twentyten/attachment.php index 087db8d07e..49e5c8ea9e 100644 --- a/wp-content/themes/twentyten/attachment.php +++ b/wp-content/themes/twentyten/attachment.php @@ -51,7 +51,7 @@ $metadata['height'] ) ); - } + } ?> | ', '' ); ?> @@ -82,7 +82,7 @@ - +
post_excerpt ) ) the_excerpt(); ?>
→', 'twentyten' ) ); ?> diff --git a/wp-content/themes/twentyten/author.php b/wp-content/themes/twentyten/author.php index bf36a2bc4a..c60744f2c0 100644 --- a/wp-content/themes/twentyten/author.php +++ b/wp-content/themes/twentyten/author.php @@ -32,12 +32,12 @@ if ( get_the_author_meta( 'description' ) ) : ?>
-
+

- +
- + - +
    @@ -59,7 +59,7 @@ +

    - + diff --git a/wp-content/themes/twentyten/editor-style-rtl.css b/wp-content/themes/twentyten/editor-style-rtl.css index 8858fffe04..2c69a7c508 100644 --- a/wp-content/themes/twentyten/editor-style-rtl.css +++ b/wp-content/themes/twentyten/editor-style-rtl.css @@ -1,3 +1,9 @@ +/* +Theme Name: Twenty Ten +*/ +/* +Used to style the TinyMCE editor. +*/ html .mceContentBody{ direction:rtl; unicode-bidi:embed; diff --git a/wp-content/themes/twentyten/editor-style.css b/wp-content/themes/twentyten/editor-style.css index 57a793872d..d8cae0ac98 100644 --- a/wp-content/themes/twentyten/editor-style.css +++ b/wp-content/themes/twentyten/editor-style.css @@ -1,3 +1,9 @@ +/* +Theme Name: Twenty Ten +*/ +/* +Used to style the TinyMCE editor. +*/ html .mceContentBody { max-width:640px; } diff --git a/wp-content/themes/twentyten/footer.php b/wp-content/themes/twentyten/footer.php index f6caf89421..61f2d9480e 100644 --- a/wp-content/themes/twentyten/footer.php +++ b/wp-content/themes/twentyten/footer.php @@ -26,7 +26,7 @@ - +
    @@ -34,14 +34,20 @@ title="" rel="generator"> -
    + - + + * tag of your theme, or you will break many plugins, which + * generally use this hook to reference JavaScript files. + */ + wp_footer(); +?> diff --git a/wp-content/themes/twentyten/functions.php b/wp-content/themes/twentyten/functions.php index e91c88d079..3f697becf4 100644 --- a/wp-content/themes/twentyten/functions.php +++ b/wp-content/themes/twentyten/functions.php @@ -31,7 +31,7 @@ * } * * - * For more information on hooks, see http://codex.wordpress.org/Plugin_API. + * For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API. * * @package WordPress * @subpackage Twenty_Ten @@ -110,7 +110,8 @@ function twentyten_setup() { define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyten_header_image_height', 198 ) ); // We'll be using post thumbnails for custom header images on posts and pages. - // We want them to be 940 pixels wide by 198 pixels tall (larger images will be auto-cropped to fit). + // We want them to be 940 pixels wide by 198 pixels tall. + // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php. set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true ); // Don't support text inside the header image. @@ -133,43 +134,43 @@ function twentyten_setup() { 'cherryblossom' => array( 'url' => '%s/images/headers/cherryblossoms.jpg', 'thumbnail_url' => '%s/images/headers/cherryblossoms-thumbnail.jpg', - /* translators: header image description */ + /* translators: header image description */ 'description' => __( 'Cherry Blossoms', 'twentyten' ) ), 'concave' => array( 'url' => '%s/images/headers/concave.jpg', 'thumbnail_url' => '%s/images/headers/concave-thumbnail.jpg', - /* translators: header image description */ + /* translators: header image description */ 'description' => __( 'Concave', 'twentyten' ) ), 'fern' => array( 'url' => '%s/images/headers/fern.jpg', 'thumbnail_url' => '%s/images/headers/fern-thumbnail.jpg', - /* translators: header image description */ + /* translators: header image description */ 'description' => __( 'Fern', 'twentyten' ) ), 'forestfloor' => array( 'url' => '%s/images/headers/forestfloor.jpg', 'thumbnail_url' => '%s/images/headers/forestfloor-thumbnail.jpg', - /* translators: header image description */ + /* translators: header image description */ 'description' => __( 'Forest Floor', 'twentyten' ) ), 'inkwell' => array( 'url' => '%s/images/headers/inkwell.jpg', 'thumbnail_url' => '%s/images/headers/inkwell-thumbnail.jpg', - /* translators: header image description */ + /* translators: header image description */ 'description' => __( 'Inkwell', 'twentyten' ) ), 'path' => array( 'url' => '%s/images/headers/path.jpg', 'thumbnail_url' => '%s/images/headers/path-thumbnail.jpg', - /* translators: header image description */ + /* translators: header image description */ 'description' => __( 'Path', 'twentyten' ) ), 'sunset' => array( 'url' => '%s/images/headers/sunset.jpg', 'thumbnail_url' => '%s/images/headers/sunset-thumbnail.jpg', - /* translators: header image description */ + /* translators: header image description */ 'description' => __( 'Sunset', 'twentyten' ) ) ) ); @@ -288,7 +289,7 @@ function twentyten_comment( $comment, $args, $depth ) {
    says:', 'twentyten' ), sprintf( '%s', get_comment_author_link() ) ); ?> -
    + comment_approved == '0' ) : ?>
    @@ -299,14 +300,14 @@ function twentyten_comment( $comment, $args, $depth ) { /* translators: 1: date, 2: time */ printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(), get_comment_time() ); ?> - +
    $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> -
    - + +
  1. @@ -325,7 +326,7 @@ endif; * @uses register_sidebar */ function twentyten_widgets_init() { - // Area 1 + // Area 1, located at the top of the sidebar. register_sidebar( array( 'name' => __( 'Primary Widget Area', 'twentyten' ), 'id' => 'primary-widget-area', @@ -336,7 +337,7 @@ function twentyten_widgets_init() { 'after_title' => '', ) ); - // Area 2 + // Area 2, located below the Primary Widget Area in the sidebar. Empty by default. register_sidebar( array( 'name' => __( 'Secondary Widget Area', 'twentyten' ), 'id' => 'secondary-widget-area', @@ -347,7 +348,7 @@ function twentyten_widgets_init() { 'after_title' => '', ) ); - // Area 3 + // Area 3, located in the footer. Empty by default. register_sidebar( array( 'name' => __( 'First Footer Widget Area', 'twentyten' ), 'id' => 'first-footer-widget-area', @@ -358,7 +359,7 @@ function twentyten_widgets_init() { 'after_title' => '', ) ); - // Area 4 + // Area 4, located in the footer. Empty by default. register_sidebar( array( 'name' => __( 'Second Footer Widget Area', 'twentyten' ), 'id' => 'second-footer-widget-area', @@ -369,7 +370,7 @@ function twentyten_widgets_init() { 'after_title' => '', ) ); - // Area 5 + // Area 5, located in the footer. Empty by default. register_sidebar( array( 'name' => __( 'Third Footer Widget Area', 'twentyten' ), 'id' => 'third-footer-widget-area', @@ -380,7 +381,7 @@ function twentyten_widgets_init() { 'after_title' => '', ) ); - // Area 6 + // Area 6, located in the footer. Empty by default. register_sidebar( array( 'name' => __( 'Fourth Footer Widget Area', 'twentyten' ), 'id' => 'fourth-footer-widget-area', @@ -422,13 +423,12 @@ function twentyten_posted_on() { esc_attr( get_the_time() ), get_the_date() ), - sprintf( ' %3$s', + sprintf( ' %3$s', get_author_posts_url( get_the_author_meta( 'ID' ) ), sprintf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ), get_the_author() ) ); - } endif; @@ -453,6 +453,6 @@ function twentyten_posted_in() { $tag_list, get_permalink(), the_title_attribute( 'echo=0' ) - ); + ); } endif; diff --git a/wp-content/themes/twentyten/header.php b/wp-content/themes/twentyten/header.php index b23e361d9c..9075db46a3 100644 --- a/wp-content/themes/twentyten/header.php +++ b/wp-content/themes/twentyten/header.php @@ -13,30 +13,44 @@ - <?php - if ( is_single() ) { + <?php // Returns the title based on what is being viewed + if ( is_single() ) { // single posts single_post_title(); echo ' | '; bloginfo( 'name' ); + // The home page or, if using a static front page, the blog posts page. } elseif ( is_home() || is_front_page() ) { - bloginfo( 'name' ); - if( get_bloginfo( 'description' ) ) - echo ' | ' ; bloginfo( 'description' ); + bloginfo( 'name' ); + if( get_bloginfo( 'description' ) ) + echo ' | ' ; bloginfo( 'description' ); twentyten_the_page_number(); - } elseif ( is_page() ) { + } elseif ( is_page() ) { // WordPress Pages single_post_title( '' ); echo ' | '; bloginfo( 'name' ); - } elseif ( is_search() ) { + } elseif ( is_search() ) { // Search results printf( __( 'Search results for %s', 'twentyten' ), '"'.get_search_query().'"' ); twentyten_the_page_number(); echo ' | '; bloginfo( 'name' ); - } elseif ( is_404() ) { + } elseif ( is_404() ) { // 404 (Not Found) _e( 'Not Found', 'twentyten' ); echo ' | '; bloginfo( 'name' ); - } else { + } else { // Otherwise: wp_title( '' ); echo ' | '; bloginfo( 'name' ); twentyten_the_page_number(); } ?> - - + + * tag of your theme, or you will break many plugins, which + * generally use this hook to add elements to such + * as styles, scripts, and meta tags. + */ + + wp_head(); +?> > @@ -66,7 +80,9 @@ diff --git a/wp-content/themes/twentyten/loop.php b/wp-content/themes/twentyten/loop.php index 74a3fc40b2..b31d30f4bf 100644 --- a/wp-content/themes/twentyten/loop.php +++ b/wp-content/themes/twentyten/loop.php @@ -7,6 +7,12 @@ * http://codex.wordpress.org/Template_Tags to understand * the tags used in it. * + * This can be overridden in child themes with loop.php or + * loop-template.php, where 'template' is the loop context + * requested by a template. For example, loop-index.php would + * be used if it exists and we ask for the loop with: + * get_template_part( 'loop', 'index' ); + * * @package WordPress * @subpackage Twenty_Ten * @since Twenty Ten 1.0 @@ -68,7 +74,7 @@ $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' ); ?> - +

    %2$s photos.', 'twentyten' ), 'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"', $total_images @@ -82,8 +88,8 @@ | | ', '' ); ?> - - + + @@ -105,8 +111,8 @@ | | ', '' ); ?> - - + + @@ -147,7 +153,7 @@ | ', '' ); ?> - + diff --git a/wp-content/themes/twentyten/search.php b/wp-content/themes/twentyten/search.php index e8dcc14694..38560b9e3f 100644 --- a/wp-content/themes/twentyten/search.php +++ b/wp-content/themes/twentyten/search.php @@ -29,7 +29,7 @@

    - + diff --git a/wp-content/themes/twentyten/single.php b/wp-content/themes/twentyten/single.php index ac15e28123..7a330fd30f 100644 --- a/wp-content/themes/twentyten/single.php +++ b/wp-content/themes/twentyten/single.php @@ -46,14 +46,14 @@ - +
    ', '' ); ?>
    - +