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/admin-functions.php

    r3981 r3985  
    77        if ( 'page' == $_POST['post_type'] ) {
    88                if ( !current_user_can('edit_pages') )
    9                         die(__('You are not allowed to create pages on this blog.'));
     9                        wp_die(__('You are not allowed to create pages on this blog.'));
    1010        } else {
    1111                if ( !current_user_can('edit_posts') )
    12                         die(__('You are not allowed to create posts or drafts on this blog.'));
     12                        wp_die(__('You are not allowed to create posts or drafts on this blog.'));
    1313        }
    1414
    … …  
    3333                if ( 'page' == $_POST['post_type'] ) {
    3434                        if ( !current_user_can('edit_others_pages') )
    35                                 die(__('You cannot create pages as this user.'));
     35                                wp_die(__('You cannot create pages as this user.'));
    3636                } else {
    3737                        if ( !current_user_can('edit_others_posts') )
    38                                 die(__('You cannot post as this user.'));
     38                                wp_die(__('You cannot post as this user.'));
    3939
    4040                }
    … …  
    152152        if ( 'page' == $_POST['post_type'] ) {
    153153                if ( !current_user_can('edit_page', $post_ID) )
    154                         die(__('You are not allowed to edit this page.'));
     154                        wp_die(__('You are not allowed to edit this page.'));
    155155        } else {
    156156                if ( !current_user_can('edit_post', $post_ID) )
    157                         die(__('You are not allowed to edit this post.'));
     157                        wp_die(__('You are not allowed to edit this post.'));
    158158        }
    159159
    … …  
    177177                if ( 'page' == $_POST['post_type'] ) {
    178178                        if ( !current_user_can('edit_others_pages') )
    179                                 die(__('You cannot edit pages as this user.'));
     179                                wp_die(__('You cannot edit pages as this user.'));
    180180                } else {
    181181                        if ( !current_user_can('edit_others_posts') )
    182                                 die(__('You cannot edit posts as this user.'));
     182                                wp_die(__('You cannot edit posts as this user.'));
    183183
    184184                }
    … …  
    252252
    253253        if (!current_user_can('edit_post', $comment_post_ID))
    254                 die(__('You are not allowed to edit comments on this post, so you cannot edit this comment.'));
     254                wp_die(__('You are not allowed to edit comments on this post, so you cannot edit this comment.'));
    255255
    256256        $_POST['comment_author'] = $_POST['newcomment_author'];
    … …  
    531531function edit_link($link_id = '') {
    532532        if (!current_user_can('manage_links'))
    533                 die(__("Cheatin' uh ?"));
     533                wp_die(__("Cheatin' uh ?"));
    534534
    535535        $_POST['link_url'] = wp_specialchars($_POST['link_url']);
    … …  
    15221522        switch ($code) {
    15231523                case 1 :
    1524                         die(__('Sorry, can’t edit files with ".." in the name. If you are trying to edit a file in your WordPress home directory, you can just type the name of the file in.'));
     1524                        wp_die(__('Sorry, can’t edit files with ".." in the name. If you are trying to edit a file in your WordPress home directory, you can just type the name of the file in.'));
    15251525
    15261526                case 2 :
    1527                         die(__('Sorry, can’t call files with their real path.'));
     1527                        wp_die(__('Sorry, can’t call files with their real path.'));
    15281528
    15291529                case 3 :
    1530                         die(__('Sorry, that file cannot be edited.'));
     1530                        wp_die(__('Sorry, that file cannot be edited.'));
    15311531        }
    15321532}
    … …  
    18451845        $new_file = $uploads['path'] . "/$filename";
    18461846        if ( false === @ move_uploaded_file($file['tmp_name'], $new_file) )
    1847                 die(printf(__('The uploaded file could not be moved to %s.'), $file['path']));
     1847                wp_die(printf(__('The uploaded file could not be moved to %s.'), $file['path']));
    18481848
    18491849        // Set correct file permissions
Note: See TracChangeset for help on using the changeset viewer.