WordPress.org

Make WordPress Core

Ticket #7455: delete-confirm.patch

File delete-confirm.patch, 3.3 KB (added by noel, 10 years ago)

This is patched for 2.7 and the dropdown mechanism.

  • wp-admin/edit-link-categories.php

     
    9696?>
    9797
    9898<div class="alignleft">
    99 <select name="action">
     99<select name="action" id="select-action">
    100100<option value="" selected><?php _e('Actions'); ?></option>
    101101<option value="delete"><?php _e('Delete'); ?></option>
    102102</select>
  • wp-admin/edit-comments.php

     
    173173?>
    174174
    175175<div class="alignleft">
    176 <select name="action">
     176<select name="action" id="select-action">
    177177<option value="" selected><?php _e('Actions') ?></option>
    178178<?php if ( 'approved' == $comment_status ): ?>
    179179<option value="unapprove"><?php _e('Unapprove'); ?></option>
  • wp-admin/edit-tags.php

     
    164164?>
    165165
    166166<div class="alignleft">
    167 <select name="action">
     167<select name="action" id="select-action">
    168168<option value="" selected><?php _e('Actions'); ?></option>
    169169<option value="delete"><?php _e('Delete'); ?></option>
    170170</select>
  • wp-admin/js/forms.js

     
    2323        $( 'thead :checkbox' ).click( function() {
    2424                checkAll( $(this).parents( 'form:first' ) );
    2525        } );
    26 } );
    27  No newline at end of file
     26} );
     27
     28jQuery(document).ready( function() {
     29        jQuery('.button-secondary.action').click( function(e) {
     30                var selected = jQuery('#select-action option:selected');
     31                if( selected.val() == 'delete') {
     32                        return confirm( formL10n.confirmDelete );
     33                } else {
     34                        if( selected.val() == 'edit' ) return true;
     35                        return false;
     36                }
     37        });
     38});
     39 No newline at end of file
  • wp-admin/edit.php

     
    166166?>
    167167
    168168<div class="alignleft">
    169 <select name="action">
     169<select name="action" id="select-action">
    170170<option value="" selected><?php _e('Actions'); ?></option>
    171171<option value="delete"><?php _e('Delete'); ?></option>
    172172<option value="edit"><?php _e('Edit'); ?></option>
  • wp-admin/edit-pages.php

     
    149149?>
    150150
    151151<div class="alignleft">
    152 <select name="action">
     152<select name="action" id="select-action">
    153153<option value="" selected><?php _e('Actions'); ?></option>
    154154<option value="delete"><?php _e('Delete'); ?></option>
    155155</select>
  • wp-admin/categories.php

     
    157157?>
    158158
    159159<div class="alignleft">
    160 <select name="action">
     160<select name="action" id="select-action">
    161161<option value="" selected><?php _e('Actions'); ?></option>
    162162<option value="delete"><?php _e('Delete'); ?></option>
    163163</select>