Make WordPress Core

Changeset 51294


Ignore:
Timestamp:
07/01/2021 12:58:34 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Twenty Twenty-One: Improve documentation per the documentation standards:

  • Remove unnecessary @access tags that were previously removed from core.
  • Remove an empty line between @param and @return tags.
  • Correct alignment of @param tags.

Follow-up to [41161], [41162], [41168], [49216], [49220].

See #52628, #53461.

Location:
trunk/src/wp-content/themes/twentytwentyone
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-custom-colors.php

    r51236 r51294  
    1515    /**
    1616     * Instantiate the object.
    17      *
    18      * @access public
    1917     *
    2018     * @since Twenty Twenty-One 1.0
     
    3533     * Determine the luminance of the given color and then return #fff or #000 so that the text is always readable.
    3634     *
    37      * @access public
     35     * @since Twenty Twenty-One 1.0
    3836     *
    3937     * @param string $background_color The background color.
    40      *
    41      * @since Twenty Twenty-One 1.0
    42      *
    4338     * @return string (hex color)
    4439     */
     
    5449     * The code below needs to be updated, because the colors are no longer theme mods.
    5550     *
    56      * @access public
    57      *
    5851     * @since Twenty Twenty-One 1.0
    5952     *
    6053     * @param string|null $context Can be "editor" or null.
    61      *
    6254     * @return string
    6355     */
     
    8880     * Customizer & frontend custom color variables.
    8981     *
    90      * @access public
    91      *
    9282     * @since Twenty Twenty-One 1.0
    9383     *
     
    10292    /**
    10393     * Editor custom color variables.
    104      *
    105      * @access public
    10694     *
    10795     * @since Twenty Twenty-One 1.0
     
    128116     * @static
    129117     *
    130      * @access public
    131      *
    132118     * @since Twenty Twenty-One 1.0
    133119     *
    134120     * @param string $hex The HEX color.
    135      *
    136121     * @return int Returns a number (0-255).
    137122     */
     
    159144     * Adds a class to <body> if the background-color is dark.
    160145     *
    161      * @access public
    162      *
    163146     * @since Twenty Twenty-One 1.0
    164147     *
    165148     * @param array $classes The existing body classes.
    166      *
    167149     * @return array
    168150     */
  • trunk/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-customize-color-control.php

    r51236 r51294  
    2828     * Colorpicker palette
    2929     *
    30      * @access public
    31      *
    3230     * @since Twenty Twenty-One 1.0
    3331     *
     
    3836    /**
    3937     * Enqueue control related scripts/styles.
    40      *
    41      * @access public
    4238     *
    4339     * @since Twenty Twenty-One 1.0
     
    6157     * Refresh the parameters passed to the JavaScript via JSON.
    6258     *
    63      * @access public
    64      *
    6559     * @since Twenty Twenty-One 1.0
    6660     *
  • trunk/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-customize-notice-control.php

    r49826 r51294  
    3030     * This simply prints the notice we need.
    3131     *
    32      * @access public
    33      *
    3432     * @since Twenty Twenty-One 1.0
    3533     *
  • trunk/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-customize.php

    r49826 r51294  
    1919         * Constructor. Instantiate the object.
    2020         *
    21          * @access public
    22          *
    2321         * @since Twenty Twenty-One 1.0
    2422         */
     
    3028         * Register customizer options.
    3129         *
    32          * @access public
    33          *
    3430         * @since Twenty Twenty-One 1.0
    3531         *
    3632         * @param WP_Customize_Manager $wp_customize Theme Customizer object.
    37          *
    3833         * @return void
    3934         */
     
    152147         * Sanitize boolean for checkbox.
    153148         *
    154          * @access public
    155          *
    156149         * @since Twenty Twenty-One 1.0
    157150         *
    158151         * @param bool $checked Whether or not a box is checked.
    159          *
    160152         * @return bool
    161153         */
     
    166158        /**
    167159         * Render the site title for the selective refresh partial.
    168          *
    169          * @access public
    170160         *
    171161         * @since Twenty Twenty-One 1.0
     
    180170         * Render the site tagline for the selective refresh partial.
    181171         *
    182          * @access public
    183          *
    184172         * @since Twenty Twenty-One 1.0
    185173         *
  • trunk/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-dark-mode.php

    r51246 r51294  
    1616     * Instantiate the object.
    1717     *
    18      * @access public
    19      *
    2018     * @since Twenty Twenty-One 1.0
    2119     */
     
    4947    /**
    5048     * Editor custom color variables & scripts.
    51      *
    52      * @access public
    5349     *
    5450     * @since Twenty Twenty-One 1.0
     
    8985     * Enqueue scripts and styles.
    9086     *
    91      * @access public
    92      *
    9387     * @since Twenty Twenty-One 1.0
    9488     *
     
    108102    /**
    109103     * Enqueue scripts for the customizer.
    110      *
    111      * @access public
    112104     *
    113105     * @since Twenty Twenty-One 1.0
     
    131123     * Register customizer options.
    132124     *
    133      * @access public
    134      *
    135125     * @since Twenty Twenty-One 1.0
    136126     *
    137127     * @param WP_Customize_Manager $wp_customize Theme Customizer object.
    138      *
    139128     * @return void
    140129     */
     
    223212     * Calculate classes for the main <html> element.
    224213     *
    225      * @access public
    226      *
    227214     * @since Twenty Twenty-One 1.0
    228215     *
    229216     * @param string $classes The classes for <html> element.
    230      *
    231217     * @return string
    232218     */
     
    248234     * Adds a class to the <body> element in the editor to accommodate dark-mode.
    249235     *
    250      * @access public
    251      *
    252236     * @since Twenty Twenty-One 1.0
    253237     *
    254238     * @param string $classes The admin body-classes.
    255      *
    256239     * @return string
    257240     */
     
    280263    /**
    281264     * Determine if we want to print the dark-mode switch or not.
    282      *
    283      * @access public
    284265     *
    285266     * @since Twenty Twenty-One 1.0
     
    299280     * Add night/day switch.
    300281     *
    301      * @access public
    302      *
    303282     * @since Twenty Twenty-One 1.0
    304283     *
     
    318297     * Inspired from https://codepen.io/aaroniker/pen/KGpXZo (MIT-licensed)
    319298     *
    320      * @access public
    321      *
    322299     * @since Twenty Twenty-One 1.0
    323300     *
    324301     * @param array $attrs The attributes to add to our <button> element.
    325      *
    326302     * @return void
    327303     */
     
    379355     * Print the dark-mode switch script.
    380356     *
    381      * @access public
    382      *
    383357     * @since Twenty Twenty-One 1.0
    384358     *
     
    394368     * Adds information to the privacy policy.
    395369     *
    396      * @access public
    397      *
    398370     * @since Twenty Twenty-One 1.0
    399371     *
  • trunk/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-svg-icons.php

    r49826 r51294  
    2424    /**
    2525     * User Interface icons – svg sources.
    26      *
    27      * @access protected
    2826     *
    2927     * @since Twenty Twenty-One 1.0
     
    4240    /**
    4341     * Social Icons – svg sources.
    44      *
    45      * @access protected
    4642     *
    4743     * @since Twenty Twenty-One 1.0
     
    149145     * @static
    150146     *
    151      * @access public
    152      *
    153      * @since Twenty Twenty-One 1.0
    154      *
    155      * @param string $group the icon group.
    156      * @param string $icon The icon.
    157      * @param int    $size The icon-size in pixels.
    158      *
     147     * @since Twenty Twenty-One 1.0
     148     *
     149     * @param string $group The icon group.
     150     * @param string $icon  The icon.
     151     * @param int    $size  The icon-size in pixels.
    159152     * @return string
    160153     */
     
    197190     * @static
    198191     *
    199      * @access public
    200      *
    201      * @since Twenty Twenty-One 1.0
    202      *
    203      * @param string $uri Social link.
     192     * @since Twenty Twenty-One 1.0
     193     *
     194     * @param string $uri  Social link.
    204195     * @param int    $size The icon-size in pixels.
    205      *
    206196     * @return string|null
    207197     */
  • trunk/src/wp-content/themes/twentytwentyone/inc/custom-css.php

    r49826 r51294  
    1414 *
    1515 * @param string $selector The CSS selector.
    16  * @param string $style The CSS style.
    17  * @param string $value The CSS value.
    18  * @param string $prefix The CSS prefix.
    19  * @param string $suffix The CSS suffix.
    20  * @param bool   $echo Echo the styles.
    21  *
     16 * @param string $style    The CSS style.
     17 * @param string $value    The CSS value.
     18 * @param string $prefix   The CSS prefix.
     19 * @param string $suffix   The CSS suffix.
     20 * @param bool   $echo     Echo the styles.
    2221 * @return string
    2322 */
     
    3231
    3332    if ( $echo ) {
    34         /**
     33        /*
    3534         * Note to reviewers: $css contains auto-generated CSS.
    3635         * It is included inside <style> tags and can only be interpreted as CSS on the browser.
  • trunk/src/wp-content/themes/twentytwentyone/inc/menu-functions.php

    r49826 r51294  
    2323 * @param int    $depth  Depth.
    2424 * @param object $args   Nav menu args.
    25  *
    2625 * @return string Nav menu item start element.
    2726 */
     
    4544 * @since Twenty Twenty-One 1.0
    4645 *
    47  * @param string $uri Social link.
     46 * @param string $uri  Social link.
    4847 * @param int    $size The icon size in pixels.
    49  *
    5048 * @return string
    5149 */
     
    8583 * @param WP_Post  $item  Menu item data object.
    8684 * @param int      $depth Depth of menu item. Used for padding.
    87  *
    8885 * @return stdClass
    8986 */
  • trunk/src/wp-content/themes/twentytwentyone/inc/template-functions.php

    r50841 r51294  
    1414 *
    1515 * @param array $classes Classes for the body element.
    16  *
    1716 * @return array
    1817 */
     
    4544 *
    4645 * @param array $classes An array of CSS classes.
    47  *
    4846 * @return array
    4947 */
     
    8785 *
    8886 * @param array $defaults The form defaults.
    89  *
    9087 * @return array
    9188 */
     
    168165     *
    169166     * @param string $title The title.
    170      *
    171167     * @return string
    172168     */
     
    183179 *
    184180 * @param string $group The icon group.
    185  * @param string $icon The icon.
    186  * @param int    $size The icon size in pixels.
    187  *
     181 * @param string $icon  The icon.
     182 * @param int    $size  The icon size in pixels.
    188183 * @return string
    189184 */
     
    196191 *
    197192 * @param string $calendar_output The generated HTML of the calendar.
    198  *
    199193 * @return string
    200194 */
     
    212206 *
    213207 * @param string $type Whether to return CSS for the "front-end", "block-editor" or "classic-editor".
    214  *
    215208 * @return string
    216209 */
     
    329322 *                                Example: `core/image`, `core-embed/*`.
    330323 * @param string|null $content    The content to search in. Use null for get_the_content().
    331  * @param int         $instances  How many instances of the block will be printed (max). Defaults to 1.
    332  *
     324 * @param int         $instances  How many instances of the block will be printed (max). Default  1.
    333325 * @return bool Returns true if a block was located & printed, otherwise false.
    334326 */
     
    416408 * @param string|array $size       Requested size. Image size or array of width and height values
    417409 *                                 (in that order). Default 'thumbnail'.
    418  *
    419410 * @return array
    420411 */
Note: See TracChangeset for help on using the changeset viewer.