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 | }); |
| 93 | } |
244 | | <fieldset><p><legend><?php echo _n( 'What should be done with posts owned by this user?', 'What should be done with posts owned by these users?', $go_delete ); ?></legend></p> |
245 | | <ul style="list-style:none;"> |
246 | | <li><label><input type="radio" id="delete_option0" name="delete_option" value="delete" /> |
247 | | <?php _e('Delete all posts.'); ?></label></li> |
248 | | <li><input type="radio" id="delete_option1" name="delete_option" value="reassign" /> |
249 | | <?php echo '<label for="delete_option1">' . __( 'Attribute all posts to:' ) . '</label> '; |
250 | | wp_dropdown_users( array( 'name' => 'reassign_user', 'exclude' => array_diff( $userids, array($current_user->ID) ) ) ); ?></li> |
251 | | </ul></fieldset> |
| 248 | <?php if( ! $users_posts->have_posts() ) : ?> |
| 249 | <input type="hidden" id="delete_option_hidden" name="delete_option" value="delete" /> |
| 250 | <?php else: ?> |
| 251 | <fieldset><p><legend><?php echo _n( 'What should be done with posts owned by this user?', 'What should be done with posts owned by these users?', $go_delete ); ?></legend></p> |
| 252 | <ul style="list-style:none;"> |
| 253 | <li><label><input type="radio" id="delete_option0" name="delete_option" value="delete" /> |
| 254 | <?php _e('Delete all posts.'); ?></label></li> |
| 255 | <li><input type="radio" id="delete_option1" name="delete_option" value="reassign" /> |
| 256 | <?php echo '<label for="delete_option1">' . __( 'Attribute all posts to:' ) . '</label> '; |
| 257 | wp_dropdown_users( array( 'name' => 'reassign_user', 'exclude' => array_diff( $userids, array($current_user->ID) ) ) ); ?></li> |
| 258 | </ul></fieldset> |
| 259 | <?php endif; ?> |