Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve inline comments per the documentation standards.

Includes minor code layout fixes for better readability.

See #48303.

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

Legend:

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

    r42343 r47122  
    2424    </div><!-- #container -->
    2525    <script type="text/javascript">
    26         // focus on search field after it has loaded
     26        // Focus on search field after it has loaded.
    2727        document.getElementById('s') && document.getElementById('s').focus();
    2828    </script>
  • trunk/src/wp-content/themes/twentyten/archive.php

    r45932 r47122  
    5050<?php
    5151    /*
    52      * Since we called the_post() above, we need to
    53      * rewind the loop back to the beginning that way
    54      * we can run the loop properly, in full.
     52     * Since we called the_post() above, we need
     53     * to rewind the loop back to the beginning.
     54     * That way we can run the loop properly, in full.
    5555     */
    5656    rewind_posts();
  • trunk/src/wp-content/themes/twentyten/author.php

    r46088 r47122  
    6666<?php
    6767    /*
    68      * Since we called the_post() above, we need to
    69      * rewind the loop back to the beginning that way
    70      * we can run the loop properly, in full.
     68     * Since we called the_post() above, we need
     69     * to rewind the loop back to the beginning.
     70     * That way we can run the loop properly, in full.
    7171     */
    7272    rewind_posts();
  • trunk/src/wp-content/themes/twentyten/comments.php

    r45609 r47122  
    5757                <div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>
    5858            </div> <!-- .navigation -->
    59     <?php endif; // check for comment navigation ?>
     59    <?php endif; // Check for comment navigation. ?>
    6060
    6161            <ol class="commentlist">
     
    7777                <div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>
    7878            </div><!-- .navigation -->
    79     <?php endif; // check for comment navigation ?>
     79    <?php endif; // Check for comment navigation. ?>
    8080
    8181    <?php
     
    8989    <?php endif; ?>
    9090
    91 <?php endif; // end have_comments() ?>
     91<?php endif; // End have_comments(). ?>
    9292
    9393<?php comment_form(); ?>
  • trunk/src/wp-content/themes/twentyten/functions.php

    r46117 r47122  
    2828 * add_action( 'after_setup_theme', 'my_child_theme_setup' );
    2929 * function my_child_theme_setup() {
    30  *     // We are providing our own filter for excerpt_length (or using the unfiltered value)
     30 *     // We are providing our own filter for excerpt_length (or using the unfiltered value).
    3131 *     remove_filter( 'excerpt_length', 'twentyten_excerpt_length' );
    3232 *     ...
     
    120120        add_theme_support( 'post-formats', array( 'aside', 'gallery' ) );
    121121
    122         // This theme uses post thumbnails
     122        // This theme uses post thumbnails.
    123123        add_theme_support( 'post-thumbnails' );
    124124
    125         // Add default posts and comments RSS feed links to head
     125        // Add default posts and comments RSS feed links to head.
    126126        add_theme_support( 'automatic-feed-links' );
    127127
    128128        /*
    129129         * Make theme available for translation.
    130          * Translations can be filed in the /languages/ directory
     130         * Translations can be filed in the /languages/ directory.
    131131         */
    132132        load_theme_textdomain( 'twentyten', get_template_directory() . '/languages' );
     
    201201        set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true );
    202202
    203         // ... and thus ends the custom header business.
     203        // ...and thus ends the custom header business.
    204204
    205205        // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.
     
    395395    return preg_replace( "#<style type='text/css'>(.*?)</style>#s", '', $css );
    396396}
    397 // Backwards compatibility with WordPress 3.0.
     397// Backward compatibility with WordPress 3.0.
    398398if ( version_compare( $GLOBALS['wp_version'], '3.1', '<' ) ) {
    399399    add_filter( 'gallery_style', 'twentyten_remove_gallery_css' );
     
    741741     * Fire the wp_body_open action.
    742742     *
    743      * Added for backwards compatibility to support pre 5.2.0 WordPress versions.
     743     * Added for backward compatibility to support pre-5.2.0 WordPress versions.
    744744     *
    745745     * @since Twenty Ten 2.9
  • trunk/src/wp-content/themes/twentyten/header.php

    r45932 r47122  
    8787                }
    8888
    89                 // Check if this is a post or page, if it has a thumbnail, and if it's a big one
     89                // Check if this is a post or page, if it has a thumbnail, and if it's a big one.
    9090                if ( is_singular() && has_post_thumbnail( $post->ID ) ) {
    9191                    $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) );
     
    106106                    <img src="<?php header_image(); ?>" width="<?php echo esc_attr( $header_image_width ); ?>" height="<?php echo esc_attr( $header_image_height ); ?>" alt="" />
    107107                    <?php
    108                 } // end check for featured image or standard header
     108                } // End check for featured image or standard header.
    109109                ?>
    110110            </div><!-- #branding -->
    111111
    112112            <div id="access" role="navigation">
    113                 <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
     113                <?php // Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. ?>
    114114                <div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyten' ); ?>"><?php _e( 'Skip to content', 'twentyten' ); ?></a></div>
    115                 <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?>
    116115                <?php
     116                /*
     117                 * Our navigation menu. If one isn't filled out, wp_nav_menu() falls back to wp_page_menu().
     118                 * The menu assigned to the primary location is the one used.
     119                 * If one isn't assigned, the menu with the lowest ID is used.
     120                 */
    117121                wp_nav_menu(
    118122                    array(
  • trunk/src/wp-content/themes/twentyten/loop-attachment.php

    r45932 r47122  
    106106            }
    107107
    108             // If there is more than 1 image attachment in a gallery
     108            // If there is more than 1 image attachment in a gallery...
    109109            if ( count( $attachments ) > 1 ) {
    110110                $k++;
    111111                if ( isset( $attachments[ $k ] ) ) {
    112                     // get the URL of the next image attachment
     112                    // ...get the URL of the next image attachment.
    113113                    $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
    114                 } else {          // or get the URL of the first image attachment
     114                } else {
     115                    // ...or get the URL of the first image attachment.
    115116                    $next_attachment_url = get_attachment_link( $attachments[0]->ID );
    116117                }
    117118            } else {
    118                 // or, if there's only 1 image attachment, get the URL of the image
     119                // Or, if there's only 1 image attachment, get the URL of the image.
    119120                $next_attachment_url = wp_get_attachment_url();
    120121            }
    121122            ?>
    122123                        <p class="attachment"><a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment">
    123                                                                     <?php
    124                                                                     /**
    125                                                                      * Filter the Twenty Ten default attachment width.
    126                                                                      *
    127                                                                      * @since Twenty Ten 1.0
    128                                                                      *
    129                                                                      * @param int The default attachment width in pixels. Default 900.
    130                                                                      */
    131                                                                     $attachment_width = apply_filters( 'twentyten_attachment_size', 900 );
    132                                                                     /**
    133                                                                      * Filter the Twenty Ten default attachment height.
    134                                                                      *
    135                                                                      * @since Twenty Ten 1.0
    136                                                                      *
    137                                                                      * @param int The default attachment height in pixels. Default 900.
    138                                                                      */
    139                                                                     $attachment_height = apply_filters( 'twentyten_attachment_height', 900 );
    140                                                                     echo wp_get_attachment_image( $post->ID, array( $attachment_width, $attachment_height ) ); // filterable image width with, essentially, no limit for image height.
    141                                                                     ?>
     124                            <?php
     125                            /**
     126                             * Filter the Twenty Ten default attachment width.
     127                             *
     128                             * @since Twenty Ten 1.0
     129                             *
     130                             * @param int The default attachment width in pixels. Default 900.
     131                             */
     132                            $attachment_width = apply_filters( 'twentyten_attachment_size', 900 );
     133                            /**
     134                             * Filter the Twenty Ten default attachment height.
     135                             *
     136                             * @since Twenty Ten 1.0
     137                             *
     138                             * @param int The default attachment height in pixels. Default 900.
     139                             */
     140                            $attachment_height = apply_filters( 'twentyten_attachment_height', 900 );
     141                            // Filterable image width with, essentially, no limit for image height.
     142                            echo wp_get_attachment_image( $post->ID, array( $attachment_width, $attachment_height ) );
     143                            ?>
    142144                            </a></p>
    143145
     
    178180
    179181<?php endwhile;
    180 }; // end of the loop. ?>
     182}; // End of the loop. ?>
  • trunk/src/wp-content/themes/twentyten/loop-page.php

    r45675 r47122  
    4646
    4747<?php endwhile;
    48 }; // end of the loop. ?>
     48}; // End of the loop. ?>
  • trunk/src/wp-content/themes/twentyten/loop-single.php

    r46088 r47122  
    4646                    </div><!-- .entry-content -->
    4747
    48         <?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries ?>
     48        <?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries. ?>
    4949                    <div id="entry-author-info">
    5050                        <div id="author-avatar">
     
    8989
    9090    <?php endwhile;
    91 }; // end of the loop. ?>
     91}; // End of the loop. ?>
  • trunk/src/wp-content/themes/twentyten/loop.php

    r45932 r47122  
    2020?>
    2121
    22 <?php /* Display navigation to next/previous pages when applicable */ ?>
     22<?php // Display navigation to next/previous pages when applicable. ?>
    2323<?php if ( $wp_query->max_num_pages > 1 ) : ?>
    2424    <div id="nav-above" class="navigation">
     
    9595                    ?>
    9696                            </em></p>
    97                 <?php endif; // end twentyten_get_gallery_images() check ?>
     97                <?php endif; // End twentyten_get_gallery_images() check. ?>
    9898                        <?php the_excerpt(); ?>
    9999<?php endif; ?>
     
    198198    <?php endif; // This was the if statement that broke the loop into three parts based on categories. ?>
    199199
    200 <?php endwhile; // End the loop. Whew. ?>
    201 
    202 <?php /* Display navigation to next/previous pages when applicable */ ?>
     200<?php endwhile; // End of the loop. Whew. ?>
     201
     202<?php // Display navigation to next/previous pages when applicable. ?>
    203203<?php if ( $wp_query->max_num_pages > 1 ) : ?>
    204204                <div id="nav-below" class="navigation">
  • trunk/src/wp-content/themes/twentyten/sidebar.php

    r42343 r47122  
    4242            </li>
    4343
    44         <?php endif; // end primary widget area ?>
     44        <?php endif; // End primary widget area. ?>
    4545            </ul>
    4646        </div><!-- #primary .widget-area -->
  • trunk/src/wp-content/themes/twentyten/tag.php

    r45932 r47122  
    2020                </h1>
    2121
    22 <?php
    23 /*
    24  * Run the loop for the tag archive to output the posts
    25  * If you want to overload this in a child theme then include a file
    26  * called loop-tag.php and that will be used instead.
    27  */
    28 get_template_part( 'loop', 'tag' );
    29 ?>
     22                <?php
     23                /*
     24                * Run the loop for the tag archive to output the posts
     25                * If you want to overload this in a child theme then include a file
     26                * called loop-tag.php and that will be used instead.
     27                */
     28                get_template_part( 'loop', 'tag' );
     29                ?>
    3030            </div><!-- #content -->
    3131        </div><!-- #container -->
Note: See TracChangeset for help on using the changeset viewer.