get_edit_post_link

SummerySummery

Retrieves the edit post link for post.

Syntax

get_edit_post_link( int|WP_Post $id, string $context = 'display' )

DescriptionDescription

Can be used within the WordPress loop or outside of it. Can be used with pages, posts, attachments, and revisions.

ParametersParameters

$id

(int|WP_Post) (Optional) Post ID or post object. Default is the global $post.

$context

(string) (Optional) How to output the '&' character. Default '&'.

Default value: 'display'

ReturnReturn

(string|null) The edit post link for the given post. null if the post type is invalid or does not allow an editing UI.

SourceSource

File: wp-includes/link-template.php


			

ChangelogChangelog

Changelog
Version Description
2.3.0 Introduced.
Scroll to Top