Returns edit post url as string value, provided the current user has the ‘edit_post’ capability. To retrieve a URL without checking user capabilities use admin_url() instead.
Can be used within the WordPress loop or outside of it. Can be used with pages, posts, attachments, and revisions.
<?php echo get_edit_post_link( $id, $context ); ?>
- (integer) (optional) The post ID
- Default: None
- (string) (optional) How to write ampersands. Defaults to ‘display’ which will encode as ‘&’. Passing any other string (including an empty string), will encode ampersands as ‘&’.
- Default: ‘display’
- admin_url() (string)
- admin_url() to edit the post or post_type.
- Since: 2.3.0
get_edit_post_link() is located in
Edit Link: edit_post_link(), edit_comment_link(), edit_tag_link(), edit_bookmark_link()