Ticket #16358: 16358.diff
| File 16358.diff, 1.5 KB (added by nacin, 13 months ago) |
|---|
-
wp-includes/post.php
63 63 'rewrite' => false, 64 64 'query_var' => false, 65 65 'show_in_nav_menus' => false, 66 'supports' => array( 'comments' ),66 'supports' => array( 'comments', 'author' ), 67 67 ) ); 68 68 69 69 register_post_type( 'revision', array( … … 80 80 'rewrite' => false, 81 81 'query_var' => false, 82 82 'can_export' => false, 83 'supports' => array( 'author' ), 83 84 ) ); 84 85 85 86 register_post_type( 'nav_menu_item', array( -
wp-admin/includes/user.php
243 243 do_action('delete_user', $id); 244 244 245 245 if ( 'novalue' === $reassign || null === $reassign ) { 246 $post_ids = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id) ); 246 $post_types_to_delete = array(); 247 foreach ( get_post_types() as $post_type ) { 248 if ( post_type_supports( $post_type, 'author' ) 249 $post_types_to_delete[] = $post_type; 250 } 251 $post_types_to_delete = apply_filters( 'post_types_to_delete_with_user', $post_types_to_delete, $id ); 252 $post_types_to_delete = implode( "', '", $post_types_to_delete ); 253 $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) ); 247 254 248 255 if ( $post_ids ) { 249 256 foreach ( $post_ids as $post_id )
