WordPress.org

Make WordPress Core

Changeset 46823


Ignore:
Timestamp:
12/06/2019 10:41:26 PM (12 months ago)
Author:
johnbillion
Message:

Docs: Increase the specificity of various docblock parameter types and return types.

See #48303

Location:
trunk/src
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-form-blocks.php

    r46596 r46823  
    145145 * @param bool|array $allowed_block_types Array of block type slugs, or
    146146 *                                        boolean to enable/disable all.
    147  * @param object $post                    The post resource data.
     147 * @param WP_Post    $post                The post resource data.
    148148 */
    149149$allowed_block_types = apply_filters( 'allowed_block_types', true, $post );
  • trunk/src/wp-admin/edit-form-comment.php

    r46084 r46823  
    173173     * @since 4.3.0
    174174     *
    175      * @param string $html    Output HTML to display miscellaneous action.
    176      * @param object $comment Current comment object.
     175     * @param string     $html    Output HTML to display miscellaneous action.
     176     * @param WP_Comment $comment Current comment object.
    177177     */
    178178    echo apply_filters( 'edit_comment_misc_actions', '', $comment );
  • trunk/src/wp-admin/edit-tags.php

    r46811 r46823  
    223223     * @since 4.6.0
    224224     *
    225      * @param string $location The destination URL.
    226      * @param object $tax      The taxonomy object.
     225     * @param string      $location The destination URL.
     226     * @param WP_Taxonomy $tax      The taxonomy object.
    227227     */
    228228    wp_redirect( apply_filters( 'redirect_term_location', $location, $tax ) );
  • trunk/src/wp-admin/includes/class-wp-upgrader.php

    r46696 r46823  
    558558             * @since 2.8.0
    559559             *
    560              * @param mixed  $removed            Whether the destination was cleared. true on success, WP_Error on failure
    561              * @param string $local_destination  The local package destination.
    562              * @param string $remote_destination The remote package destination.
    563              * @param array  $hook_extra         Extra arguments passed to hooked filters.
     560             * @param true|WP_Error $removed            Whether the destination was cleared. true upon success, WP_Error on failure.
     561             * @param string        $local_destination  The local package destination.
     562             * @param string        $remote_destination The remote package destination.
     563             * @param array         $hook_extra         Extra arguments passed to hooked filters.
    564564             */
    565565            $removed = apply_filters( 'upgrader_clear_destination', $removed, $local_destination, $remote_destination, $args['hook_extra'] );
  • trunk/src/wp-admin/includes/post.php

    r46732 r46823  
    17941794 * @since 2.6.0
    17951795 *
    1796  * @param mixed $post_data Associative array containing the post data or int post ID.
    1797  * @return mixed The autosave revision ID. WP_Error or 0 on error.
     1796 * @param array|int $post_data Associative array containing the post data or int post ID.
     1797 * @return int|WP_Error The autosave revision ID. WP_Error or 0 on error.
    17981798 */
    17991799function wp_create_post_autosave( $post_data ) {
  • trunk/src/wp-admin/includes/revision.php

    r46603 r46823  
    1313 * @since 3.6.0
    1414 *
    15  * @param object|int $post         The post object. Also accepts a post ID.
    16  * @param int        $compare_from The revision ID to compare from.
    17  * @param int        $compare_to   The revision ID to come to.
     15 * @param WP_Post|int $post         The post object or post ID.
     16 * @param int         $compare_from The revision ID to compare from.
     17 * @param int         $compare_to   The revision ID to come to.
    1818 *
    1919 * @return array|bool Associative array of a post's revisioned fields and their diffs.
     
    159159 * @since 3.6.0
    160160 *
    161  * @param object|int $post                 The post object. Also accepts a post ID.
    162  * @param int        $selected_revision_id The selected revision ID.
    163  * @param int        $from                 Optional. The revision ID to compare from.
     161 * @param WP_Post|int $post                 The post object or post ID.
     162 * @param int         $selected_revision_id The selected revision ID.
     163 * @param int         $from                 Optional. The revision ID to compare from.
    164164 *
    165165 * @return array An associative array of revision data and related settings.
  • trunk/src/wp-admin/includes/template.php

    r46662 r46823  
    3333 * @param int[]  $popular_cats         Optional. Array of category IDs to receive the "popular-category" class.
    3434 *                                     Default false.
    35  * @param object $walker               Optional. Walker object to use to build the output.
     35 * @param Walker $walker               Optional. Walker object to use to build the output.
    3636 *                                     Default is a Walker_Category_Checklist instance.
    3737 * @param bool   $checked_ontop        Optional. Whether to move checked items out of the hierarchy and to
     
    6969 *     @type int[]  $popular_cats         Array of category IDs to receive the "popular-category" class.
    7070 *                                        Default false.
    71  *     @type object $walker               Walker object to use to build the output.
     71 *     @type Walker $walker               Walker object to use to build the output.
    7272 *                                        Default is a Walker_Category_Checklist instance.
    7373 *     @type string $taxonomy             Taxonomy to generate the checklist for. Default 'category'.
  • trunk/src/wp-includes/category-template.php

    r46451 r46823  
    14541454 * @since 3.1.0
    14551455 *
    1456  * @param string|int|array $term Optional. The term name/term_id/slug or array of them to check for.
    1457  * @param string $taxonomy Taxonomy name
    1458  * @param int|object $post Optional. Post to check instead of the current post.
     1456 * @param string|int|array $term     Optional. The term name/term_id/slug or array of them to check for.
     1457 * @param string           $taxonomy Taxonomy name.
     1458 * @param int|WP_Post      $post    Optional. Post to check instead of the current post.
    14591459 * @return bool True if the current post has any of the given tags (or any tag, if no tag specified).
    14601460 */
  • trunk/src/wp-includes/class-wp-customize-nav-menus.php

    r46821 r46823  
    4040     * @since 4.3.0
    4141     *
    42      * @param object $manager An instance of the WP_Customize_Manager class.
     42     * @param WP_Customize_Manager $manager An instance of the WP_Customize_Manager class.
    4343     */
    4444    public function __construct( $manager ) {
  • trunk/src/wp-includes/class-wp-meta-query.php

    r46188 r46823  
    823823         * @since 4.1.0
    824824         *
    825          * @param string|bool $alias        Table alias, or false if none was found.
    826          * @param array       $clause       First-order query clause.
    827          * @param array       $parent_query Parent of $clause.
    828          * @param object      $this         WP_Meta_Query object.
     825         * @param string|bool   $alias        Table alias, or false if none was found.
     826         * @param array         $clause       First-order query clause.
     827         * @param array         $parent_query Parent of $clause.
     828         * @param WP_Meta_Query $this         WP_Meta_Query object.
    829829         */
    830830        return apply_filters( 'meta_query_find_compatible_table_alias', $alias, $clause, $parent_query, $this );
  • trunk/src/wp-includes/comment.php

    r46660 r46823  
    16851685 * @since 2.7.0
    16861686 *
    1687  * @param string $new_status New comment status.
    1688  * @param string $old_status Previous comment status.
    1689  * @param object $comment Comment data.
     1687 * @param string     $new_status New comment status.
     1688 * @param string     $old_status Previous comment status.
     1689 * @param WP_Comment $comment    Comment object.
    16901690 */
    16911691function wp_transition_comment_status( $new_status, $old_status, $comment ) {
     
    17171717         * @param int|string $new_status The new comment status.
    17181718         * @param int|string $old_status The old comment status.
    1719          * @param object     $comment    The comment data.
     1719         * @param WP_Comment $comment    Comment object.
    17201720         */
    17211721        do_action( 'transition_comment_status', $new_status, $old_status, $comment );
  • trunk/src/wp-includes/feed.php

    r46757 r46823  
    774774     * @since 3.0.0
    775775     *
    776      * @param object $feed SimplePie feed object (passed by reference).
    777      * @param mixed  $url  URL of feed to retrieve. If an array of URLs, the feeds are merged.
     776     * @param SimplePie $feed SimplePie feed object (passed by reference).
     777     * @param mixed     $url  URL of feed to retrieve. If an array of URLs, the feeds are merged.
    778778     */
    779779    do_action_ref_array( 'wp_feed_options', array( &$feed, $url ) );
  • trunk/src/wp-includes/general-template.php

    r46698 r46823  
    13401340     * @since 0.71
    13411341     *
    1342      * @param string $_post_title The single post page title.
    1343      * @param object $_post       The current queried object as returned by get_queried_object().
     1342     * @param string  $_post_title The single post page title.
     1343     * @param WP_Post $_post       The current post.
    13441344     */
    13451345    $title = apply_filters( 'single_post_title', $_post->post_title, $_post );
  • trunk/src/wp-includes/link-template.php

    r46795 r46823  
    10411041 * @since 3.1.0
    10421042 *
    1043  * @param string $link   Optional. Anchor text. If empty, default is 'Edit This'. Default empty.
    1044  * @param string $before Optional. Display before edit link. Default empty.
    1045  * @param string $after  Optional. Display after edit link. Default empty.
    1046  * @param object $term   Optional. Term object. If null, the queried object will be inspected. Default null.
    1047  * @param bool   $echo   Optional. Whether or not to echo the return. Default true.
     1043 * @param string  $link   Optional. Anchor text. If empty, default is 'Edit This'. Default empty.
     1044 * @param string  $before Optional. Display before edit link. Default empty.
     1045 * @param string  $after  Optional. Display after edit link. Default empty.
     1046 * @param WP_Term $term   Optional. Term object. If null, the queried object will be inspected. Default null.
     1047 * @param bool    $echo   Optional. Whether or not to echo the return. Default true.
    10481048 * @return string|void HTML content.
    10491049 */
  • trunk/src/wp-includes/ms-blogs.php

    r46685 r46823  
    770770 * @since 3.3.0
    771771 *
    772  * @param string $new_status The new post status
    773  * @param string $old_status The old post status
    774  * @param object $post       Post object
     772 * @param string  $new_status The new post status.
     773 * @param string  $old_status The old post status.
     774 * @param WP_Post $post       Post object.
    775775 */
    776776function _update_blog_date_on_post_publish( $new_status, $old_status, $post ) {
  • trunk/src/wp-includes/nav-menu.php

    r46660 r46823  
    10661066 * @access private
    10671067 *
    1068  * @param string $new_status The new status of the post object.
    1069  * @param string $old_status The old status of the post object.
    1070  * @param object $post       The post object being transitioned from one status to another.
     1068 * @param string  $new_status The new status of the post object.
     1069 * @param string  $old_status The old status of the post object.
     1070 * @param WP_Post $post       The post object being transitioned from one status to another.
    10711071 */
    10721072function _wp_auto_add_pages_to_menu( $new_status, $old_status, $post ) {
  • trunk/src/wp-includes/post-formats.php

    r46660 r46823  
    4242 * @since 3.1.0
    4343 *
    44  * @param string|array    $format Optional. The format or formats to check.
    45  * @param object|int|null $post   Optional. The post to check. If not supplied, defaults to the current post if used in the loop.
     44 * @param string|array     $format Optional. The format or formats to check.
     45 * @param WP_Post|int|null $post   Optional. The post to check. If not supplied, defaults to the current post if used in the loop.
    4646 * @return bool True if the post has any of the given formats (or any format, if no format specified), false otherwise.
    4747 */
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-blocks-controller.php

    r46586 r46823  
    2525     * @since 5.0.0
    2626     *
    27      * @param object $post Post object that backs the block.
     27     * @param WP_Post $post Post object that backs the block.
    2828     * @return bool Whether the block can be read.
    2929     */
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php

    r46696 r46823  
    16651665     * @since 4.7.0
    16661666     *
    1667      * @param object $comment Comment object.
     1667     * @param WP_Comment $comment Comment object.
    16681668     * @return bool Whether the comment can be edited or deleted.
    16691669     */
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php

    r46696 r46823  
    228228         * @since 4.7.0
    229229         *
    230          * @param WP_REST_Response $response The response object.
    231          * @param object           $item    The original post type object.
    232          * @param WP_REST_Request  $request  Request used to generate the response.
     230         * @param WP_REST_Response $response  The response object.
     231         * @param WP_Post_Type     $post_type The original post type object.
     232         * @param WP_REST_Request  $request   Request used to generate the response.
    233233         */
    234234        return apply_filters( 'rest_prepare_post_type', $response, $post_type, $request );
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

    r46646 r46823  
    870870         * @since 4.7.0
    871871         *
    872          * @param object           $post     The deleted or trashed post.
     872         * @param WP_Post          $post     The deleted or trashed post.
    873873         * @param WP_REST_Response $response The response data.
    874874         * @param WP_REST_Request  $request  The request sent to the API.
     
    11461146     * @since 4.7.0
    11471147     *
    1148      * @param string $post_status Post status.
    1149      * @param object $post_type   Post type.
     1148     * @param string       $post_status Post status.
     1149     * @param WP_Post_Type $post_type   Post type.
    11501150     * @return string|WP_Error Post status or WP_Error if lacking the proper permission.
    11511151     */
     
    13221322     * @since 4.7.0
    13231323     *
    1324      * @param object|string $post_type Post type name or object.
     1324     * @param WP_Post_Type|string $post_type Post type name or object.
    13251325     * @return bool Whether the post type is allowed in REST.
    13261326     */
     
    13441344     * @since 4.7.0
    13451345     *
    1346      * @param object $post Post object.
     1346     * @param WP_Post $post Post object.
    13471347     * @return bool Whether the post can be read.
    13481348     */
     
    13871387     * @since 4.7.0
    13881388     *
    1389      * @param object $post Post object.
     1389     * @param WP_Post $post Post object.
    13901390     * @return bool Whether the post can be edited.
    13911391     */
     
    14051405     * @since 4.7.0
    14061406     *
    1407      * @param object $post Post object.
     1407     * @param WP_Post $post Post object.
    14081408     * @return bool Whether the post can be created.
    14091409     */
     
    14231423     * @since 4.7.0
    14241424     *
    1425      * @param object $post Post object.
     1425     * @param WP_Post $post Post object.
    14261426     * @return bool Whether the post can be deleted.
    14271427     */
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php

    r46731 r46823  
    782782         *
    783783         * @param WP_REST_Response  $response  The response object.
    784          * @param object            $item      The original term object.
     784         * @param WP_Term           $item      The original term object.
    785785         * @param WP_REST_Request   $request   Request used to generate the response.
    786786         */
     
    793793     * @since 4.7.0
    794794     *
    795      * @param object $term Term object.
     795     * @param WP_Term $term Term object.
    796796     * @return array Links for the given term.
    797797     */
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php

    r46804 r46823  
    962962         *
    963963         * @param WP_REST_Response $response The response object.
    964          * @param object           $user     User object used to create response.
     964         * @param WP_User          $user     User object used to create response.
    965965         * @param WP_REST_Request  $request  Request object.
    966966         */
  • trunk/src/wp-includes/taxonomy.php

    r46696 r46823  
    36843684 * @global wpdb $wpdb WordPress database abstraction object.
    36853685 *
    3686  * @param array  $terms    List of Term taxonomy IDs.
    3687  * @param object $taxonomy Current taxonomy object of terms.
     3686 * @param int[]       $terms    List of Term taxonomy IDs.
     3687 * @param WP_Taxonomy $taxonomy Current taxonomy object of terms.
    36883688 */
    36893689function _update_post_term_count( $terms, $taxonomy ) {
     
    37393739 * @global wpdb $wpdb WordPress database abstraction object.
    37403740 *
    3741  * @param array  $terms    List of term taxonomy IDs.
    3742  * @param object $taxonomy Current taxonomy object of terms.
     3741 * @param int[]       $terms    List of term taxonomy IDs.
     3742 * @param WP_Taxonomy $taxonomy Current taxonomy object of terms.
    37433743 */
    37443744function _update_generic_term_count( $terms, $taxonomy ) {
     
    41734173 * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
    41744174 *
    4175  * @param object|int|string $term     The term object, ID, or slug whose link will be retrieved.
    4176  * @param string            $taxonomy Optional. Taxonomy. Default empty.
     4175 * @param WP_Term|int|string $term     The term object, ID, or slug whose link will be retrieved.
     4176 * @param string             $taxonomy Optional. Taxonomy. Default empty.
    41774177 * @return string|WP_Error URL of the taxonomy term archive on success, WP_Error if term does not exist.
    41784178 */
     
    42704270     * @since 2.5.0
    42714271     *
    4272      * @param string $termlink Term link URL.
    4273      * @param object $term     Term object.
    4274      * @param string $taxonomy Taxonomy slug.
     4272     * @param string  $termlink Term link URL.
     4273     * @param WP_Term $term     Term object.
     4274     * @param string  $taxonomy Taxonomy slug.
    42754275     */
    42764276    return apply_filters( 'term_link', $termlink, $term, $taxonomy );
  • trunk/src/wp-includes/user.php

    r46804 r46823  
    24512451     * @since 1.5.0
    24522452     *
    2453      * @param object $user     The user.
    2454      * @param string $new_pass New user password.
     2453     * @param WP_User $user     The user.
     2454     * @param string  $new_pass New user password.
    24552455     */
    24562456    do_action( 'password_reset', $user, $new_pass );
  • trunk/src/wp-login.php

    r46788 r46823  
    926926         * @since 3.5.0
    927927         *
    928          * @param object           $errors WP Error object.
     928         * @param WP_Error         $errors WP Error object.
    929929         * @param WP_User|WP_Error $user   WP_User object if the login and reset key match. WP_Error object otherwise.
    930930         */
     
    13211321         * @since 3.6.0
    13221322         *
    1323          * @param object $errors      WP Error object.
    1324          * @param string $redirect_to Redirect destination URL.
     1323         * @param WP_Error $errors      WP Error object.
     1324         * @param string   $redirect_to Redirect destination URL.
    13251325         */
    13261326        $errors = apply_filters( 'wp_login_errors', $errors, $redirect_to );
Note: See TracChangeset for help on using the changeset viewer.