Make WordPress Core


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

Twenty Twelve: 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/twentytwelve/functions.php

    r23716 r25521  
    11<?php
    22/**
    3  * Twenty Twelve functions and definitions.
     3 * Twenty Twelve functions and definitions
    44 *
    55 * Sets up the theme and provides some helper functions, which are used
     
    1616 * to a filter or action hook.
    1717 *
    18  * For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API.
     18 * For more information on hooks, actions, and filters, @link http://codex.wordpress.org/Plugin_API
    1919 *
    2020 * @package WordPress
     
    2424
    2525/**
    26  * Sets up the content width value based on the theme's design and stylesheet.
     26 * Set up the content width value based on the theme's design and stylesheet.
    2727 */
    2828if ( ! isset( $content_width ) )
     
    3030
    3131/**
     32 * Twenty Twelve setup.
     33 *
    3234 * Sets up theme defaults and registers the various WordPress features that
    3335 * Twenty Twelve supports.
     
    4345 */
    4446function twentytwelve_setup() {
    45     /*
     47    /**
    4648     * Makes Twenty Twelve available for translation.
    4749     *
     
    6466    register_nav_menu( 'primary', __( 'Primary Menu', 'twentytwelve' ) );
    6567
    66     /*
    67      * This theme supports custom background color and image, and here
    68      * we also set up the default background color.
     68    /**
     69     * This theme supports custom background color and image,
     70     * and here we also set up the default background color.
    6971     */
    7072    add_theme_support( 'custom-background', array(
     
    7981
    8082/**
    81  * Adds support for a custom header image.
     83 * Add support for a custom header image.
    8284 */
    8385require( get_template_directory() . '/inc/custom-header.php' );
    8486
    8587/**
    86  * Returns the Google font stylesheet URL if available.
     88 * Return the Google font stylesheet URL if available.
    8789 *
    8890 * The use of Open Sans by default is localized. For languages that use
     
    9698    $font_url = '';
    9799
    98     /* translators: If there are characters in your language that are not supported
    99      by Open Sans, translate this to 'off'. Do not translate into your own language. */
     100    /**
     101     * translators: If there are characters in your language that are not supported
     102     * by Open Sans, translate this to 'off'. Do not translate into your own language.
     103     */
    100104    if ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'twentytwelve' ) ) {
    101105        $subsets = 'latin,latin-ext';
    102106
    103         /* translators: To add an additional Open Sans character subset specific to your language, translate
    104          this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language. */
     107        /**
     108         * translators: To add an additional Open Sans character subset specific to your language,
     109         * translate this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language.
     110         */
    105111        $subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)', 'twentytwelve' );
    106112
     
    124130
    125131/**
    126  * Enqueues scripts and styles for front-end.
    127  *
    128  * @since Twenty Twelve 1.0
     132 * Enqueue scripts and styles for front-end.
     133 *
     134 * @since Twenty Twelve 1.0
     135 *
     136 * @return void
    129137 */
    130138function twentytwelve_scripts_styles() {
    131139    global $wp_styles;
    132140
    133     /*
     141    /**
    134142     * Adds JavaScript to pages with the comment form to support
    135143     * sites with threaded comments (when in use).
     
    138146        wp_enqueue_script( 'comment-reply' );
    139147
    140     /*
     148    /**
    141149     * Adds JavaScript for handling the navigation menu hide-and-show behavior.
    142150     */
     
    147155        wp_enqueue_style( 'twentytwelve-fonts', esc_url_raw( $font_url ), array(), null );
    148156
    149     /*
     157    /**
    150158     * Loads our main stylesheet.
    151159     */
    152160    wp_enqueue_style( 'twentytwelve-style', get_stylesheet_uri() );
    153161
    154     /*
     162    /**
    155163     * Loads the Internet Explorer specific stylesheet.
    156164     */
     
    161169
    162170/**
     171 * Filter TinyMCE CSS path to include Google Fonts.
     172 *
    163173 * Adds additional stylesheets to the TinyMCE editor if needed.
    164174 *
     
    168178 *
    169179 * @param string $mce_css CSS path to load in TinyMCE.
    170  * @return string
     180 * @return string Filtered CSS path.
    171181 */
    172182function twentytwelve_mce_css( $mce_css ) {
     
    186196
    187197/**
     198 * Filter the page title.
     199 *
    188200 * Creates a nicely formatted and more specific title element text
    189201 * for output in head of document, based on current view.
     
    218230
    219231/**
     232 * Filter the page menu arguments.
     233 *
    220234 * Makes our wp_nav_menu() fallback -- wp_page_menu() -- show a home link.
    221235 *
     
    230244
    231245/**
     246 * Register sidebars.
     247 *
    232248 * Registers our main widget area and the front page widget areas.
    233249 *
     
    298314 *
    299315 * @since Twenty Twelve 1.0
     316 *
     317 * @return void
    300318 */
    301319function twentytwelve_comment( $comment, $args, $depth ) {
     
    354372if ( ! function_exists( 'twentytwelve_entry_meta' ) ) :
    355373/**
     374 * Set up post entry meta.
     375 *
    356376 * Prints HTML with meta information for current post: categories, tags, permalink, author, and date.
    357377 *
     
    359379 *
    360380 * @since Twenty Twelve 1.0
     381 *
     382 * @return void
    361383 */
    362384function twentytwelve_entry_meta() {
     
    400422
    401423/**
     424 * Extend the default WordPress body classes.
     425 *
    402426 * Extends the default WordPress body class to denote:
    403427 * 1. Using a full-width layout, when no active widgets in the sidebar
     
    411435 * @since Twenty Twelve 1.0
    412436 *
    413  * @param array Existing class values.
     437 * @param array $classes Existing class values.
    414438 * @return array Filtered class values.
    415439 */
     
    448472
    449473/**
     474 * Adjust content width in certain contexts.
     475 *
    450476 * Adjusts content_width value for full-width and single image attachment
    451477 * templates, and when there are no active widgets in the sidebar.
    452478 *
    453479 * @since Twenty Twelve 1.0
     480 *
     481 * @return void
    454482 */
    455483function twentytwelve_content_width() {
     
    462490
    463491/**
    464  * Add postMessage support for site title and description for the Theme Customizer.
    465  *
    466  * @since Twenty Twelve 1.0
    467  *
    468  * @param WP_Customize_Manager $wp_customize Theme Customizer object.
     492 * Register postMessage support.
     493 *
     494 * Add postMessage support for site title and description for the Customizer.
     495 *
     496 * @since Twenty Twelve 1.0
     497 *
     498 * @param WP_Customize_Manager $wp_customize Customizer object.
    469499 * @return void
    470500 */
     
    477507
    478508/**
    479  * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
    480  *
    481  * @since Twenty Twelve 1.0
     509 * Enqueue Javascript postMessage handlers for the Customizer.
     510 *
     511 * Binds JS handlers to make the Customizer preview reload changes asynchronously.
     512 *
     513 * @since Twenty Twelve 1.0
     514 *
     515 * @return void
    482516 */
    483517function twentytwelve_customize_preview_js() {
Note: See TracChangeset for help on using the changeset viewer.