WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/06/2021 12:34:36 PM (5 months ago)
Author:
desrosj
Message:

Twenty Twenty: Add missing documentation for some filters.

Add missing @since tags for some functions.

Correct alignment of some @param tags.

Follow-up to [46271], [46278], [51304].

Props SergeyBiryukov.
Merges [51322] to the 5.8 branch.
See #52628, #53461.

Location:
branches/5.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.8

  • branches/5.8/src/wp-content/themes/twentytwenty/inc/template-tags.php

    r49120 r51338  
    2626 * Displays the site logo, either text or image.
    2727 *
    28  * @param array   $args Arguments for displaying the site logo either as an image or text.
    29  * @param bool    $echo Echo or return the HTML.
     28 * @since Twenty Twenty 1.0
     29 *
     30 * @param array $args Arguments for displaying the site logo either as an image or text.
     31 * @param bool  $echo Echo or return the HTML.
    3032 * @return string Compiled HTML based on our arguments.
    3133 */
     
    5153     * Filters the arguments for `twentytwenty_site_logo()`.
    5254     *
    53      * @param array  $args     Parsed arguments.
    54      * @param array  $defaults Function's default arguments.
     55     * @since Twenty Twenty 1.0
     56     *
     57     * @param array $args     Parsed arguments.
     58     * @param array $defaults Function's default arguments.
    5559     */
    5660    $args = apply_filters( 'twentytwenty_site_logo_args', $args, $defaults );
     
    7175     * Filters the arguments for `twentytwenty_site_logo()`.
    7276     *
     77     * @since Twenty Twenty 1.0
     78     *
    7379     * @param string $html      Compiled HTML based on our arguments.
    7480     * @param array  $args      Parsed arguments.
     
    8995 * Displays the site description.
    9096 *
     97 * @since Twenty Twenty 1.0
     98 *
    9199 * @param bool $echo Echo or return the html.
    92100 * @return string The HTML to display.
     
    108116     * @since Twenty Twenty 1.0
    109117     *
    110      * @param string $html         The HTML to display.
    111      * @param string $description  Site description via `bloginfo()`.
    112      * @param string $wrapper      The format used in case you want to reuse it in a `sprintf()`.
     118     * @param string $html        The HTML to display.
     119     * @param string $description Site description via `bloginfo()`.
     120     * @param string $wrapper     The format used in case you want to reuse it in a `sprintf()`.
    113121     */
    114122    $html = apply_filters( 'twentytwenty_site_description', $html, $description, $wrapper );
     
    128136 * Checks if the specified comment is written by the author of the post commented on.
    129137 *
     138 * @since Twenty Twenty 1.0
     139 *
    130140 * @param object $comment Comment data.
    131141 * @return bool
     
    154164 * makes it scroll to the wrong position on the page.
    155165 *
     166 * @since Twenty Twenty 1.0
     167 *
    156168 * @param string $link Link to the top of the page.
    157169 * @return string Link to the top of the page.
     
    175187 * If it's a single post, outputs the post meta values specified in the Customizer settings.
    176188 *
     189 * @since Twenty Twenty 1.0
     190 *
    177191 * @param int    $post_id  The ID of the post for which the post meta should be output.
    178192 * @param string $location Which post meta location to output – single or preview.
     
    186200/**
    187201 * Filters the edit post link to add an icon and use the post meta structure.
     202 *
     203 * @since Twenty Twenty 1.0
    188204 *
    189205 * @param string $link    Anchor tag for the edit link.
     
    224240 * Retrieves the post meta.
    225241 *
    226  * @param int    $post_id The ID of the post.
     242 * @since Twenty Twenty 1.0
     243 *
     244 * @param int    $post_id  The ID of the post.
    227245 * @param string $location The location where the meta is shown.
    228246 */
     
    242260     * @since Twenty Twenty 1.0
    243261     *
    244      * @param array Array of post types
     262     * @param array Array of post types.
    245263     */
    246264    $disallowed_post_types = apply_filters( 'twentytwenty_disallowed_post_types_for_meta_output', array( 'page' ) );
     
    264282         *
    265283         * @param array $args {
    266          *  @type string 'author'
    267          *  @type string 'post-date'
    268          *  @type string 'comments'
    269          *  @type string 'sticky'
     284         *     @type string $author
     285         *     @type string $post-date
     286         *     @type string $comments
     287         *     @type string $sticky
    270288         * }
    271289         */
     
    292310         *
    293311         * @param array $args {
    294          *   @type string 'tags'
     312         *     @type string $tags
    295313         * }
    296314         */
     
    500518 * styling of sub levels in the fallback. Only applied if the match_menu_classes argument is set.
    501519 *
     520 * @since Twenty Twenty 1.0
     521 *
    502522 * @param string[] $css_class    An array of CSS classes to be applied to each list item.
    503523 * @param WP_Post  $page         Page data object.
     
    534554/**
    535555 * Adds a Sub Nav Toggle to the Expanded Menu and Mobile Menu.
     556 *
     557 * @since Twenty Twenty 1.0
    536558 *
    537559 * @param stdClass $args  An object of wp_nav_menu() arguments.
     
    580602/**
    581603 * Displays SVG icons in social links menu.
     604 *
     605 * @since Twenty Twenty 1.0
    582606 *
    583607 * @param string   $item_output The menu item's starting HTML output.
     
    610634 *
    611635 * If we're missing JavaScript support, the HTML element will have a 'no-js' class.
     636 *
     637 * @since Twenty Twenty 1.0
    612638 */
    613639function twentytwenty_no_js_class() {
     
    623649/**
    624650 * Adds conditional body classes.
     651 *
     652 * @since Twenty Twenty 1.0
    625653 *
    626654 * @param array $classes Classes added to the body tag.
     
    725753 * Filters the archive title and styles the word before the first colon.
    726754 *
     755 * @since Twenty Twenty 1.0
     756 *
    727757 * @param string $title Current archive title.
    728758 * @return string Current archive title.
     
    730760function twentytwenty_get_the_archive_title( $title ) {
    731761
     762    /**
     763     * Filters the regular expression used to style the word before the first colon.
     764     *
     765     * @since Twenty Twenty 1.0
     766     *
     767     * @param array $regex An array of regular expression pattern and replacement.
     768     */
    732769    $regex = apply_filters(
    733770        'twentytwenty_get_the_archive_title_regex',
     
    757794 * Toggles animation duration in milliseconds.
    758795 *
     796 * @since Twenty Twenty 1.0
     797 *
    759798 * @return int Duration in milliseconds
    760799 */
     
    780819 * but it is unique across the life of the PHP process.
    781820 *
     821 * @since Twenty Twenty 1.0
     822 *
    782823 * @see wp_unique_id() Themes requiring WordPress 5.0.3 and greater should use this instead.
    783824 *
Note: See TracChangeset for help on using the changeset viewer.