WordPress.org

Make WordPress Core

Ticket #5790: delete_confirm_new.diff

File delete_confirm_new.diff, 10.6 KB (added by ffemtcj, 6 years ago)

Patch using the new language

  • wp-admin/edit-comments.php

     
    158158                } // end foreach 
    159159        ?></tbody> 
    160160</table> 
    161 <p class="submit"><input type="submit" name="delete_button" class="delete" value="<?php _e('Delete Checked Comments &raquo;') ?>" onclick="var numchecked = getNumChecked(document.getElementById('deletecomments')); if(numchecked < 1) { alert('<?php echo js_escape(__("Please select some comments to delete")); ?>'); return false } return confirm('<?php echo sprintf(js_escape(__("You are about to delete %s comments permanently \n  'Cancel' to stop, 'OK' to delete.")), "' + numchecked + '"); ?>')" /> 
     161<p class="submit"><input type="submit" name="delete_button" class="delete" value="<?php _e('Delete Checked Comments &raquo;') ?>" onclick="var numchecked = getNumChecked(document.getElementById('deletecomments')); if(numchecked < 1) { alert('<?php echo js_escape(__("Please select some comments to delete")); ?>'); return false } return confirm('<?php echo sprintf(js_escape(__("You are about to delete %s comments permanently \n  Press 'OK' to delete or 'Cancel' to stop.")), "' + numchecked + '"); ?>')" /> 
    162162                        <input type="submit" name="spam_button" value="<?php _e('Mark Checked Comments as Spam &raquo;') ?>" onclick="var numchecked = getNumChecked(document.getElementById('deletecomments')); if(numchecked < 1) { alert('<?php echo js_escape(__("Please select some comments to mark as spam")); ?>'); return false } return confirm('<?php echo sprintf(js_escape(__("You are about to mark %s comments as spam \n  'Cancel' to stop, 'OK' to mark as spam.")), "' + numchecked + '"); ?>')" /></p> 
    163163  </form> 
    164164<div id="ajax-response"></div> 
  • wp-admin/edit-form-advanced.php

     
    152152} 
    153153 
    154154if ( ('edit' == $action) && current_user_can('delete_post', $post_ID) ) 
    155         echo "<a href='" . wp_nonce_url("post.php?action=delete&amp;post=$post_ID", 'delete-post_' . $post_ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n  'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n  'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete post') . "</a>"; 
     155        echo "<a href='" . wp_nonce_url("post.php?action=delete&amp;post=$post_ID", 'delete-post_' . $post_ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n  Press 'OK' to delete or 'Cancel' to stop.") : __("You are about to delete this post '%s'\n  Press 'OK' to delete or 'Cancel' to stop."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete post') . "</a>"; 
    156156?> 
    157157<?php if ($post_ID): ?> 
    158158<br /> 
  • wp-admin/edit-form-comment.php

     
    7575 
    7676        <tr> 
    7777                <th scope="row" valign="top">&nbsp;</th> 
    78                 <td><input name="deletecomment" class="button delete" type="submit" id="deletecomment" tabindex="10" value="<?php _e('Delete this comment') ?>" <?php echo "onclick=\"if ( confirm('" . js_escape(__("You are about to delete this comment. \n  'Cancel' to stop, 'OK' to delete.")) . "') ) { document.forms.post._wpnonce.value = '" . wp_create_nonce( 'delete-comment_' . $comment->comment_ID ) . "'; return true; } return false;\""; ?> /> 
     78                <td><input name="deletecomment" class="button delete" type="submit" id="deletecomment" tabindex="10" value="<?php _e('Delete this comment') ?>" <?php echo "onclick=\"if ( confirm('" . js_escape(__("You are about to delete this comment. \n  Press 'OK' to delete or 'Cancel' to stop.")) . "') ) { document.forms.post._wpnonce.value = '" . wp_create_nonce( 'delete-comment_' . $comment->comment_ID ) . "'; return true; } return false;\""; ?> /> 
    7979                <input type="hidden" name="c" value="<?php echo $comment->comment_ID ?>" /> 
    8080                <input type="hidden" name="p" value="<?php echo $comment->comment_post_ID ?>" /> 
    8181                <input type="hidden" name="noredir" value="1" /> 
  • wp-admin/edit-page-form.php

     
    117117} 
    118118 
    119119if ( ('edit' == $action) && current_user_can('delete_page', $post_ID) ) 
    120         echo "<a href='" . wp_nonce_url("page.php?action=delete&amp;post=$post_ID", 'delete-post_' . $post_ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n  'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n  'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete page') . "</a>"; 
     120        echo "<a href='" . wp_nonce_url("page.php?action=delete&amp;post=$post_ID", 'delete-post_' . $post_ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n  Press 'OK' to delete or 'Cancel' to stop.") : __("You are about to delete this page '%s'\n  Press 'OK' to delete or 'Cancel' to stop."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete page') . "</a>"; 
    121121?> 
    122122<?php if ($post_ID): ?> 
    123123<br /> 
  • wp-admin/edit-post-rows.php

     
    9494 
    9595        case 'control_delete': 
    9696                ?> 
    97                 <td><?php if ( current_user_can('delete_post',$post->ID) ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&amp;post=$id", 'delete-post_' . $post->ID) . "' class='delete:the-list:post-$post->ID delete'>" . __('Delete') . "</a>"; } ?></td> 
     97                <td><?php if ( current_user_can('delete_post',$post->ID) ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&amp;post=$id", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n  Press 'OK' to delete or 'Cancel' to stop.") : __("You are about to delete this post '%s'\n  Press 'OK' to delete or 'Cancel' to stop."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; } ?></td> 
    9898                <?php 
    9999                break; 
    100100 
  • wp-admin/includes/template.php

     
    4242                $default_cat_id = (int) get_option( 'default_category' ); 
    4343 
    4444                if ( $category->term_id != $default_cat_id ) 
    45                         $edit .= "<td><a href='" . wp_nonce_url( "categories.php?action=delete&amp;cat_ID=$category->term_id", 'delete-category_' . $category->term_id ) . "' class='delete:the-list:cat-$category->term_id delete'>".__( 'Delete' )."</a>"; 
     45                        $edit .= "<td align='center'><a href='" . wp_nonce_url( "categories.php?action=delete&amp;cat_ID=$category->term_id", 'delete-category_' . $category->term_id ) . "' onclick=\"if ( confirm('" . js_escape(sprintf( __("You are about to delete this post '%s'\n  Press 'OK' to delete or 'Cancel' to stop."), $category->name )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; 
    4646                else 
    4747                        $edit .= "<td style='text-align:center'>".__( "Default" ); 
    4848        } else 
     
    350350    <td><?php if ( '0000-00-00 00:00:00' ==$page->post_modified ) _e('Unpublished'); else echo mysql2date( __('Y-m-d g:i a'), $page->post_modified ); ?></td> 
    351351    <td><a href="<?php the_permalink(); ?>" rel="permalink" class="view"><?php _e( 'View' ); ?></a></td> 
    352352    <td><?php if ( current_user_can( 'edit_page', $id ) ) { echo "<a href='page.php?action=edit&amp;post=$id' class='edit'>" . __( 'Edit' ) . "</a>"; } ?></td> 
    353     <td><?php if ( current_user_can( 'delete_page', $id ) ) { echo "<a href='" . wp_nonce_url( "page.php?action=delete&amp;post=$id", 'delete-page_' . $id ) .  "' class='delete:the-list:page-$id delete'>" . __( 'Delete' ) . "</a>"; } ?></td> 
     353    <td><?php if ( current_user_can( 'delete_page', $id ) ) { echo "<a href='" . wp_nonce_url( "page.php?action=delete&amp;post=$id", 'delete-page_' . $id ) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n  Press 'OK' to delete or 'Cancel' to stop.") : __("You are about to delete this page '%s'\n  Press 'OK' to delete or 'Cancel' to stop."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>"; } ?></td> 
    354354  </tr> 
    355355 
    356356<?php 
  • wp-admin/link-manager.php

     
    164164                                        break; 
    165165                                case 'action': 
    166166                                        echo "<td><a href='link.php?link_id=$link->link_id&amp;action=edit' class='edit'>" . __('Edit') . '</a></td>'; 
    167                                         echo "<td><a href='" . wp_nonce_url('link.php?link_id='.$link->link_id.'&amp;action=delete', 'delete-bookmark_' . $link->link_id ) . "' class='delete:the-list:link-$link->link_id delete'>" . __('Delete') . '</a></td>'; 
     167                                        echo "<td align='center'><a href='" . wp_nonce_url('link.php?link_id='.$link->link_id.'&amp;action=delete', 'delete-bookmark_' . $link->link_id ) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this link '%s'\n  Press 'OK' to delete or 'Cancel' to stop.") : __("You are about to delete this link '%s'\n  Press 'OK' to delete or 'Cancel' to stop."), $link->link_name )) . "') ) { return true;}return false;\">" . __('Delete') . '</a></td>'; 
    168168                                        break; 
    169169                                default: 
    170170                                        ?> 
     
    183183 
    184184<div id="ajax-response"></div> 
    185185 
    186 <p class="submit"><input type="submit" class="button" name="deletebookmarks" id="deletebookmarks" value="<?php _e('Delete Checked Links &raquo;') ?>" onclick="return confirm('<?php echo js_escape(__("You are about to delete these links permanently.\n'Cancel' to stop, 'OK' to delete.")); ?>')" /></p> 
     186<p class="submit"><input type="submit" class="button" name="deletebookmarks" id="deletebookmarks" value="<?php _e('Delete Checked Links &raquo;') ?>" onclick="return confirm('<?php echo js_escape(__("You are about to delete these links permanently.\nPress 'OK' to delete or 'Cancel' to stop.")); ?>')" /></p> 
    187187</form> 
    188188 
    189189<?php } ?>