Ticket #16358: 16358-no-nav_menu_item.diff
| File 16358-no-nav_menu_item.diff, 860 bytes (added by , 15 years ago) |
|---|
-
wp-admin/includes/user.php
278 278 do_action('delete_user', $id); 279 279 280 280 if ( 'novalue' === $reassign || null === $reassign ) { 281 $post_ids = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id) ); 281 $post_types_to_not_delete = apply_filters( 'delete_user_not_these_post_types', array( 'nav_menu_item' ), $id ); 282 $post_types = array_diff( get_post_types(), $post_types_to_not_delete ); 283 $post_types = implode( "', '", $post_types ); 284 $post_ids = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_author = %d AND post_type IN ('$post_types')", $id) ); 282 285 283 286 if ( $post_ids ) { 284 287 foreach ( $post_ids as $post_id )