Make WordPress Core


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.
Note: See TracChangeset for help on using the changeset viewer.