Make WordPress Core


Ignore:
Timestamp:
07/05/2006 10:00:03 PM (20 years ago)
Author:
ryan
Message:

Use wp_die(). Props filosofo. fixes #2914

File:
1 edited

Legend:

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

    r3956 r3985  
    2020
    2121        if ( ! $comment = get_comment($comment) )
    22                 die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'javascript:history.go(-1)'));
     22                wp_die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'javascript:history.go(-1)'));
    2323
    2424        if ( !current_user_can('edit_post', $comment->comment_post_ID) )
    25                 die( __('You are not allowed to edit comments on this post.') );
     25                wp_die( __('You are not allowed to edit comments on this post.') );
    2626
    2727        $comment = get_comment_to_edit($comment);
    … …  
    4343
    4444        if ( ! $comment = get_comment($comment) )
    45                 die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
     45                wp_die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
    4646
    4747        if ( !current_user_can('edit_post', $comment->comment_post_ID) )
    48                 die( 'confirmdeletecomment' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
     48                wp_die( 'confirmdeletecomment' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
    4949
    5050        echo "<div class='wrap'>\n";
    … …  
    9191
    9292        $postdata = get_post($p) or
    93                 die(sprintf(__('Oops, no post with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
     93                wp_die(sprintf(__('Oops, no post with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
    9494
    9595        if ( ! $comment = get_comment($comment) )
    96                          die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit-comments.php'));
     96                         wp_die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit-comments.php'));
    9797
    9898        if ( !current_user_can('edit_post', $comment->comment_post_ID) )
    99                 die( __('You are not allowed to edit comments on this post.') );
     99                wp_die( __('You are not allowed to edit comments on this post.') );
    100100
    101101        if ( 'spam' == $_REQUEST['delete_type'] )
    … …  
    124124
    125125        if ( ! $comment = get_comment($comment) )
    126                 die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
     126                wp_die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
    127127
    128128        if ( !current_user_can('edit_post', $comment->comment_post_ID) )
    129                 die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') );
     129                wp_die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') );
    130130
    131131        wp_set_comment_status($comment->comment_ID, "hold");
    … …  
    151151
    152152        if ( ! $comment = get_comment($comment) )
    153                 die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
     153                wp_die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
    154154
    155155        if ( !current_user_can('edit_post', $comment->comment_post_ID) )
    156                 die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
     156                wp_die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
    157157
    158158        wp_set_comment_status($comment->comment_ID, "approve");
Note: See TracChangeset for help on using the changeset viewer.