Make WordPress Core

Ticket #26099: 26099.patch

File 26099.patch, 1.4 KB (added by aaronholbrook, 12 years ago)
  • wp-admin/includes/user.php

     
    184184        global $wp_roles;
    185185
    186186        $all_roles = $wp_roles->roles;
     187
     188        /**
     189         * Filter the editable roles.
     190         *
     191         * @since 2.8.0
     192         *
     193         * @param string $editable_roles List of roles.
     194         */
    187195        $editable_roles = apply_filters('editable_roles', $all_roles);
    188196
    189197        return $editable_roles;
     
    217225function get_users_drafts( $user_id ) {
    218226        global $wpdb;
    219227        $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);
     228
     229        /**
     230         * Filter the user's drafts.
     231         *
     232         * @since 2.0.0
     233         *
     234         * @param string $query User's drafts.
     235         */
    220236        $query = apply_filters('get_users_drafts', $query);
    221237        return $wpdb->get_results( $query );
    222238}
     
    257273                        }
    258274                }
    259275
     276                /**
     277                 * Filter the post types to delete with the user.
     278                 *
     279                 * @since 2.0.0
     280                 *
     281                 * @param string $post_types_to_delete Post types to delete.
     282                 */
    260283                $post_types_to_delete = apply_filters( 'post_types_to_delete_with_user', $post_types_to_delete, $id );
    261284                $post_types_to_delete = implode( "', '", $post_types_to_delete );
    262285                $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_author = %d AND post_type IN ('$post_types_to_delete')", $id ) );