WordPress.org

Make WordPress Core

Ticket #7455: confirm-delete-updated.patch

File confirm-delete-updated.patch, 4.1 KB (added by noel, 6 years ago)

Updated version of patch.

  • wp-includes/script-loader.php

     
    166166                ) ); 
    167167                $scripts->add( 'admin-users', '/wp-admin/js/users.js', array('wp-lists'), '20070823' ); 
    168168                $scripts->add( 'admin-forms', '/wp-admin/js/forms.js', array('jquery'), '20080729'); 
     169                $scripts->localize( 'admin-forms', 'formsL10n', array( 
     170                        'confirmDelete' => __('Are you sure you want to delete the selected entries?'), 
     171                ) ); 
    169172                $scripts->add( 'xfn', '/wp-admin/js/xfn.js', false, '3517' ); 
    170173                $scripts->add( 'upload', '/wp-admin/js/upload.js', array('jquery'), '20070518' ); 
    171174                $scripts->add( 'postbox', '/wp-admin/js/postbox.js', array('jquery-ui-sortable'), '20080723' ); 
  • 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

     
    180180?> 
    181181 
    182182<div class="alignleft"> 
    183 <select name="action"> 
     183<select name="action" id="select-action"> 
    184184<option value="" selected="selected"><?php _e('Actions') ?></option> 
    185185<?php if ( empty($comment_status) || 'approved' == $comment_status ): ?> 
    186186<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

     
    2424                checkAll( $(this).parents( 'form:first' ) ); 
    2525        } ); 
    2626} ); 
     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( formsL10n.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

     
    182182?> 
    183183 
    184184<div class="alignleft"> 
    185 <select name="action"> 
     185<select name="action" id="select-action"> 
    186186<option value="" selected><?php _e('Actions'); ?></option> 
    187187<option value="edit"><?php _e('Edit'); ?></option> 
    188188<option value="delete"><?php _e('Delete'); ?></option> 
  • wp-admin/edit-pages.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="edit"><?php _e('Edit'); ?></option> 
    172172<option value="delete"><?php _e('Delete'); ?></option> 
  • 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>