Changeset 2724

Show
Ignore:
Timestamp:
07/17/05 21:21:50 (3 years ago)
Author:
ryan
Message:

Cap migration.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/edit-comments.php

    r2259 r2724  
    4444        $post_id = $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment"); 
    4545        $authordata = get_userdata( $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id") ); 
    46         if ( user_can_delete_post_comments($user_ID, $post_id) ) : 
     46        if ( current_user_can('edit_post', $post_id) ) : 
    4747            $wpdb->query("DELETE FROM $wpdb->comments WHERE comment_ID = $comment"); 
    4848            ++$i; 
     
    9494 
    9595        <p><?php _e('Posted'); echo ' '; comment_date('M j, g:i A');   
    96             if ( user_can_edit_post_comments($user_ID, $comment->comment_post_ID) ) { 
     96            if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    9797                echo " | <a href=\"post.php?action=editcomment&amp;comment=".$comment->comment_ID."\">" . __('Edit Comment') . "</a>"; 
    9898            } 
    99             if ( user_can_delete_post_comments($user_ID, $comment->comment_post_ID) ) { 
     99            if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    100100                echo " | <a href=\"post.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return confirm('" . sprintf(__("You are about to delete this comment by \'%s\'\\n  \'Cancel\' to stop, \'OK\' to delete."), $comment->comment_author) . "')\">" . __('Delete Comment') . "</a> &#8212; "; 
    101101            } // end if any comments to show 
    102102            // Get post title 
    103             if ( user_can_edit_post($user_ID, $comment->comment_post_ID) ) { 
     103            if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    104104                $post_title = $wpdb->get_var("SELECT post_title FROM $wpdb->posts WHERE ID = $comment->comment_post_ID"); 
    105105                $post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title; 
     
    139139?> 
    140140  <tr class='<?php echo $class; ?>'> 
    141     <td><?php if (user_can_delete_post_comments($user_ID, $comment->comment_post_ID) ) { ?><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /><?php } ?></td> 
     141    <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { ?><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /><?php } ?></td> 
    142142    <td><?php comment_author_link() ?></td> 
    143143    <td><?php comment_author_email_link() ?></td> 
     
    145145    <td><?php comment_excerpt(); ?></td> 
    146146    <td><a href="<?php echo get_permalink($comment->comment_post_ID); ?>#comment-<?php comment_ID() ?>" class="edit"><?php _e('View') ?></a></td> 
    147     <td><?php if ( user_can_edit_post_comments($user_ID, $comment->comment_post_ID) ) { 
     147    <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    148148    echo "<a href='post.php?action=editcomment&amp;comment=$comment->comment_ID' class='edit'>" .  __('Edit') . "</a>"; } ?></td> 
    149     <td><?php if ( user_can_delete_post_comments($user_ID, $comment->comment_post_ID) ) { 
     149    <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 
    150150            echo "<a href=\"post.php?action=deletecomment&amp;p=".$comment->comment_post_ID."&amp;comment=".$comment->comment_ID."\" onclick=\"return confirm('" . sprintf(__("You are about to delete this comment by \'%s\'\\n  \'Cancel\' to stop, \'OK\' to delete."), $comment->comment_author) . "')\"    class='delete'>" . __('Delete') . "</a>"; } ?></td> 
    151151  </tr> 
  • trunk/wp-admin/edit-form.php

    r2651 r2724  
    5959  <input name="saveasprivate" type="submit" id="saveasprivate" tabindex="10" value="<?php _e('Save as Private') ?>" /> 
    6060 
    61      <?php if ( user_can_create_post($user_ID) ) : ?> 
     61     <?php if ( current_user_can('edit_posts') ) : ?> 
    6262  <input name="publish" type="submit" id="publish" tabindex="6" style="font-weight: bold;" value="<?php _e('Publish') ?>" />  
    6363<?php endif; ?>