Changeset 34000
- Timestamp:
- 09/10/2015 04:46:38 PM (9 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/user.php
r33774 r34000 447 447 echo '</p></div>'; 448 448 } 449 450 /** 451 * @since 3.5.0 452 * @access private 453 */ 454 function delete_users_add_js() { ?> 455 <script> 456 jQuery(document).ready( function($) { 457 var submit = $('#submit').prop('disabled', true); 458 $('input[name="delete_option"]').one('change', function() { 459 submit.prop('disabled', false); 460 }); 461 $('#reassign_user').focus( function() { 462 $('#delete_option1').prop('checked', true).trigger('change'); 463 }); 464 }); 465 </script> 466 <?php 467 } -
trunk/src/wp-admin/users.php
r33888 r34000 81 81 $update = ''; 82 82 83 /**84 * @since 3.5.085 * @access private86 */87 function delete_users_add_js() { ?>88 <script>89 jQuery(document).ready( function($) {90 var submit = $('#submit').prop('disabled', true);91 $('input[name=delete_option]').one('change', function() {92 submit.prop('disabled', false);93 });94 $('#reassign_user').focus( function() {95 $('#delete_option1').prop('checked', true).trigger('change');96 });97 });98 </script>99 <?php100 }101 102 83 switch ( $wp_list_table->current_action() ) { 103 84 … … 216 197 $userids = array_map( 'intval', (array) $_REQUEST['users'] ); 217 198 218 add_action( 'admin_head', 'delete_users_add_js' ); 199 $users_posts = new WP_Query( array( 200 'post_type' => 'any', 201 'author' => implode( ',', $userids ), 202 'posts_per_page' => 1 203 ) ); 204 205 if ( $users_posts->have_posts() ) { 206 add_action( 'admin_head', 'delete_users_add_js' ); 207 } 219 208 220 209 include( ABSPATH . 'wp-admin/admin-header.php' ); … … 252 241 ?> 253 242 </ul> 254 <?php if ( $go_delete ) : ?> 255 <?php if ( 1 == $go_delete ) : ?> 256 <fieldset><p><legend><?php _e( 'What should be done with content owned by this user?' ); ?></legend></p> 257 <?php else : ?> 258 <fieldset><p><legend><?php _e( 'What should be done with content owned by these users?' ); ?></legend></p> 259 <?php endif; ?> 260 <ul style="list-style:none;"> 261 <li><label><input type="radio" id="delete_option0" name="delete_option" value="delete" /> 262 <?php _e('Delete all content.'); ?></label></li> 263 <li><input type="radio" id="delete_option1" name="delete_option" value="reassign" /> 264 <?php echo '<label for="delete_option1">' . __( 'Attribute all content to:' ) . '</label> '; 265 wp_dropdown_users( array( 'name' => 'reassign_user', 'exclude' => array_diff( $userids, array($current_user->ID) ) ) ); ?></li> 266 </ul></fieldset> 267 <?php 243 <?php if ( $go_delete ) : 244 245 if ( ! $users_posts->have_posts() ) : ?> 246 <input type="hidden" name="delete_option" value="delete" /> 247 <?php else: ?> 248 <?php if ( 1 == $go_delete ) : ?> 249 <fieldset><p><legend><?php _e( 'What should be done with content owned by this user?' ); ?></legend></p> 250 <?php else : ?> 251 <fieldset><p><legend><?php _e( 'What should be done with content owned by these users?' ); ?></legend></p> 252 <?php endif; ?> 253 <ul style="list-style:none;"> 254 <li><label><input type="radio" id="delete_option0" name="delete_option" value="delete" /> 255 <?php _e('Delete all content.'); ?></label></li> 256 <li><input type="radio" id="delete_option1" name="delete_option" value="reassign" /> 257 <?php echo '<label for="delete_option1">' . __( 'Attribute all content to:' ) . '</label> '; 258 wp_dropdown_users( array( 'name' => 'reassign_user', 'exclude' => array_diff( $userids, array($current_user->ID) ) ) ); ?></li> 259 </ul></fieldset> 260 <?php endif; 268 261 /** 269 262 * Fires at the end of the delete users form prior to the confirm button.
Note: See TracChangeset
for help on using the changeset viewer.