Title: edit_post_link
Published: April 25, 2014
Last modified: August 20, 2026

---

# apply_filters( ‘edit_post_link’, string $link, int $post_id, string $text )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/edit_post_link/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/edit_post_link/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/edit_post_link/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/edit_post_link/?output_format=md#changelog)

Filters the post edit link anchor tag.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/edit_post_link/?output_format=md#parameters)󠁿

 `$link`string

Anchor tag for the edit link.

`$post_id`int

Post ID.

`$text`string

Anchor text.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/edit_post_link/?output_format=md#source)󠁿

    ```php
    echo $before . apply_filters( 'edit_post_link', $link, $post->ID, $text ) . $after;
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/link-template.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/link-template.php#L1541)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/link-template.php#L1541-L1541)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/edit_post_link/?output_format=md#related)󠁿

| Used by | Description | 
| [edit_post_link()](https://developer.wordpress.org/reference/functions/edit_post_link/)`wp-includes/link-template.php` |

Displays the edit post link for post.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/edit_post_link/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.3.0](https://developer.wordpress.org/reference/since/2.3.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fedit_post_link%2F)
before being able to contribute a note or feedback.