Definition:
function get_edit_post_link( $id = 0, $context = 'display' ) {}
Retrieve edit posts link for post.
Can be used within the WordPress loop or outside of it. Can be used with pages, posts, attachments, and revisions.
Parameters
- int $id: Optional. Post ID.
- string $context: Optional, defaults to display. How to write the ‘&’, defaults to ‘&’.
Defined filters
- get_edit_post_link
apply_filters( 'get_edit_post_link', admin_url( sprintf($post_type_object->_edit_link . $action, $post->ID)
Source code
function get_edit_post_link( $id = 0, $context = 'display' ) { if ( !$post = &get_post( $id ) ) return; if ( 'display' == $context ) $action = '&action=edit'; else $action = '&action=edit'; $post_type_object = get_post_type_object( $post->post_type ); if ( !$post_type_object ) return; if ( !current_user_can( $post_type_object->cap->edit_post, $post->ID ) ) return; return apply_filters( 'get_edit_post_link', admin_url( sprintf($post_type_object->_edit_link . $action, $post->ID) ), $post->ID, $context ); }
1380
No comments yet... Be the first to leave a reply!