Definition:
function edit_post_link( $link = null, $before = '', $after = '', $id = 0 ) {}
Display edit post link for post.
Parameters
- string $link: Optional. Anchor text.
- string $before: Optional. Display before edit link.
- string $after: Optional. Display after edit link.
- int $id: Optional. Post ID.
Defined filters
- edit_post_link
apply_filters( 'edit_post_link', $link, $post->ID )
Source code
function edit_post_link( $link = null, $before = '', $after = '', $id = 0 ) {
if ( !$post = &get_post( $id ) )
return;
if ( !$url = get_edit_post_link( $post->ID ) )
return;
if ( null === $link )
$link = __('Edit This');
$post_type_obj = get_post_type_object( $post->post_type );
$link = '<a class="post-edit-link" href="' . $url . '" title="' . esc_attr( $post_type_obj->labels->edit_item ) . '">' . $link . '</a>';
echo $before . apply_filters( 'edit_post_link', $link, $post->ID ) . $after;
}
1004

February 11, 2011 


No comments yet... Be the first to leave a reply!