Make WordPress Core

Changeset 25627


Ignore:
Timestamp:
09/25/2013 05:03:34 PM (12 years ago)
Author:
lancewillett
Message:

Twenty Ten: update code comments to reflect WP inline docs standards. Props DrewAPicture, closes #25256.

Location:
trunk/src/wp-content/themes/twentyten
Files:
21 edited

Legend:

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

    r15226 r25627  
    11<?php
    22/**
    3  * The template for displaying 404 pages (Not Found).
     3 * Template for displaying 404 pages (Not Found)
    44 *
    55 * @package WordPress
  • trunk/src/wp-content/themes/twentyten/archive.php

    r19241 r25627  
    11<?php
    22/**
    3  * The template for displaying Archive pages.
     3 * Template for displaying Archive pages
    44 *
    55 * Used to display archive-type pages if nothing more specific matches a query.
    66 * For example, puts together date-based pages if no date.php file exists.
    77 *
    8  * Learn more: http://codex.wordpress.org/Template_Hierarchy
     8 * @link http://codex.wordpress.org/Template_Hierarchy
    99 *
    1010 * @package WordPress
     
    1919
    2020<?php
    21     /* Queue the first post, that way we know
     21    /**
     22     * Queue the first post, that way we know
    2223     * what date we're dealing with (if that is the case).
    2324     *
     
    4243
    4344<?php
    44     /* Since we called the_post() above, we need to
     45    /**
     46     * Since we called the_post() above, we need to
    4547     * rewind the loop back to the beginning that way
    4648     * we can run the loop properly, in full.
     
    4850    rewind_posts();
    4951
    50     /* Run the loop for the archives page to output the posts.
     52    /**
     53     * Run the loop for the archives page to output the posts.
    5154     * If you want to overload this in a child theme then include a file
    5255     * called loop-archive.php and that will be used instead.
  • trunk/src/wp-content/themes/twentyten/attachment.php

    r17340 r25627  
    11<?php
    22/**
    3  * The template for displaying attachments.
     3 * Template for displaying attachments
    44 *
    55 * @package WordPress
     
    1414
    1515            <?php
    16             /* Run the loop to output the attachment.
     16            /**
     17             * Run the loop to output the attachment.
    1718             * If you want to overload this in a child theme then include a file
    1819             * called loop-attachment.php and that will be used instead.
  • trunk/src/wp-content/themes/twentyten/author.php

    r15226 r25627  
    11<?php
    22/**
    3  * The template for displaying Author Archive pages.
     3 * Template for displaying Author Archive pages
    44 *
    55 * @package WordPress
     
    1414
    1515<?php
    16     /* Queue the first post, that way we know who
     16    /**
     17     * Queue the first post, that way we know who
    1718     * the author is when we try to get their name,
    1819     * URL, description, avatar, etc.
     
    3233                    <div id="entry-author-info">
    3334                        <div id="author-avatar">
    34                             <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?>
     35                            <?php
     36                            /**
     37                             * Filter the Twenty Ten author bio avatar size.
     38                             *
     39                             * @since Twenty Ten 1.0
     40                             *
     41                             * @param int The height and width avatar dimensions in pixels. Default 60.
     42                             */
     43                            echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) );
     44                            ?>
    3545                        </div><!-- #author-avatar -->
    3646                        <div id="author-description">
     
    4252
    4353<?php
    44     /* Since we called the_post() above, we need to
     54    /**
     55     * Since we called the_post() above, we need to
    4556     * rewind the loop back to the beginning that way
    4657     * we can run the loop properly, in full.
     
    4859    rewind_posts();
    4960
    50     /* Run the loop for the author archive page to output the authors posts
     61    /**
     62     * Run the loop for the author archive page to output the authors posts
    5163     * If you want to overload this in a child theme then include a file
    5264     * called loop-author.php and that will be used instead.
  • trunk/src/wp-content/themes/twentyten/category.php

    r15226 r25627  
    11<?php
    22/**
    3  * The template for displaying Category Archive pages.
     3 * Template for displaying Category Archive pages
    44 *
    55 * @package WordPress
     
    2121                        echo '<div class="archive-meta">' . $category_description . '</div>';
    2222
    23                 /* Run the loop for the category page to output the posts.
     23                /**
     24                 * Run the loop for the category page to output the posts.
    2425                 * If you want to overload this in a child theme then include a file
    2526                 * called loop-category.php and that will be used instead.
  • trunk/src/wp-content/themes/twentyten/comments.php

    r22621 r25627  
    11<?php
    22/**
    3  * The template for displaying Comments.
     3 * Template for displaying Comments
    44 *
    55 * The area of the page that contains both current comments
     
    1919            </div><!-- #comments -->
    2020<?php
    21         /* Stop the rest of comments.php from being processed,
     21        /**
     22         * Stop the rest of comments.php from being processed,
    2223         * but don't kill the script entirely -- we still have
    2324         * to fully load the template.
     
    4647            <ol class="commentlist">
    4748                <?php
    48                     /* Loop through and list the comments. Tell wp_list_comments()
     49                    /**
     50                     * Loop through and list the comments. Tell wp_list_comments()
    4951                     * to use twentyten_comment() to format the comments.
    5052                     * If you want to overload this in a child theme then you can
     
    6466
    6567    <?php
    66     /* If there are no comments and comments are closed, let's leave a little note, shall we?
     68    /**
     69     * If there are no comments and comments are closed, let's leave a little note, shall we?
    6770     * But we only want the note on posts and pages that had comments in the first place.
    6871     */
  • trunk/src/wp-content/themes/twentyten/footer.php

    r22214 r25627  
    11<?php
    22/**
    3  * The template for displaying the footer.
     3 * Template for displaying the footer
    44 *
    55 * Contains the closing of the id=main div and all content
     
    1717
    1818<?php
    19     /* A sidebar in the footer? Yep. You can can customize
     19    /**
     20     * A sidebar in the footer? Yep. You can can customize
    2021     * your footer with four columns of widgets.
    2122     */
     
    3031
    3132            <div id="site-generator">
    32                 <?php do_action( 'twentyten_credits' ); ?>
     33                <?php
     34                /**
     35                 * Fires before the Twenty Ten credits in the footer.
     36                 *
     37                 * @since Twenty Ten 1.0
     38                 */
     39                do_action( 'twentyten_credits' ); ?>
    3340                <a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentyten' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentyten' ); ?>"><?php printf( __( 'Proudly powered by %s.', 'twentyten' ), 'WordPress' ); ?></a>
    3441            </div><!-- #site-generator -->
     
    4047
    4148<?php
    42     /* Always have wp_footer() just before the closing </body>
     49    /**
     50     * Always have wp_footer() just before the closing </body>
    4351     * tag of your theme, or you will break many plugins, which
    4452     * generally use this hook to reference JavaScript files.
  • trunk/src/wp-content/themes/twentyten/functions.php

    r24195 r25627  
    5353if ( ! function_exists( 'twentyten_setup' ) ):
    5454/**
    55  * Sets up theme defaults and registers support for various WordPress features.
     55 * Set up theme defaults and registers support for various WordPress features.
    5656 *
    5757 * Note that this function is hooked into the after_setup_theme hook, which runs
     
    6262 * functions.php file.
    6363 *
    64  * @uses add_theme_support() To add support for post thumbnails, custom headers and backgrounds, and automatic feed links.
    65  * @uses register_nav_menus() To add support for navigation menus.
    66  * @uses add_editor_style() To style the visual editor.
    67  * @uses load_theme_textdomain() For translation/localization support.
     64 * @uses add_theme_support()        To add support for post thumbnails, custom headers and backgrounds, and automatic feed links.
     65 * @uses register_nav_menus()       To add support for navigation menus.
     66 * @uses add_editor_style()         To style the visual editor.
     67 * @uses load_theme_textdomain()    For translation/localization support.
    6868 * @uses register_default_headers() To register the default custom header images provided with the theme.
    69  * @uses set_post_thumbnail_size() To set a custom post thumbnail size.
     69 * @uses set_post_thumbnail_size()  To set a custom post thumbnail size.
    7070 *
    7171 * @since Twenty Ten 1.0
     
    8585    add_theme_support( 'automatic-feed-links' );
    8686
    87     // Make theme available for translation
    88     // Translations can be filed in the /languages/ directory
     87    /**
     88     * Make theme available for translation.
     89     * Translations can be filed in the /languages/ directory
     90     */
    8991    load_theme_textdomain( 'twentyten', get_template_directory() . '/languages' );
    9092
     
    103105
    104106    $custom_header_support = array(
    105         // The default image to use.
    106         // The %s is a placeholder for the theme template directory URI.
     107        /**
     108         * The default image to use.
     109         * The %s is a placeholder for the theme template directory URI.
     110         */
    107111        'default-image' => '%s/images/headers/path.jpg',
    108112        // The height and width of our custom header.
     113        /**
     114         * Filter the Twenty Ten default header image width.
     115         *
     116         * @since Twenty Ten 1.0
     117         *
     118         * @param int The default header image width in pixels. Default 940.
     119         */
    109120        'width' => apply_filters( 'twentyten_header_image_width', 940 ),
     121        /**
     122         * Filter the Twenty Ten defaul header image height.
     123         *
     124         * @since Twenty Ten 1.0
     125         *
     126         * @param int The default header image height in pixels. Default 198.
     127         */
    110128        'height' => apply_filters( 'twentyten_header_image_height', 198 ),
    111129        // Support flexible heights.
     
    130148    }
    131149
    132     // We'll be using post thumbnails for custom header images on posts and pages.
    133     // We want them to be 940 pixels wide by 198 pixels tall.
    134     // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
     150    /**
     151     * We'll be using post thumbnails for custom header images on posts and pages.
     152     * We want them to be 940 pixels wide by 198 pixels tall.
     153     * Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
     154     */
    135155    set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true );
    136156
     
    193213if ( ! function_exists( 'twentyten_admin_header_style' ) ) :
    194214/**
    195  * Styles the header image displayed on the Appearance > Header admin panel.
     215 * Style the header image displayed on the Appearance > Header admin panel.
    196216 *
    197217 * Referenced via add_custom_image_header() in twentyten_setup().
     
    217237
    218238/**
    219  * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
     239 * Show a home link for our wp_nav_menu() fallback, wp_page_menu().
    220240 *
    221241 * To override this in a child theme, remove the filter and optionally add
     
    223243 *
    224244 * @since Twenty Ten 1.0
     245 *
     246 * @param array $args An optional array of arguments. @see wp_page_menu()
    225247 */
    226248function twentyten_page_menu_args( $args ) {
     
    232254
    233255/**
    234  * Sets the post excerpt length to 40 characters.
     256 * Set the post excerpt length to 40 characters.
    235257 *
    236258 * To override this length in a child theme, remove the filter and add your own
     
    238260 *
    239261 * @since Twenty Ten 1.0
    240  * @return int
     262 *
     263 * @param int $length The number of excerpt characters.
     264 * @return int The filtered number of excerpt characters.
    241265 */
    242266function twentyten_excerpt_length( $length ) {
     
    247271if ( ! function_exists( 'twentyten_continue_reading_link' ) ) :
    248272/**
    249  * Returns a "Continue Reading" link for excerpts
    250  *
    251  * @since Twenty Ten 1.0
    252  * @return string "Continue Reading" link
     273 * Return a "Continue Reading" link for excerpts.
     274 *
     275 * @since Twenty Ten 1.0
     276 *
     277 * @return string "Continue Reading" link.
    253278 */
    254279function twentyten_continue_reading_link() {
     
    258283
    259284/**
    260  * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and twentyten_continue_reading_link().
     285 * Replace "[...]" with an ellipsis and twentyten_continue_reading_link().
     286 *
     287 * "[...]" is appended to automatically generated excerpts.
    261288 *
    262289 * To override this in a child theme, remove the filter and add your own
     
    264291 *
    265292 * @since Twenty Ten 1.0
    266  * @return string An ellipsis
     293 *
     294 * @param string $more The Read More text.
     295 * @return string An ellipsis.
    267296 */
    268297function twentyten_auto_excerpt_more( $more ) {
     
    272301
    273302/**
    274  * Adds a pretty "Continue Reading" link to custom post excerpts.
     303 * Add a pretty "Continue Reading" link to custom post excerpts.
    275304 *
    276305 * To override this link in a child theme, remove the filter and add your own
     
    278307 *
    279308 * @since Twenty Ten 1.0
    280  * @return string Excerpt with a pretty "Continue Reading" link
     309 *
     310 * @param string $output The "Coninue Reading" link.
     311 * @return string Excerpt with a pretty "Continue Reading" link.
    281312 */
    282313function twentyten_custom_excerpt_more( $output ) {
     
    326357 *
    327358 * @since Twenty Ten 1.0
     359 *
     360 * @param object $comment The comment object.
     361 * @param array  $args    An array of arguments. @see get_comment_reply_link()
     362 * @param int    $depth   The depth of the comment.
    328363 */
    329364function twentyten_comment( $comment, $args, $depth ) {
     
    377412 *
    378413 * @since Twenty Ten 1.0
    379  * @uses register_sidebar
     414 *
     415 * @uses register_sidebar()
    380416 */
    381417function twentyten_widgets_init() {
     
    450486
    451487/**
    452  * Removes the default styles that are packaged with the Recent Comments widget.
     488 * Remove the default styles that are packaged with the Recent Comments widget.
    453489 *
    454490 * To override this in a child theme, remove the filter and optionally add your own
     
    468504if ( ! function_exists( 'twentyten_posted_on' ) ) :
    469505/**
    470  * Prints HTML with meta information for the current post-date/time and author.
     506 * Print HTML with meta information for the current post-date/time and author.
    471507 *
    472508 * @since Twenty Ten 1.0
     
    491527if ( ! function_exists( 'twentyten_posted_in' ) ) :
    492528/**
    493  * Prints HTML with meta information for the current post (category, tags and permalink).
     529 * Print HTML with meta information for the current post (category, tags and permalink).
    494530 *
    495531 * @since Twenty Ten 1.0
     
    517553
    518554/**
    519  * Retrieves the IDs for images in a gallery.
    520  *
    521  * @uses get_post_galleries() first, if available. Falls back to shortcode parsing,
    522  * then as last option uses a get_posts() call.
     555 * Retrieve the IDs for images in a gallery.
     556 *
     557 * @uses get_post_galleries() First, if available. Falls back to shortcode parsing,
     558 *                            then as last option uses a get_posts() call.
    523559 *
    524560 * @since Twenty Ten 1.6.
  • trunk/src/wp-content/themes/twentyten/header.php

    r23778 r25627  
    11<?php
    22/**
    3  * The Header for our theme.
     3 * Header template for our theme
    44 *
    5  * Displays all of the <head> section and everything up till <div id="main">
     5 * Displays all of the <head> section and everything up till <div id="main">.
    66 *
    77 * @package WordPress
     
    3838<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    3939<?php
    40     /* We add some JavaScript to pages with the comment form
     40    /**
     41     * We add some JavaScript to pages with the comment form
    4142     * to support sites with threaded comments (when in use).
    4243     */
     
    4445        wp_enqueue_script( 'comment-reply' );
    4546
    46     /* Always have wp_head() just before the closing </head>
     47    /**
     48     * Always have wp_head() just before the closing </head>
    4749     * tag of your theme, or you will break many plugins, which
    4850     * generally use this hook to add elements to <head> such
     
    6971                    // Compatibility with versions of WordPress prior to 3.4.
    7072                    if ( function_exists( 'get_custom_header' ) ) {
    71                         // We need to figure out what the minimum width should be for our featured image.
    72                         // This result would be the suggested width if the theme were to implement flexible widths.
     73                        /**
     74                         * We need to figure out what the minimum width should be for our featured image.
     75                         * This result would be the suggested width if the theme were to implement flexible widths.
     76                         */
    7377                        $header_image_width = get_theme_support( 'custom-header', 'width' );
    7478                    } else {
  • trunk/src/wp-content/themes/twentyten/index.php

    r16480 r25627  
    11<?php
    22/**
    3  * The main template file.
     3 * Main template file
    44 *
    55 * This is the most generic template file in a WordPress theme
     
    2020
    2121            <?php
    22             /* Run the loop to output the posts.
     22            /**
     23             * Run the loop to output the posts.
    2324             * If you want to overload this in a child theme then include a file
    2425             * called loop-index.php and that will be used instead.
  • trunk/src/wp-content/themes/twentyten/loop-attachment.php

    r19599 r25627  
    11<?php
    22/**
    3  * The loop that displays an attachment.
     3 * The loop that displays an attachment
    44 *
    55 * The loop displays the posts and the post content. See
     
    8787?>
    8888                        <p class="attachment"><a href="<?php echo $next_attachment_url; ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php
     89                            /**
     90                             * Filter the Twenty Ten default attachment width.
     91                             *
     92                             * @since Twenty Ten 1.0
     93                             *
     94                             * @param int The default attachment width in pixels. Default 900.
     95                             */
    8996                            $attachment_width  = apply_filters( 'twentyten_attachment_size', 900 );
     97                            /**
     98                             * Filter the Twenty Ten default attachment height.
     99                             *
     100                             * @since Twenty Ten 1.0
     101                             *
     102                             * @param int The default attachment height in pixels. Default 900.
     103                             */
    90104                            $attachment_height = apply_filters( 'twentyten_attachment_height', 900 );
    91105                            echo wp_get_attachment_image( $post->ID, array( $attachment_width, $attachment_height ) ); // filterable image width with, essentially, no limit for image height.
  • trunk/src/wp-content/themes/twentyten/loop-page.php

    r19599 r25627  
    11<?php
    22/**
    3  * The loop that displays a page.
     3 * The loop that displays a page
    44 *
    55 * The loop displays the posts and the post content. See
  • trunk/src/wp-content/themes/twentyten/loop-single.php

    r19599 r25627  
    11<?php
    22/**
    3  * The loop that displays a single post.
     3 * The loop that displays a single post
    44 *
    55 * The loop displays the posts and the post content. See
     
    3838                    <div id="entry-author-info">
    3939                        <div id="author-avatar">
    40                             <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?>
     40                            <?php
     41                            //duplicate_hook
     42                            echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) );
     43                            ?>
    4144                        </div><!-- #author-avatar -->
    4245                        <div id="author-description">
  • trunk/src/wp-content/themes/twentyten/loop.php

    r24131 r25627  
    11<?php
    22/**
    3  * The loop that displays posts.
     3 * The loop that displays posts
    44 *
    55 * The loop displays the posts and the post content. See
     
    4040
    4141<?php
    42     /* Start the Loop.
     42    /**
     43     * Start the Loop.
    4344     *
    4445     * In Twenty Ten we use the same loop in multiple contexts.
     
    5354     *
    5455     * Without further ado, the loop:
    55      */ ?>
     56     */
     57?>
    5658<?php while ( have_posts() ) : the_post(); ?>
    5759
  • trunk/src/wp-content/themes/twentyten/onecolumn-page.php

    r15762 r25627  
    1919
    2020            <?php
    21             /* Run the loop to output the page.
     21            /**
     22             * Run the loop to output the page.
    2223             * If you want to overload this in a child theme then include a file
    2324             * called loop-page.php and that will be used instead.
  • trunk/src/wp-content/themes/twentyten/page.php

    r17340 r25627  
    11<?php
    22/**
    3  * The template for displaying all pages.
     3 * Template for displaying all pages
    44 *
    55 * This is the template that displays all pages by default.
     
    1919
    2020            <?php
    21             /* Run the loop to output the page.
     21            /**
     22             * Run the loop to output the page.
    2223             * If you want to overload this in a child theme then include a file
    2324             * called loop-page.php and that will be used instead.
  • trunk/src/wp-content/themes/twentyten/search.php

    r15226 r25627  
    11<?php
    22/**
    3  * The template for displaying Search Results pages.
     3 * Template for displaying Search Results pages
    44 *
    55 * @package WordPress
     
    1616                <h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentyten' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
    1717                <?php
    18                 /* Run the loop for the search to output the results.
     18                /**
     19                 * Run the loop for the search to output the results.
    1920                 * If you want to overload this in a child theme then include a file
    2021                 * called loop-search.php and that will be used instead.
  • trunk/src/wp-content/themes/twentyten/sidebar-footer.php

    r14708 r25627  
    11<?php
    22/**
    3  * The Footer widget areas.
     3 * The Footer widget areas
    44 *
    55 * @package WordPress
     
    1010
    1111<?php
    12     /* The footer widget area is triggered if any of the areas
     12    /**
     13     * The footer widget area is triggered if any of the areas
    1314     * have widgets. So let's check that first.
    1415     *
  • trunk/src/wp-content/themes/twentyten/sidebar.php

    r16480 r25627  
    11<?php
    22/**
    3  * The Sidebar containing the primary and secondary widget areas.
     3 * Sidebar template containing the primary and secondary widget areas
    44 *
    55 * @package WordPress
     
    1313
    1414<?php
    15     /* When we call the dynamic_sidebar() function, it'll spit out
     15    /**
     16     * When we call the dynamic_sidebar() function, it'll spit out
    1617     * the widgets for that widget area. If it instead returns false,
    1718     * then the sidebar simply doesn't exist, so we'll hard-code in
  • trunk/src/wp-content/themes/twentyten/single.php

    r17340 r25627  
    11<?php
    22/**
    3  * The Template for displaying all single posts.
     3 * Template for displaying all single posts
    44 *
    55 * @package WordPress
     
    1414
    1515            <?php
    16             /* Run the loop to output the post.
     16            /**
     17             * Run the loop to output the post.
    1718             * If you want to overload this in a child theme then include a file
    1819             * called loop-single.php and that will be used instead.
  • trunk/src/wp-content/themes/twentyten/tag.php

    r15226 r25627  
    11<?php
    22/**
    3  * The template for displaying Tag Archive pages.
     3 * Template for displaying Tag Archive pages
    44 *
    55 * @package WordPress
     
    1818
    1919<?php
    20 /* Run the loop for the tag archive to output the posts
     20/**
     21 * Run the loop for the tag archive to output the posts
    2122 * If you want to overload this in a child theme then include a file
    2223 * called loop-tag.php and that will be used instead.
Note: See TracChangeset for help on using the changeset viewer.