diff --git wp-admin/users.php wp-admin/users.php
index df7648b..4f04f06 100644
|
|
$update = ''; |
82 | 82 | function delete_users_add_js() { ?> |
83 | 83 | <script> |
84 | 84 | jQuery(document).ready( function($) { |
85 | | var submit = $('#submit').prop('disabled', true); |
86 | | $('input[name=delete_option]').one('change', function() { |
87 | | submit.prop('disabled', false); |
88 | | }); |
89 | | $('#reassign_user').focus( function() { |
90 | | $('#delete_option1').prop('checked', true).trigger('change'); |
91 | | }); |
| 85 | if( $('#delete_option_hidden').length == 0 ) { |
| 86 | var submit = $('#submit').prop('disabled', true); |
| 87 | $('input[name=delete_option]').one('change', function() { |
| 88 | submit.prop('disabled', false); |
| 89 | }); |
| 90 | $('#reassign_user').focus( function() { |
| 91 | $('#delete_option1').prop('checked', true).trigger('change'); |
| 92 | }); |
92 | 93 | }); |
93 | 94 | </script> |
94 | 95 | <?php |
… |
… |
case 'delete': |
207 | 208 | |
208 | 209 | add_action( 'admin_head', 'delete_users_add_js' ); |
209 | 210 | |
| 211 | $users_posts = new WP_Query( array( 'post_type' => 'any', 'author' => implode( ',', $userids ) ) ); |
| 212 | |
210 | 213 | include( ABSPATH . 'wp-admin/admin-header.php' ); |
211 | 214 | ?> |
212 | 215 | <form method="post" name="updateusers" id="updateusers"> |
… |
… |
case 'delete': |
242 | 245 | ?> |
243 | 246 | </ul> |
244 | 247 | <?php if ( $go_delete ) : ?> |
245 | | <?php if ( 1 == $go_delete ) : ?> |
246 | | <fieldset><p><legend><?php _e( 'What should be done with content owned by this user?' ); ?></legend></p> |
247 | | <?php else : ?> |
248 | | <fieldset><p><legend><?php _e( 'What should be done with content owned by these users?' ); ?></legend></p> |
| 248 | <?php if( ! $users_posts->have_posts() ) : ?> |
| 249 | <input type="hidden" id="delete_option_hidden" name="delete_option" value="delete" /> |
| 250 | <?php else: ?> |
| 251 | <?php if ( 1 == $go_delete ) : ?> |
| 252 | <fieldset><p><legend><?php _e( 'What should be done with content owned by this user?' ); ?></legend></p> |
| 253 | <?php else : ?> |
| 254 | <fieldset><p><legend><?php _e( 'What should be done with content owned by these users?' ); ?></legend></p> |
| 255 | <?php endif; ?> |
| 256 | <ul style="list-style:none;"> |
| 257 | <li><label><input type="radio" id="delete_option0" name="delete_option" value="delete" /> |
| 258 | <?php _e('Delete all content.'); ?></label></li> |
| 259 | <li><input type="radio" id="delete_option1" name="delete_option" value="reassign" /> |
| 260 | <?php echo '<label for="delete_option1">' . __( 'Attribute all content to:' ) . '</label> '; |
| 261 | wp_dropdown_users( array( 'name' => 'reassign_user', 'exclude' => array_diff( $userids, array($current_user->ID) ) ) ); ?></li> |
| 262 | </ul></fieldset> |
249 | 263 | <?php endif; ?> |
250 | | <ul style="list-style:none;"> |
251 | | <li><label><input type="radio" id="delete_option0" name="delete_option" value="delete" /> |
252 | | <?php _e('Delete all content.'); ?></label></li> |
253 | | <li><input type="radio" id="delete_option1" name="delete_option" value="reassign" /> |
254 | | <?php echo '<label for="delete_option1">' . __( 'Attribute all content to:' ) . '</label> '; |
255 | | wp_dropdown_users( array( 'name' => 'reassign_user', 'exclude' => array_diff( $userids, array($current_user->ID) ) ) ); ?></li> |
256 | | </ul></fieldset> |
257 | 264 | <?php |
258 | 265 | /** |
259 | 266 | * Fires at the end of the delete users form prior to the confirm button. |