- Timestamp:
- 12/23/2015 04:45:42 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/users.php
r35790 r36068 212 212 $userids = array_map( 'intval', (array) $_REQUEST['users'] ); 213 213 214 $users_posts = new WP_Query( array( 215 'post_type' => 'any', 216 'author' => implode( ',', $userids ), 217 'posts_per_page' => 1 218 ) ); 219 220 if ( $users_posts->have_posts() ) { 214 $users_have_content = false; 215 if ( $wpdb->get_var( "SELECT ID FROM {$wpdb->posts} WHERE post_author IN( " . implode( ',', $userids ) . " ) LIMIT 1" ) ) { 216 $users_have_content = true; 217 } elseif ( $wpdb->get_var( "SELECT link_id FROM {$wpdb->links} WHERE link_owner IN( " . implode( ',', $userids ) . " ) LIMIT 1" ) ) { 218 $users_have_content = true; 219 } 220 221 if ( $users_have_content ) { 221 222 add_action( 'admin_head', 'delete_users_add_js' ); 222 223 } … … 258 259 <?php if ( $go_delete ) : 259 260 260 if ( ! $users_ posts->have_posts()) : ?>261 if ( ! $users_have_content ) : ?> 261 262 <input type="hidden" name="delete_option" value="delete" /> 262 263 <?php else: ?>
Note: See TracChangeset
for help on using the changeset viewer.