mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-31 10:44:26 +00:00
Use get_edit_post_link() instead of hardcoding edit links. Props mdawaffe. fixes #7425
git-svn-id: https://develop.svn.wordpress.org/trunk@8484 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -34,6 +34,7 @@ while (have_posts()) : the_post();
|
||||
$class = 'alternate' == $class ? '' : 'alternate';
|
||||
global $current_user;
|
||||
$post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' );
|
||||
$edit_link = get_edit_post_link( $post->ID );
|
||||
$title = get_the_title();
|
||||
if ( empty($title) )
|
||||
$title = __('(no title)');
|
||||
@@ -80,7 +81,7 @@ foreach($posts_columns as $column_name=>$column_display_name) {
|
||||
break;
|
||||
case 'title':
|
||||
?>
|
||||
<td><strong><?php if ( current_user_can( 'edit_post', $post->ID ) ) { ?><a class="row-title" href="post.php?action=edit&post=<?php the_ID(); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $title ?></a><?php } else { echo $title; } ?></strong>
|
||||
<td><strong><?php if ( current_user_can( 'edit_post', $post->ID ) ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $title ?></a><?php } else { echo $title; } ?></strong>
|
||||
<?php if ( !empty($post->post_password) ) { _e(' — <strong>Protected</strong>'); } elseif ('private' == $post->post_status) { _e(' — <strong>Private</strong>'); } ?></td>
|
||||
<?php
|
||||
break;
|
||||
@@ -173,7 +174,7 @@ foreach($posts_columns as $column_name=>$column_display_name) {
|
||||
|
||||
case 'control_edit':
|
||||
?>
|
||||
<td><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='post.php?action=edit&post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td>
|
||||
<td><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='$edit_link' class='edit'>" . __('Edit') . "</a>"; } ?></td>
|
||||
<?php
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user