WordPress.org

Make WordPress Core

Changeset 26503


Ignore:
Timestamp:
12/01/2013 05:53:18 PM (8 years ago)
Author:
DrewAPicture
Message:

Inline documentation for hooks in wp-admin/includes/user.php.

Props aaronholbrook for the initial patch.
Fixes #26099.

Location:
trunk/src/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/ms.php

    r26120 r26503  
    205205    clean_user_cache( $user );
    206206
    207     /**
    208      * Fires after the user is deleted from the network.
    209      *
    210      * @since 2.8.0
    211      *
    212      * @param int $id ID of the user that was deleted from the network.
    213      */
     207    /** This action is documented in wp-admin/includes/user.php */
    214208    do_action( 'deleted_user', $id );
    215209
  • trunk/src/wp-admin/includes/user.php

    r25606 r26503  
    110110
    111111    /* checking the password has been typed twice */
     112    /**
     113     * Fires before the password and confirm password fields are checked for congruity.
     114     *
     115     * @since 1.5.1
     116     *
     117     * @param string $user_login The username.
     118     * @param string &$pass1     The password, passed by reference.
     119     * @param string &$pass2     The confirmed password, passed by reference.
     120     */
    112121    do_action_ref_array( 'check_passwords', array( $user->user_login, &$pass1, &$pass2 ) );
    113122
     
    150159    }
    151160
    152     // Allow plugins to return their own errors.
     161    /**
     162     * Fires before user profile update errors are returned.
     163     *
     164     * @since 2.8.0
     165     *
     166     * @param array   &$errors An array of user profile update errors, passed by reference.
     167     * @param bool    $update  Whether this is a user update.
     168     * @param WP_User &$user   WP_User object, passed by reference.
     169     */
    153170    do_action_ref_array( 'user_profile_update_errors', array( &$errors, $update, &$user ) );
    154171
     
    185202
    186203    $all_roles = $wp_roles->roles;
    187     $editable_roles = apply_filters('editable_roles', $all_roles);
     204
     205    /**
     206     * Filter the list of editable roles.
     207     *
     208     * @since 2.8.0
     209     *
     210     * @param array $all_roles List of roles.
     211     */
     212    $editable_roles = apply_filters( 'editable_roles', $all_roles );
    188213
    189214    return $editable_roles;
     
    218243    global $wpdb;
    219244    $query = $wpdb->prepare("SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'draft' AND post_author = %d ORDER BY post_modified DESC", $user_id);
    220     $query = apply_filters('get_users_drafts', $query);
     245
     246    /**
     247     * Filter the user's drafts query string.
     248     *
     249     * @since 2.0.0
     250     *
     251     * @param string $query The user's drafts query string.
     252     */
     253    $query = apply_filters( 'get_users_drafts', $query );
    221254    return $wpdb->get_results( $query );
    222255}
     
    245278        return false;
    246279
    247     // allow for transaction statement
    248     do_action('delete_user', $id);
     280    /**
     281     * Fires immediately before a user is deleted from the database.
     282     *
     283     * @since 2.0.0
     284     *
     285     * @param int $id User ID.
     286     */
     287    do_action( 'delete_user', $id );
    249288
    250289    if ( 'novalue' === $reassign || null === $reassign ) {
     
    258297        }
    259298
     299        /**
     300         * Filter the list of post types to delete with a user.
     301         *
     302         * @since 3.4.0
     303         *
     304         * @param array $post_types_to_delete Post types to delete.
     305         * @param int   $id                   User ID.
     306         */
    260307        $post_types_to_delete = apply_filters( 'post_types_to_delete_with_user', $post_types_to_delete, $id );
    261308        $post_types_to_delete = implode( "', '", $post_types_to_delete );
     
    302349    clean_user_cache( $user );
    303350
    304     // allow for commit transaction
    305     do_action('deleted_user', $id);
     351    /**
     352     * Fires immediately after a user is deleted from the database.
     353     *
     354     * @since 2.9.0
     355     *
     356     * @param int $id ID of the deleted user.
     357     */
     358    do_action( 'deleted_user', $id );
    306359
    307360    return true;
Note: See TracChangeset for help on using the changeset viewer.