WordPress.org

Make WordPress Core

Changeset 7755


Ignore:
Timestamp:
04/21/08 16:45:48 (7 years ago)
Author:
ryan
Message:

Redirect back to original referer when deleting a comment from the edit comment page. fixes #6458 for trunk

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/comment.php

    r7304 r7755  
    142142        wp_delete_comment( $comment->comment_ID ); 
    143143 
    144     if ( '' != wp_get_referer() && false == $noredir ) 
     144    if ( '' != wp_get_referer() && false == $noredir && false === strpos(wp_get_referer(), 'comment.php' ) ) 
    145145        wp_redirect( wp_get_referer() ); 
     146    else if ( '' != wp_get_original_referer() && false == $noredir ) 
     147        wp_redirect( wp_get_original_referer() ); 
    146148    else 
    147149        wp_redirect( get_option('siteurl') . '/wp-admin/edit-comments.php' ); 
  • trunk/wp-admin/edit-form-comment.php

    r7530 r7755  
    4747<input type="submit" name="save" value="<?php _e('Save'); ?>" tabindex="4" class="button button-highlighted" /> 
    4848<?php 
    49 echo "<a class='submitdelete' href='" . wp_nonce_url("comment.php?action=deletecomment&amp;c=$comment->comment_ID", 'delete-comment_' . $comment->comment_ID) . "' onclick=\"if ( confirm('" . js_escape(__("You are about to delete this comment. \n  'Cancel' to stop, 'OK' to delete.")) . "') ) { return true;}return false;\">" . __('Delete comment') . "</a>"; 
     49echo "<a class='submitdelete' href='" . wp_nonce_url("comment.php?action=deletecomment&amp;c=$comment->comment_ID&amp;_wp_original_http_referer=" . wp_get_referer(), 'delete-comment_' . $comment->comment_ID) . "' onclick=\"if ( confirm('" . js_escape(__("You are about to delete this comment. \n  'Cancel' to stop, 'OK' to delete.")) . "') ) { return true;}return false;\">" . __('Delete comment') . "</a>"; 
    5050?> 
    5151</p> 
     
    9696<input type="hidden" name="p" value="<?php echo $comment->comment_post_ID ?>" /> 
    9797<input name="referredby" type="hidden" id="referredby" value="<?php echo wp_get_referer(); ?>" /> 
     98<?php wp_original_referer_field(true, 'previous'); ?> 
    9899<input type="hidden" name="noredir" value="1" /> 
    99100</div> 
Note: See TracChangeset for help on using the changeset viewer.