Codex

Template Tags/edit post link

Contents

Description

Displays a link to edit the current post, if a user is logged in and allowed to edit the post. It must be within The Loop.

Usage

 <?php edit_post_link('link''before''after'); ?> 

Examples

Default Usage

Displays edit post link using defaults.

<?php edit_post_link(); ?>

Display Edit in Paragraph Tag

Displays edit post link, with link text "edit", in a paragraph (<p>) tag.

<?php edit_post_link('edit', '<p>', '</p>'); ?>

Parameters

link 
(string) The link text. Defaults to 'Edit This'.
before 
(string) Text to put before the link text. There is no default.
after 
(string) Text to put after the link text. There is no default.

Related

edit_post_link, edit_comment_link, link_pages, wp_link_pages, get_year_link, get_month_link, get_day_link

How to pass parameters to tags with PHP function-style parameters

Go to Template Tag index