Posted By

chendrix on 10/29/10


Tagged

edit wordpress wp


Versions (?)

Wordpress Dynamic Edit Link


 / Published in: PHP
 

Wordpress creates an anchor with a class .post-edit-link for styling

  1. <?php if(current_user_can('edit_posts', $post_id) || current_user_can('edit_others_posts')) :
  2. edit_post_link('Edit', '', ''); endif; ?>

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: awesomewordpressthemes on November 16, 2010

The editpostlink will not display unless logged in and allowed to edit posts. There is no reason to add an if statement. editpostlink(__('edit'), '',''); is actually sufficient.

Posted By: awesomewordpressthemes on November 16, 2010

it ate my code,

editpostlink(__('edit'), '','');

You need to login to post a comment.