Make WordPress Core


Ignore:
Timestamp:
09/20/2013 07:33:23 PM (12 years ago)
Author:
lancewillett
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentythirteen/functions.php

    r24934 r25522  
    11<?php
    22/**
    3  * Twenty Thirteen functions and definitions.
     3 * Twenty Thirteen functions and definitions
    44 *
    55 * Sets up the theme and provides some helper functions, which are used in the
     
    1717 * instead attached to a filter or action hook.
    1818 *
    19  * For more information on hooks, actions, and filters,
    20  * see http://codex.wordpress.org/Plugin_API
     19 * For more information on hooks, actions, and filters, @link http://codex.wordpress.org/Plugin_API
    2120 *
    2221 * @package WordPress
     
    2625
    2726/**
    28  * Sets up the content width value based on the theme's design.
     27 * Set up the content width value based on the theme's design.
     28 *
    2929 * @see twentythirteen_content_width() for template-specific adjustments.
    3030 */
     
    3333
    3434/**
    35  * Adds support for a custom header image.
     35 * Add support for a custom header image.
    3636 */
    3737require get_template_directory() . '/inc/custom-header.php';
     
    4444
    4545/**
     46 * Twenty Thirteen setup.
     47 *
    4648 * Sets up theme defaults and registers the various WordPress features that
    4749 * Twenty Thirteen supports.
     
    5961 */
    6062function twentythirteen_setup() {
    61     /*
     63    /**
    6264     * Makes Twenty Thirteen available for translation.
    6365     *
     
    6971    load_theme_textdomain( 'twentythirteen', get_template_directory() . '/languages' );
    7072
    71     /*
     73    /**
    7274     * This theme styles the visual editor to resemble the theme style,
    7375     * specifically font, colors, icons, and column width.
     
    7880    add_theme_support( 'automatic-feed-links' );
    7981
    80     // Switches default core markup for search form, comment form, and comments
    81     // to output valid HTML5.
     82    /**
     83     * Switches default core markup for search form, comment form,
     84     * and comments to output valid HTML5.
     85     */
    8286    add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list' ) );
    8387
    84     /*
     88    /**
    8589     * This theme supports all available post formats by default.
    8690     * See http://codex.wordpress.org/Post_Formats
     
    9397    register_nav_menu( 'primary', __( 'Navigation Menu', 'twentythirteen' ) );
    9498
    95     /*
     99    /**
    96100     * This theme uses a custom image size for featured images, displayed on
    97101     * "standard" posts and pages.
     
    106110
    107111/**
    108  * Returns the Google font stylesheet URL, if available.
     112 * Return the Google font stylesheet URL, if available.
    109113 *
    110114 * The use of Source Sans Pro and Bitter by default is localized. For languages
     
    118122    $fonts_url = '';
    119123
    120     /* Translators: If there are characters in your language that are not
     124    /**
     125     * Translators: If there are characters in your language that are not
    121126     * supported by Source Sans Pro, translate this to 'off'. Do not translate
    122127     * into your own language.
     
    124129    $source_sans_pro = _x( 'on', 'Source Sans Pro font: on or off', 'twentythirteen' );
    125130
    126     /* Translators: If there are characters in your language that are not
     131    /**
     132     * Translators: If there are characters in your language that are not
    127133     * supported by Bitter, translate this to 'off'. Do not translate into your
    128134     * own language.
     
    150156
    151157/**
    152  * Enqueues scripts and styles for front end.
     158 * Enqueue scripts and styles for the front end.
    153159 *
    154160 * @since Twenty Thirteen 1.0
     
    157163 */
    158164function twentythirteen_scripts_styles() {
    159     // Adds JavaScript to pages with the comment form to support sites with
    160     // threaded comments (when in use).
     165    /**
     166     * Adds JavaScript to pages with the comment form to support
     167     * sites with threaded comments (when in use).
     168     */
    161169    if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
    162170        wp_enqueue_script( 'comment-reply' );
     
    185193
    186194/**
     195 * Filter the page title.
     196 *
    187197 * Creates a nicely formatted and more specific title element text for output
    188198 * in head of document, based on current view.
     
    191201 *
    192202 * @param string $title Default title text for current view.
    193  * @param string $sep Optional separator.
     203 * @param string $sep   Optional separator.
    194204 * @return string The filtered title.
    195205 */
     
    217227
    218228/**
    219  * Registers two widget areas.
     229 * Register two widget areas.
    220230 *
    221231 * @since Twenty Thirteen 1.0
     
    248258if ( ! function_exists( 'twentythirteen_paging_nav' ) ) :
    249259/**
    250  * Displays navigation to next/previous set of posts when applicable.
     260 * Display navigation to next/previous set of posts when applicable.
    251261 *
    252262 * @since Twenty Thirteen 1.0
     
    281291if ( ! function_exists( 'twentythirteen_post_nav' ) ) :
    282292/**
    283  * Displays navigation to next/previous post when applicable.
     293 * Display navigation to next/previous post when applicable.
    284294*
    285295* @since Twenty Thirteen 1.0
     
    312322if ( ! function_exists( 'twentythirteen_entry_meta' ) ) :
    313323/**
    314  * Prints HTML with meta information for current post: categories, tags, permalink, author, and date.
     324 * Print HTML with meta information for current post: categories, tags, permalink, author, and date.
    315325 *
    316326 * Create your own twentythirteen_entry_meta() to override in a child theme.
     
    352362if ( ! function_exists( 'twentythirteen_entry_date' ) ) :
    353363/**
    354  * Prints HTML with date information for current post.
     364 * Print HTML with date information for current post.
    355365 *
    356366 * Create your own twentythirteen_entry_date() to override in a child theme.
     
    358368 * @since Twenty Thirteen 1.0
    359369 *
    360  * @param boolean $echo Whether to echo the date. Default true.
     370 * @param boolean $echo (optional) Whether to echo the date. Default true.
    361371 * @return string The HTML-formatted post date.
    362372 */
     
    383393if ( ! function_exists( 'twentythirteen_the_attached_image' ) ) :
    384394/**
    385  * Prints the attached image with a link to the next attached image.
     395 * Print the attached image with a link to the next attached image.
    386396 *
    387397 * @since Twenty Thirteen 1.0
     
    390400 */
    391401function twentythirteen_the_attached_image() {
    392     $post                = get_post();
     402    /**
     403     * Filter the image attachment size to use.
     404     *
     405     * @since Twenty thirteen 1.0
     406     *
     407     * @param array $size {
     408     *     @type int The attachment height in pixels.
     409     *     @type int The attachment width in pixels.
     410     * }
     411     */
    393412    $attachment_size     = apply_filters( 'twentythirteen_attachment_size', array( 724, 724 ) );
    394413    $next_attachment_url = wp_get_attachment_url();
     414    $post                = get_post();
    395415
    396416    /**
     
    438458
    439459/**
    440  * Returns the URL from the post.
     460 * Return the post URL.
    441461 *
    442462 * @uses get_url_in_content() to get the URL in the post meta (if it exists) or
     
    457477
    458478/**
    459  * Extends the default WordPress body classes.
     479 * Extend the default WordPress body classes.
    460480 *
    461481 * Adds body classes to denote:
     
    484504
    485505/**
    486  * Adjusts content_width value for video post formats and attachment templates.
     506 * Adjust content_width value for video post formats and attachment templates.
    487507 *
    488508 * @since Twenty Thirteen 1.0
     
    516536
    517537/**
    518  * Binds JavaScript handlers to make Customizer preview reload changes
    519  * asynchronously.
    520  *
    521  * @since Twenty Thirteen 1.0
     538 * Enqueue Javascript postMessage handlers for the Customizer.
     539 *
     540 * Binds JavaScript handlers to make the Customizer preview
     541 * reload changes asynchronously.
     542 *
     543 * @since Twenty Thirteen 1.0
     544 *
     545 * @return void
    522546 */
    523547function twentythirteen_customize_preview_js() {
Note: See TracChangeset for help on using the changeset viewer.