Cap migration.
git-svn-id: http://svn.automattic.com/wordpress/trunk@2724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
63073bc4fe
commit
5ac98a6fba
|
@ -43,7 +43,7 @@ if ( !empty( $_POST['delete_comments'] ) ) :
|
||||||
$comment = (int) $comment;
|
$comment = (int) $comment;
|
||||||
$post_id = $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment");
|
$post_id = $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment");
|
||||||
$authordata = get_userdata( $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id") );
|
$authordata = get_userdata( $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id") );
|
||||||
if ( user_can_delete_post_comments($user_ID, $post_id) ) :
|
if ( current_user_can('edit_post', $post_id) ) :
|
||||||
$wpdb->query("DELETE FROM $wpdb->comments WHERE comment_ID = $comment");
|
$wpdb->query("DELETE FROM $wpdb->comments WHERE comment_ID = $comment");
|
||||||
++$i;
|
++$i;
|
||||||
endif;
|
endif;
|
||||||
|
@ -93,14 +93,14 @@ if ('view' == $mode) {
|
||||||
<?php comment_text() ?>
|
<?php comment_text() ?>
|
||||||
|
|
||||||
<p><?php _e('Posted'); echo ' '; comment_date('M j, g:i A');
|
<p><?php _e('Posted'); echo ' '; comment_date('M j, g:i A');
|
||||||
if ( user_can_edit_post_comments($user_ID, $comment->comment_post_ID) ) {
|
if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
|
||||||
echo " | <a href=\"post.php?action=editcomment&comment=".$comment->comment_ID."\">" . __('Edit Comment') . "</a>";
|
echo " | <a href=\"post.php?action=editcomment&comment=".$comment->comment_ID."\">" . __('Edit Comment') . "</a>";
|
||||||
}
|
}
|
||||||
if ( user_can_delete_post_comments($user_ID, $comment->comment_post_ID) ) {
|
if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
|
||||||
echo " | <a href=\"post.php?action=deletecomment&p=".$comment->comment_post_ID."&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> — ";
|
echo " | <a href=\"post.php?action=deletecomment&p=".$comment->comment_post_ID."&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> — ";
|
||||||
} // end if any comments to show
|
} // end if any comments to show
|
||||||
// Get post title
|
// Get post title
|
||||||
if ( user_can_edit_post($user_ID, $comment->comment_post_ID) ) {
|
if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
|
||||||
$post_title = $wpdb->get_var("SELECT post_title FROM $wpdb->posts WHERE ID = $comment->comment_post_ID");
|
$post_title = $wpdb->get_var("SELECT post_title FROM $wpdb->posts WHERE ID = $comment->comment_post_ID");
|
||||||
$post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title;
|
$post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title;
|
||||||
?> <a href="post.php?action=edit&post=<?php echo $comment->comment_post_ID; ?>"><?php printf(__('Edit Post “%s”'), stripslashes($post_title)); ?></a>
|
?> <a href="post.php?action=edit&post=<?php echo $comment->comment_post_ID; ?>"><?php printf(__('Edit Post “%s”'), stripslashes($post_title)); ?></a>
|
||||||
|
@ -138,15 +138,15 @@ if ('view' == $mode) {
|
||||||
$class = ('alternate' == $class) ? '' : 'alternate';
|
$class = ('alternate' == $class) ? '' : 'alternate';
|
||||||
?>
|
?>
|
||||||
<tr class='<?php echo $class; ?>'>
|
<tr class='<?php echo $class; ?>'>
|
||||||
<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>
|
<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>
|
||||||
<td><?php comment_author_link() ?></td>
|
<td><?php comment_author_link() ?></td>
|
||||||
<td><?php comment_author_email_link() ?></td>
|
<td><?php comment_author_email_link() ?></td>
|
||||||
<td><a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></td>
|
<td><a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></td>
|
||||||
<td><?php comment_excerpt(); ?></td>
|
<td><?php comment_excerpt(); ?></td>
|
||||||
<td><a href="<?php echo get_permalink($comment->comment_post_ID); ?>#comment-<?php comment_ID() ?>" class="edit"><?php _e('View') ?></a></td>
|
<td><a href="<?php echo get_permalink($comment->comment_post_ID); ?>#comment-<?php comment_ID() ?>" class="edit"><?php _e('View') ?></a></td>
|
||||||
<td><?php if ( user_can_edit_post_comments($user_ID, $comment->comment_post_ID) ) {
|
<td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
|
||||||
echo "<a href='post.php?action=editcomment&comment=$comment->comment_ID' class='edit'>" . __('Edit') . "</a>"; } ?></td>
|
echo "<a href='post.php?action=editcomment&comment=$comment->comment_ID' class='edit'>" . __('Edit') . "</a>"; } ?></td>
|
||||||
<td><?php if ( user_can_delete_post_comments($user_ID, $comment->comment_post_ID) ) {
|
<td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
|
||||||
echo "<a href=\"post.php?action=deletecomment&p=".$comment->comment_post_ID."&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>
|
echo "<a href=\"post.php?action=deletecomment&p=".$comment->comment_post_ID."&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>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
|
|
@ -58,7 +58,7 @@ edCanvas = document.getElementById('content');
|
||||||
<p class="submit"><input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="<?php _e('Save as Draft') ?>" />
|
<p class="submit"><input name="saveasdraft" type="submit" id="saveasdraft" tabindex="9" value="<?php _e('Save as Draft') ?>" />
|
||||||
<input name="saveasprivate" type="submit" id="saveasprivate" tabindex="10" value="<?php _e('Save as Private') ?>" />
|
<input name="saveasprivate" type="submit" id="saveasprivate" tabindex="10" value="<?php _e('Save as Private') ?>" />
|
||||||
|
|
||||||
<?php if ( user_can_create_post($user_ID) ) : ?>
|
<?php if ( current_user_can('edit_posts') ) : ?>
|
||||||
<input name="publish" type="submit" id="publish" tabindex="6" style="font-weight: bold;" value="<?php _e('Publish') ?>" />
|
<input name="publish" type="submit" id="publish" tabindex="6" style="font-weight: bold;" value="<?php _e('Publish') ?>" />
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue