Make WordPress Core


Ignore:
Timestamp:
03/25/2018 06:09:56 PM (7 years ago)
Author:
johnbillion
Message:

Docs: Document more parameters and properties using typed array notation.

See #41756

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/category-template.php

    r42843 r42875  
    7272 *
    7373 * @param int $id Optional, default to current post ID. The post ID.
    74  * @return array Array of WP_Term objects, one for each category assigned to the post.
     74 * @return WP_Term[] Array of WP_Term objects, one for each category assigned to the post.
    7575 */
    7676function get_the_category( $id = false ) {
     
    9292     * @since 4.4.0 Added `$id` parameter.
    9393     *
    94      * @param array $categories An array of categories to return for the post.
    95      * @param int  $id         ID of the post.
     94     * @param WP_Term[] $categories An array of categories to return for the post.
     95     * @param int|false $id         ID of the post.
    9696     */
    9797    return apply_filters( 'get_the_categories', $categories, $id );
     
    142142     * @since 4.4.0
    143143     *
    144      * @param array    $categories An array of the post's categories.
    145      * @param int|bool $post_id    ID of the post we're retrieving categories for. When `false`, we assume the
    146      *                             current post in the loop.
     144     * @param WP_Term[] $categories An array of the post's categories.
     145     * @param int|bool  $post_id    ID of the post we're retrieving categories for. When `false`, we assume the
     146     *                              current post in the loop.
    147147     */
    148148    $categories = apply_filters( 'the_category_list', get_the_category( $post_id ), $post_id );
     
    763763 * @since 4.8.0 Added the `show_count` argument.
    764764 *
    765  * @param array $tags Array of WP_Term objects to generate the tag cloud for.
     765 * @param WP_Term[]    $tags Array of WP_Term objects to generate the tag cloud for.
    766766 * @param string|array $args {
    767767 *     Optional. Array or string of arguments for generating a tag cloud.
     
    851851     * @since 2.8.0
    852852     *
    853      * @param array $tags Ordered array of terms.
    854      * @param array $args An array of tag cloud arguments.
     853     * @param WP_Term[] $tags Ordered array of terms.
     854     * @param array     $args An array of tag cloud arguments.
    855855     */
    856856    $tags_sorted = apply_filters( 'tag_cloud_sort', $tags, $args );
     
    10051005         *                             or an array of tag links if the 'format' argument
    10061006         *                             equals 'array'.
    1007          * @param array        $tags   An array of terms used in the tag cloud.
     1007         * @param WP_Term[]    $tags   An array of terms used in the tag cloud.
    10081008         * @param array        $args   An array of wp_generate_tag_cloud() arguments.
    10091009         */
     
    11231123     * @see get_the_terms()
    11241124     *
    1125      * @param array $terms An array of tags for the given post.
     1125     * @param WP_Term[] $terms An array of tags for the given post.
    11261126     */
    11271127    return apply_filters( 'get_the_tags', get_the_terms( $id, 'post_tag' ) );
     
    12141214 * @since 2.5.0
    12151215 *
    1216  * @param int|object $post Post ID or object.
    1217  * @param string $taxonomy Taxonomy name.
    1218  * @return array|false|WP_Error Array of WP_Term objects on success, false if there are no terms
    1219  *                              or the post does not exist, WP_Error on failure.
     1216 * @param int|WP_Post $post    Post ID or object.
     1217 * @param string      $taxonomy Taxonomy name.
     1218 * @return WP_Term[]|false|WP_Error Array of WP_Term objects on success, false if there are no terms
     1219 *                                  or the post does not exist, WP_Error on failure.
    12201220 */
    12211221function get_the_terms( $post, $taxonomy ) {
     
    12381238     * @since 3.1.0
    12391239     *
    1240      * @param array|WP_Error $terms    List of attached terms, or WP_Error on failure.
    1241      * @param int            $post_id  Post ID.
    1242      * @param string         $taxonomy Name of the taxonomy.
     1240     * @param WP_Term[]|WP_Error $terms    Array of attached terms, or WP_Error on failure.
     1241     * @param int                $post_id  Post ID.
     1242     * @param string             $taxonomy Name of the taxonomy.
    12431243     */
    12441244    $terms = apply_filters( 'get_the_terms', $terms, $post->ID, $taxonomy );
     
    12921292     * @since 2.5.0
    12931293     *
    1294      * @param array $links An array of term links.
     1294     * @param string[] $links An array of term links.
    12951295     */
    12961296    $term_links = apply_filters( "term_links-{$taxonomy}", $links );
Note: See TracChangeset for help on using the changeset viewer.