Ticket #36860: 36860.6.diff
File 36860.6.diff, 1.5 KB (added by , 6 years ago) |
---|
-
src/wp-admin/users.php
234 234 $userids = array_map( 'intval', (array) $_REQUEST['users'] ); 235 235 } 236 236 237 /** 238 * Filters whether the users have additional content attached to them outside of the post_author & link_owner relation. 239 * 240 * @since 5.2.0 241 * 242 * @param boolean $users_have_additional_content The flag for users have additional content. Default is `false`. 243 * @param int[] $userids Array of IDs for users being deleted. 244 */ 245 $users_have_additional_content = (bool) apply_filters( 'users_have_additional_content', false, $userids ); 246 237 247 $users_have_content = false; 238 if ( $wpdb->get_var( "SELECT ID FROM {$wpdb->posts} WHERE post_author IN( " . implode( ',', $userids ) . ' ) LIMIT 1' ) ) { 248 249 if ( $users_have_additional_content ) { 239 250 $users_have_content = true; 240 } elseif ( $wpdb->get_var( "SELECT link_id FROM {$wpdb->links} WHERE link_owner IN( " . implode( ',', $userids ) . ' ) LIMIT 1' ) ) { 241 $users_have_content = true; 251 } else { 252 if ( $wpdb->get_var( "SELECT ID FROM {$wpdb->posts} WHERE post_author IN( " . implode( ',', $userids ) . ' ) LIMIT 1' ) ) { 253 $users_have_content = true; 254 } elseif ( $wpdb->get_var( "SELECT link_id FROM {$wpdb->links} WHERE link_owner IN( " . implode( ',', $userids ) . ' ) LIMIT 1' ) ) { 255 $users_have_content = true; 256 } 242 257 } 243 258 244 259 if ( $users_have_content ) {