Make WordPress Core


Ignore:
Timestamp:
07/29/2008 05:22:58 AM (16 years ago)
Author:
ryan
Message:

Use get_edit_post_link() instead of hardcoding edit links. Props mdawaffe. fixes #7425

File:
1 edited

Legend:

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

    r7775 r8484  
    3535global $current_user;
    3636$post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' );
     37$edit_link = get_edit_post_link( $post->ID );
    3738$title = get_the_title();
    3839if ( empty($title) )
     
    8182    case 'title':
    8283        ?>
    83         <td><strong><?php if ( current_user_can( 'edit_post', $post->ID ) ) { ?><a class="row-title" href="post.php?action=edit&amp;post=<?php the_ID(); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $title ?></a><?php } else { echo $title; } ?></strong>
     84        <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>
    8485        <?php if ( !empty($post->post_password) ) { _e(' &#8212; <strong>Protected</strong>'); } elseif ('private' == $post->post_status) { _e(' &#8212; <strong>Private</strong>'); } ?></td>
    8586        <?php
     
    174175    case 'control_edit':
    175176        ?>
    176         <td><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='post.php?action=edit&amp;post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td>
     177        <td><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='$edit_link' class='edit'>" . __('Edit') . "</a>"; } ?></td>
    177178        <?php
    178179        break;
Note: See TracChangeset for help on using the changeset viewer.