Make WordPress Core


Ignore:
Timestamp:
09/25/2013 04:49:36 PM (12 years ago)
Author:
lancewillett
Message:

Twenty Eleven: 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/twentyeleven/inc/theme-options.php

    r20936 r25625  
    1515 * @since Twenty Eleven 1.0
    1616 *
     17 * @param string $hook_suffix An admin page's hook suffix.
    1718 */
    1819function twentyeleven_admin_enqueue_scripts( $hook_suffix ) {
     
    5253    // Register our individual settings fields
    5354    add_settings_field(
    54         'color_scheme',  // Unique identifier for the field for this section
    55         __( 'Color Scheme', 'twentyeleven' ), // Setting field label
     55        'color_scheme',                             // Unique identifier for the field for this section
     56        __( 'Color Scheme', 'twentyeleven' ),       // Setting field label
    5657        'twentyeleven_settings_field_color_scheme', // Function that renders the settings field
    57         'theme_options', // Menu slug, used to uniquely identify the page; see twentyeleven_theme_options_add_page()
    58         'general' // Settings section. Same as the first argument in the add_settings_section() above
     58        'theme_options',                            // Menu slug, used to uniquely identify the page; see twentyeleven_theme_options_add_page()
     59        'general'                                   // Settings section. Same as the first argument in the add_settings_section() above
    5960    );
    6061
     
    6768 * Change the capability required to save the 'twentyeleven_options' options group.
    6869 *
    69  * @see twentyeleven_theme_options_init() First parameter to register_setting() is the name of the options group.
     70 * @see twentyeleven_theme_options_init()     First parameter to register_setting() is the name of the options group.
    7071 * @see twentyeleven_theme_options_add_page() The edit_theme_options capability is used for viewing the page.
    7172 *
     
    8485
    8586/**
    86  * Add our theme options page to the admin menu, including some help documentation.
     87 * Add a theme options page to the admin menu, including some help documentation.
    8788 *
    8889 * This function is attached to the admin_menu action hook.
     
    123124
    124125    if ( method_exists( $screen, 'add_help_tab' ) ) {
    125         // WordPress 3.3
     126        // WordPress 3.3.0
    126127        $screen->add_help_tab( array(
    127128            'title' => __( 'Overview', 'twentyeleven' ),
     
    133134        $screen->set_help_sidebar( $sidebar );
    134135    } else {
    135         // WordPress 3.2
     136        // WordPress 3.2.0
    136137        add_contextual_help( $screen, $help . $sidebar );
    137138    }
     
    139140
    140141/**
    141  * Returns an array of color schemes registered for Twenty Eleven.
     142 * Return an array of color schemes registered for Twenty Eleven.
    142143 *
    143144 * @since Twenty Eleven 1.0
     
    159160    );
    160161
     162    /**
     163     * Filter the Twenty Eleven color scheme options.
     164     *
     165     * @since Twenty Eleven 1.0
     166     *
     167     * @param array $color_scheme_options An associative array of color scheme options.
     168     */
    161169    return apply_filters( 'twentyeleven_color_schemes', $color_scheme_options );
    162170}
    163171
    164172/**
    165  * Returns an array of layout options registered for Twenty Eleven.
     173 * Return an array of layout options registered for Twenty Eleven.
    166174 *
    167175 * @since Twenty Eleven 1.0
     
    186194    );
    187195
     196    /**
     197     * Filter the Twenty Eleven layout options.
     198     *
     199     * @since Twenty Eleven 1.0
     200     *
     201     * @param array $layout_options An associative array of layout options.
     202     */
    188203    return apply_filters( 'twentyeleven_layouts', $layout_options );
    189204}
    190205
    191206/**
    192  * Returns the default options for Twenty Eleven.
    193  *
    194  * @since Twenty Eleven 1.0
     207 * Return the default options for Twenty Eleven.
     208 *
     209 * @since Twenty Eleven 1.0
     210 *
     211 * @return array An array of default theme options.
    195212 */
    196213function twentyeleven_get_default_theme_options() {
     
    204221        $default_theme_options['theme_layout'] = 'sidebar-content';
    205222
     223    /**
     224     * Filter the Twenty Eleven default options.
     225     *
     226     * @since Twenty Eleven 1.0
     227     *
     228     * @param array $default_theme_options An array of default theme options.
     229     */
    206230    return apply_filters( 'twentyeleven_default_theme_options', $default_theme_options );
    207231}
    208232
    209233/**
    210  * Returns the default link color for Twenty Eleven, based on color scheme.
    211  *
    212  * @since Twenty Eleven 1.0
    213  *
    214  * @param $string $color_scheme Color scheme. Defaults to the active color scheme.
    215  * @return $string Color.
     234 * Return the default link color for Twenty Eleven, based on color scheme.
     235 *
     236 * @since Twenty Eleven 1.0
     237 *
     238 * @param string $color_scheme Optional. Color scheme.
     239 *                             Default null (or the active color scheme).
     240 * @return string The default link color.
    216241*/
    217242function twentyeleven_get_default_link_color( $color_scheme = null ) {
     
    229254
    230255/**
    231  * Returns the options array for Twenty Eleven.
     256 * Return the options array for Twenty Eleven.
    232257 *
    233258 * @since Twenty Eleven 1.0
     
    238263
    239264/**
    240  * Renders the Color Scheme setting field.
     265 * Render the Color Scheme setting field.
    241266 *
    242267 * @since Twenty Eleven 1.3
     
    262287
    263288/**
    264  * Renders the Link Color setting field.
     289 * Render the Link Color setting field.
    265290 *
    266291 * @since Twenty Eleven 1.3
     
    279304
    280305/**
    281  * Renders the Layout setting field.
     306 * Render the Layout setting field.
    282307 *
    283308 * @since Twenty Eleven 1.3
     
    301326
    302327/**
    303  * Returns the options array for Twenty Eleven.
     328 * Return the options array for Twenty Eleven.
    304329 *
    305330 * @since Twenty Eleven 1.2
     
    325350
    326351/**
    327  * Sanitize and validate form input. Accepts an array, return a sanitized array.
     352 * Sanitize and validate form input.
     353 *
     354 * Accepts an array, return a sanitized array.
    328355 *
    329356 * @see twentyeleven_theme_options_init()
     
    331358 *
    332359 * @since Twenty Eleven 1.0
     360 *
     361 * @param array $input An array of form input.
    333362 */
    334363function twentyeleven_theme_options_validate( $input ) {
     
    350379        $output['theme_layout'] = $input['theme_layout'];
    351380
     381    /**
     382     * Filter the Twenty Eleven sanitized form input array.
     383     *
     384     * @since Twenty Eleven 1.0
     385     *
     386     * @param array $output   An array of sanitized form output.
     387     * @param array $input    An array of un-sanitized form input.
     388     * @param array $defaults An array of default theme options.
     389     */
    352390    return apply_filters( 'twentyeleven_theme_options_validate', $output, $input, $defaults );
    353391}
     
    365403        wp_enqueue_style( 'dark', get_template_directory_uri() . '/colors/dark.css', array(), null );
    366404
     405    /**
     406     * Fires after the styles for the Twenty Eleven color scheme are enqueued.
     407     *
     408     * @since Twenty Eleven 1.0
     409     *
     410     * @param string $color_scheme The color scheme.
     411     */
    367412    do_action( 'twentyeleven_enqueue_color_scheme', $color_scheme );
    368413}
     
    418463
    419464/**
    420  * Adds Twenty Eleven layout classes to the array of body classes.
    421  *
    422  * @since Twenty Eleven 1.0
     465 * Add Twenty Eleven layout classes to the array of body classes.
     466 *
     467 * @since Twenty Eleven 1.0
     468 *
     469 * @param array $existing_classes An array of existing body classes.
    423470 */
    424471function twentyeleven_layout_classes( $existing_classes ) {
     
    438485        $classes[] = $current_layout;
    439486
     487    /**
     488     * Filter the Twenty Eleven layout body classes.
     489     *
     490     * @since Twenty Eleven 1.0
     491     *
     492     * @param array  $classes        An array of body classes.
     493     * @param string $current_layout The current theme layout.
     494     */
    440495    $classes = apply_filters( 'twentyeleven_layout_classes', $classes, $current_layout );
    441496
     
    447502 * Implements Twenty Eleven theme options into Theme Customizer
    448503 *
    449  * @param $wp_customize Theme Customizer object
     504 * @since Twenty Eleven 1.3
     505 *
     506 * @param object $wp_customize Theme Customizer object.
    450507 * @return void
    451508 *
    452  * @since Twenty Eleven 1.3
    453509 */
    454510function twentyeleven_customize_register( $wp_customize ) {
     
    522578/**
    523579 * Bind JS handlers to make Theme Customizer preview reload changes asynchronously.
     580 *
    524581 * Used with blogname and blogdescription.
    525582 *
Note: See TracChangeset for help on using the changeset viewer.