WordPress.org

Make WordPress Core

Ticket #12695: twenty_ten_docs.diff

File twenty_ten_docs.diff, 19.2 KB (added by jorbin, 8 years ago)

fix @subpackage, add @since for both WP and TT, general improvements

  • wp-content/themes/twentyten/searchform.php

     
    66 * when the get_search_form() template tag is used.
    77 *
    88 * @package WordPress
    9  * @subpackage Twenty Ten
    10  * @since 3.0.0
     9 * @subpackage Twenty_Ten
     10 * @since WordPress 3.0.0
     11 * @since Twenty_Ten 1.0.0
    1112 */
    1213?>
    1314
  • wp-content/themes/twentyten/footer.php

     
    66 * after.  Calls sidebar-footer.php for bottom widgets
    77 *
    88 * @package WordPress
    9  * @subpackage Twenty Ten
    10  * @since 3.0.0
     9 * @subpackage Twenty_Ten
     10 * @since WordPress 3.0.0
     11 * @since Twenty_Ten 1.0.0
    1112 */
    1213?>
    1314
     
    1516
    1617        <div id="footer">
    1718                <div id="colophon">
    18 
     19<?php /* Add our footer widget areas */  ?>
    1920<?php get_sidebar( 'footer' ); ?>
    2021
    2122                        <div id="site-info">
     
    3031        </div><!-- #footer -->
    3132
    3233</div><!-- #wrapper -->
    33 
     34<?php /* Always have wp_footer() just before the closing </body> tag of your theme if you want many plugins to work */  ?>
    3435<?php wp_footer(); ?>
    3536
    3637</body>
  • wp-content/themes/twentyten/author.php

     
    33 * The template used to display Author Archive pages
    44 *
    55 * @package WordPress
    6  * @subpackage Twenty Ten
    7  * @since 3.0.0
     6 * @subpackage Twenty_Ten
     7 * @since WordPress 3.0.0
     8 * @since Twenty_Ten 1.0.0
    89 */
    910?>
    1011
  • wp-content/themes/twentyten/sidebar-footer.php

     
    33 * The Footer widget areas
    44 *
    55 * @package WordPress
    6  * @subpackage Twenty Ten
    7  * @since 3.0.0
     6 * @subpackage Twenty_Ten
     7 * @since WordPress 3.0.0
     8 * @since Twenty_Ten 1.0.0
    89 */
    910?>
    1011
  • wp-content/themes/twentyten/search.php

     
    33 * The Search Results template
    44 *
    55 * @package WordPress
    6  * @subpackage Twenty Ten
    7  * @since 3.0.0
     6 * @subpackage Twenty_Ten
     7 * @since WordPress 3.0.0
     8 * @since Twenty_Ten 1.0.0
    89 */
    910?>
    1011
  • wp-content/themes/twentyten/404.php

     
    33 * The template for displaying 404 pages (Not Found)
    44 *
    55 * @package WordPress
    6  * @subpackage Twenty Ten
    7  * @since 3.0.0
     6 * @subpackage Twenty_Ten
     7 * @since WordPress 3.0.0
     8 * @since Twenty_Ten 1.0.0
    89 */
    910?>
    1011
  • wp-content/themes/twentyten/index.php

     
    55 *
    66 * This is the most generic template file in a WordPress theme
    77 * and one of the two required files for a theme (the other being style.css).
    8  * It is used to display a page when nothing more specific matches a query. 
     8 * It is used to display a page when nothing more specific matches a query.
    99 * E.g., it puts together the home page when no home.php file exists.
    1010 * Learn more: http://codex.wordpress.org/Template_Hierarchy
    1111 *
    1212 * @package WordPress
    13  * @subpackage Twenty Ten
    14  * @since 3.0.0
     13 * @subpackage Twenty_Ten
     14 * @since WordPress 3.0.0
     15 * @since Twenty_Ten 1.0.0
    1516 */
    16  
     17
    1718?>
    18  
     19
    1920<?php get_header(); ?>
    2021
    2122                <div id="container">
  • wp-content/themes/twentyten/functions.php

     
    3737 * For more information on hooks, see http://codex.wordpress.org/Plugin_API.
    3838 *
    3939 * @package WordPress
    40  * @subpackage Twenty Ten
    41  * @since 3.0.0
     40 * @subpackage Twenty_Ten
     41 * @since WordPress 3.0.0
     42 * @since Twenty_Ten 1.0.0
    4243 */
    4344
    4445/**
     
    7172 * @uses register_default_headers() To register the default custom header images provided with the theme.
    7273 * @uses set_post_thumbnail_size() To set a custom post thumbnail size.
    7374 *
    74  * @since 3.0.0
     75 * @since WordPress 3.0.0
     76 * @since Twenty_Ten 1.0.0
    7577 */
    7678function twentyten_setup() {
    7779
     
    110112        define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyten_header_image_height',  198 ) );
    111113
    112114        // We'll be using post thumbnails for custom header images on posts and pages.
    113         // We want them to be 940 pixels wide by 198 pixels tall (larger images will be auto-cropped to fit).
     115        // 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).
    114116        set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );
    115117
    116118        // Don't support text inside the header image.
     
    173175 *
    174176 * Referenced via add_custom_image_header() in twentyten_setup().
    175177 *
    176  * @since 3.0.0
     178 * @since WordPress 3.0.0
     179 * @since Twenty_Ten 1.0.0
    177180 */
    178181function twentyten_admin_header_style() {
    179182?>
     
    196199 *
    197200 * Used in Twenty Ten's header.php to add the page number to the <title> HTML tag.
    198201 *
    199  * @since 3.0.0
     202 * @since WordPress 3.0.0
     203 * @since Twenty_Ten 1.0.0
    200204 */
    201205function twentyten_the_page_number() {
    202206        global $paged; // Contains page number.
     
    211215 * To override this length in a child theme, remove the filter and add your own
    212216 * function tied to the excerpt_length filter hook.
    213217 *
     218 * @since WordPress 3.0.0
     219 * @since Twenty_Ten 1.0.0
     220 *
    214221 * @return int
    215222 */
    216223function twentyten_excerpt_length( $length ) {
     
    224231 * To override this link in a child theme, remove the filter and add your own
    225232 * function tied to the excerpt_more filter hook.
    226233 *
    227  * @since 3.0.0
     234 * @since WordPress 3.0.0
     235 * @since Twenty_Ten 1.0.0
    228236 * @return string A pretty 'Continue reading' link.
    229237 */
    230238function twentyten_excerpt_more( $more ) {
     
    237245 *
    238246 * Galleries are styled by the theme in Twenty Ten's style.css.
    239247 *
     248 * @since WordPress 3.0.0
     249 * @since Twenty_Ten 1.0.0
     250 *
    240251 * @return string The gallery style filter, with the styles themselves removed.
    241252 */
    242253function twentyten_remove_gallery_css( $css ) {
     
    253264 *
    254265 * Used as a callback by wp_list_comments() for displaying the comments.
    255266 *
    256  * @since 3.0.0
     267 * @since WordPress 3.0.0
     268 * @since Twenty_Ten 1.0.0
    257269 */
    258270function twentyten_comment( $comment, $args, $depth ) {
    259271        $GLOBALS ['comment'] = $comment; ?>
     
    294306 *
    295307 * @uses twentyten_term_list
    296308 *
     309 * @since WordPress 3.0.0
     310 * @since Twenty_Ten 1.0.0
     311 *
    297312 * @return string
    298313 */
    299314function twentyten_cat_list() {
     
    308323 * Returns the list of tags based on if we are or are not
    309324 * browsing a tag archive page
    310325 *
     326 * @since WordPress 3.0.0
     327 * @since Twenty_Ten 1.0.0
     328 *
    311329 * @uses twentyten_term_list
    312330 *
    313331 * @return string
     
    327345 * type of page.  If browsing a term archive page and the
    328346 * post has no other taxonomied terms, it returns empty
    329347 *
     348 * @since WordPress 3.0.0
     349 * @since Twenty_Ten 1.0.0
     350 *
    330351 * @return string
    331352 */
    332353function twentyten_term_list( $taxonomy, $glue = ', ', $text = '', $also_text = '' ) {
     
    361382 *
    362383 * To override twentyten_widgets_init() in a child theme, remove the action hook and add your own
    363384 * function tied to the init hook.
     385 *
     386 * @since WordPress 3.0.0
     387 * @since Twenty_Ten 1.0.0
     388 *
    364389 * @uses register_sidebar
    365390 */
    366391function twentyten_widgets_init() {
    367         // Area 1
     392        // Area 1 located at the top of the sidebar
    368393        register_sidebar( array (
    369394                'name' => 'Primary Widget Area',
    370395                'id' => 'primary-widget-area',
     
    375400                'after_title' => '</h3>',
    376401        ) );
    377402
    378         // Area 2
     403        // Area 2 located below the Primary Widget Area in the sidebar.  Empty by default and design
    379404        register_sidebar( array (
    380405                'name' => 'Secondary Widget Area',
    381406                'id' => 'secondary-widget-area',
     
    386411                'after_title' => '</h3>',
    387412        ) );
    388413
    389         // Area 3
     414        // Area 3 located in the footer.  Empty by default
    390415        register_sidebar( array (
    391416                'name' => 'First Footer Widget Area',
    392417                'id' => 'first-footer-widget-area',
     
    397422                'after_title' => '</h3>',
    398423        ) );
    399424
    400         // Area 4
     425        // Area 4 located in the footer.  Empty by default
    401426        register_sidebar( array (
    402427                'name' => 'Second Footer Widget Area',
    403428                'id' => 'second-footer-widget-area',
     
    408433                'after_title' => '</h3>',
    409434        ) );
    410435
    411         // Area 5
     436        // Area 5 located in the footer.  Empty by default
    412437        register_sidebar( array (
    413438                'name' => 'Third Footer Widget Area',
    414439                'id' => 'third-footer-widget-area',
     
    419444                'after_title' => '</h3>',
    420445        ) );
    421446
    422         // Area 6
     447        // Area 6 located in the footer.  Empty by default
    423448        register_sidebar( array (
    424449                'name' => 'Fourth Footer Widget Area',
    425450                'id' => 'fourth-footer-widget-area',
  • wp-content/themes/twentyten/loop.php

     
    88 * the tags used in it.
    99 *
    1010 * @package WordPress
    11  * @subpackage Twenty Ten
    12  * @since 3.0.0
     11 * @subpackage Twenty_Ten
     12 * @since WordPress 3.0.0
     13 * @since Twenty_Ten 1.0.0
    1314 */
    1415?>
    1516
  • wp-content/themes/twentyten/onecolumn-page.php

     
    66 * Selectable from a dropdown menu on the edit page screen.
    77 *
    88 * @package WordPress
    9  * @subpackage Twenty Ten
    10  * @since 3.0.0
     9 * @subpackage Twenty_Ten
     10 * @since WordPress 3.0.0
     11 * @since Twenty_Ten 1.0.0
    1112 */
    1213?>
    1314
  • wp-content/themes/twentyten/sidebar.php

     
    33 * The Sidebar containing the primary and secondary widget areas
    44 *
    55 * @package WordPress
    6  * @subpackage Twenty Ten
    7  * @since 3.0.0
     6 * @subpackage Twenty_Ten
     7 * @since WordPress 3.0.0
     8 * @since Twenty_Ten 1.0.0
    89 */
    910?>
    1011
  • wp-content/themes/twentyten/tag.php

     
    33 * The template used to display Tag Archive pages
    44 *
    55 * @package WordPress
    6  * @subpackage Twenty Ten
    7  * @since 3.0.0
     6 * @subpackage Twenty_Ten
     7 * @since WordPress 3.0.0
     8 * @since Twenty_Ten 1.0.0
    89 */
    910?>
    1011
     
    1819                                <h1 class="page-title"><?php
    1920                                        printf( __( 'Tag Archives: %s', 'twentyten' ), '<span>' . single_tag_title( '', false ) . '</span>' );
    2021                                ?></h1>
    21 
     22<?php /* Since we used the_post and single_tag_title to set our page title, we need to rewind_post to reset the loop counter and properly loop through them.   */ ?>
    2223<?php rewind_posts(); ?>
    2324
    2425<?php
  • wp-content/themes/twentyten/page.php

     
    88 * different template.
    99 *
    1010 * @package WordPress
    11  * @subpackage Twenty Ten
    12  * @since 3.0.0
     11 * @subpackage Twenty_Ten
     12 * @since WordPress 3.0.0
     13 * @since Twenty_Ten 1.0.0
    1314 */
    1415?>
    1516
     
    2324                                <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    2425                                        <?php if ( is_front_page() ) { ?>
    2526                                                <h2 class="entry-title"><?php the_title(); ?></h2>
    26                                         <?php } else { ?>       
     27                                        <?php } else { ?>
    2728                                                <h1 class="entry-title"><?php the_title(); ?></h1>
    28                                         <?php } ?>                             
     29                                        <?php } ?>
    2930
    3031                                        <div class="entry-content">
    3132                                                <?php the_content(); ?>
  • wp-content/themes/twentyten/category.php

     
    33 * The template used to display Category Archive pages
    44 *
    55 * @package WordPress
    6  * @subpackage Twenty Ten
    7  * @since 3.0.0
     6 * @subpackage Twenty_Ten
     7 * @since WordPress 3.0.0
     8 * @since Twenty_Ten 1.0.0
    89 */
    910?>
    1011
     
    1617                                <h1 class="page-title"><?php
    1718                                        printf( __( 'Category Archives: %s', 'twentyten' ), '<span>' . single_cat_title( '', false ) . '</span>' );
    1819                                ?></h1>
     20
     21                                <?php /* If a category description is set for this catagory, we display it.  If you want to remove it, you can apply a filter to archive_meta that returns an empty string */ ?>
    1922                                <?php $categorydesc = category_description(); if ( ! empty( $categorydesc ) ) echo apply_filters( 'archive_meta', '<div class="archive-meta">' . $categorydesc . '</div>' ); ?>
    2023
    2124                                <?php
  • wp-content/themes/twentyten/archive.php

     
    88 * Learn more: http://codex.wordpress.org/Template_Hierarchy
    99 *
    1010 * @package WordPress
    11  * @subpackage Twenty Ten
    12  * @since 3.0.0
     11 * @subpackage Twenty_Ten
     12 * @since WordPress 3.0.0
     13 * @since Twenty_Ten 1.0.0
    1314 */
    1415?>
    1516
  • wp-content/themes/twentyten/single.php

     
    33 * The Template used to display all single posts
    44 *
    55 * @package WordPress
    6  * @subpackage Twenty Ten
    7  * @since 3.0.0
     6 * @subpackage Twenty_Ten
     7 * @since WordPress 3.0.0
     8 * @since Twenty_Ten 1.0.0
    89 */
    910?>
    1011
  • wp-content/themes/twentyten/comments.php

     
    88 * located in the functions.php file
    99 *
    1010 * @package WordPress
    11  * @subpackage Twenty Ten
    12  * @since 3.0.0
     11 * @subpackage Twenty_Ten
     12 * @since WordPress 3.0.0
     13 * @since Twenty_Ten 1.0.0
    1314 */
    1415?>
    1516
  • wp-content/themes/twentyten/header.php

     
    55 * Displays all of the <head> section and everything up till <div id="main">
    66 *
    77 * @package WordPress
    8  * @subpackage Twenty Ten
    9  * @since 3.0.0
     8 * @subpackage Twenty_Ten
     9 * @since WordPress 3.0.0
     10 * @since Twenty_Ten 1.0.0
    1011 */
    1112?>
    1213
     
    1617        <meta charset="<?php bloginfo( 'charset' ); ?>" />
    1718        <title><?php
    1819        // Returns the title based on the type of page being viewed
    19                 if ( is_single() ) {
     20                if ( is_single() ) { // Single post pages
    2021                        single_post_title(); echo ' | '; bloginfo( 'name' );
    21                 } elseif ( is_home() || is_front_page() ) {
     22                } elseif ( is_home() || is_front_page() ) { // Both the home page and if using a static front page, the blog post page
    2223                        bloginfo( 'name' ); echo ' | '; bloginfo( 'description' ); twentyten_the_page_number();
    23                 } elseif ( is_page() ) {
     24                } elseif ( is_page() ) { // All Pages
    2425                        single_post_title( '' ); echo ' | '; bloginfo( 'name' );
    25                 } elseif ( is_search() ) {
     26                } elseif ( is_search() ) { // Search result pages
    2627                        printf( __( 'Search results for "%s"', 'twentyten' ), esc_html( $s ) ); twentyten_the_page_number(); echo ' | '; bloginfo( 'name' );
    27                 } elseif ( is_404() ) {
     28                } elseif ( is_404() ) { // 404, nothing found pages
    2829                        _e( 'Not Found', 'twentyten' ); echo ' | '; bloginfo( 'name' );
    29                 } else {
     30                } else { // Everything else
    3031                        wp_title( '' ); echo ' | '; bloginfo( 'name' ); twentyten_the_page_number();
    3132                }
    3233        ?></title>
    3334        <link rel="profile" href="http://gmpg.org/xfn/11" />
    3435        <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
    35         <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
     36        <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' );  //On pages that have comment forms, we add some javascript to make threaded comments work ?>
    3637        <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
     38        <?php /* Always have wp_head() in the </head> of your theme if you want many plugins to work */  ?>
    3739        <?php wp_head(); ?>
     40
    3841</head>
    3942
    4043<body <?php body_class(); ?>>
     
    4447                        <div id="branding">
    4548                                <?php if ( is_home() || is_front_page() ) { ?>
    4649                                        <h1 id="site-title"><span><a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span></h1>
    47                                 <?php } else { ?>       
     50                                <?php } else { ?>
    4851                                        <div id="site-title"><span><a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span></div>
    4952                                <?php } ?>
    50                                
     53
    5154                                <div id="site-description"><?php bloginfo( 'description' ); ?></div>
    5255
    5356                                <?php
    5457                                        // Retrieve the dimensions of the current post thumbnail -- no teensy header images for us!
    5558                                        $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail');
    5659                                        list($src, $width, $height) = $image;
    57                                        
     60
    5861                                        // Check if this is a post or page, if it has a thumbnail, and if it's a big one
    59                                         if ( is_singular() && has_post_thumbnail( $post->ID ) && $width >= HEADER_IMAGE_WIDTH ) :               
     62                                        if ( is_singular() && has_post_thumbnail( $post->ID ) && $width >= HEADER_IMAGE_WIDTH ) :
    6063                                                // Houston, we have a new header image!
    6164                                                echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
    6265                                        else : ?>
     
    6568                        </div><!-- #branding -->
    6669
    6770                        <div id="access">
     71                        <?php /*  Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
    6872                                <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>
     73                                <?php /* Our navigation menu.  If one isn't filled out, wp_nav_menu falls back to wp_page_menu  */ ?>
    6974                                <?php wp_nav_menu( array( 'sort_column' => 'menu_order', 'container_class' => 'menu-header' ) ); ?>
    7075                        </div><!-- #access -->
    7176                </div><!-- #masthead -->
  • wp-content/themes/twentyten/attachment.php

     
    33 * The template used to display attachments.
    44 *
    55 * @package WordPress
    6  * @subpackage Twenty Ten
    7  * @since 3.0.0
     6 * @subpackage Twenty_Ten
     7 * @since WordPress 3.0.0
     8 * @since Twenty_Ten 1.0.0
    89 */
    910?>
    1011