Make WordPress Core


Ignore:
Timestamp:
07/13/2005 10:26:26 PM (20 years ago)
Author:
ryan
Message:

Migrate to caps.

File:
1 edited

Legend:

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

    r2703 r2709  
    7070        die ( __('You are not allowed to edit this post.') );
    7171
    72     if ( !user_can_edit_post($user_ID, $post_ID) )
    73         die ( __('You are not allowed to view other users\' private posts.') );     
    74 
    7572    $post = get_post_to_edit($post_ID);
    7673   
     
    121118    $post_id = (isset($_GET['post']))  ? intval($_GET['post']) : intval($_POST['post_ID']);
    122119   
    123     if (!user_can_delete_post($user_ID, $post_id)) {
     120    if ( !current_user_can('edit_post', $post_id) )
    124121        die( __('You are not allowed to delete this post.') );
    125     }
    126122
    127123    if (! wp_delete_post($post_id))
     
    146142        die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'javascript:history.go(-1)'));
    147143
    148     if ( !user_can_edit_post_comments($user_ID, $comment->comment_post_ID) )
     144    if ( !current_user_can('edit_post', $comment->comment_post_ID) )   
    149145        die( __('You are not allowed to edit comments on this post.') );
    150146
     
    165161        die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
    166162
    167     if ( !user_can_delete_post_comments($user_ID, $comment->comment_post_ID) )
     163    if ( !current_user_can('edit_post', $comment->comment_post_ID) )   
    168164        die( __('You are not allowed to delete comments on this post.') );
    169165
     
    208204             die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'post.php'));
    209205
    210     if (!user_can_delete_post_comments($user_ID, $commentdata['comment_post_ID']))
     206    if ( !current_user_can('edit_post', $comment->comment_post_ID) )   
    211207        die( __('You are not allowed to edit comments on this post.') );
    212208
     
    239235        die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
    240236
    241     if ( !user_can_edit_post_comments($user_ID, $comment->comment_post_ID) )
     237    if ( !current_user_can('edit_post', $comment->comment_post_ID) )   
    242238        die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') );
    243239
     
    259255             die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
    260256
    261     if ( !user_can_edit_post_comments($user_ID, $comment->comment_post_ID) )
     257    if ( !current_user_can('edit_post', $comment->comment_post_ID) )   
    262258        die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
    263259
     
    285281        die(sprintf(__('Oops, no comment with this ID. <a href="%s">Go back</a>!'), 'edit.php'));
    286282
    287     if ( !user_can_edit_post_comments($user_ID, $commentdata['comment_post_ID']))
     283    if ( !current_user_can('edit_post', $comment->comment_post_ID) )   
    288284        die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
    289285
     
    323319<?php endif; ?>
    324320<?php
    325     if ( user_can_create_draft($user_ID) ) {
     321    if ( current_user_can('edit_posts') ) {
    326322        $action = 'post';
    327323        get_currentuserinfo();
Note: See TracChangeset for help on using the changeset viewer.