edit_bookmark_link( string $link = '', string $before = '', string $after = '', int $bookmark = null )
Displays the edit bookmark link anchor content.
Description Description
Parameters Parameters
- $link
-
(string) (Optional) Anchor text. If empty, default is 'Edit This'.
Default value: ''
- $before
-
(string) (Optional) Display before edit link.
Default value: ''
- $after
-
(string) (Optional) Display after edit link.
Default value: ''
- $bookmark
-
(int) (Optional) Bookmark ID. Default is the current bookmark.
Default value: null
Source Source
File: wp-includes/link-template.php
function edit_bookmark_link( $link = '', $before = '', $after = '', $bookmark = null ) {
$bookmark = get_bookmark( $bookmark );
if ( ! current_user_can( 'manage_links' ) ) {
return;
}
if ( empty( $link ) ) {
$link = __( 'Edit This' );
}
$link = '<a href="' . esc_url( get_edit_bookmark_link( $bookmark ) ) . '">' . $link . '</a>';
/**
* Filters the bookmark edit link anchor tag.
*
* @since 2.7.0
*
* @param string $link Anchor tag for the edit link.
* @param int $link_id Bookmark ID.
*/
echo $before . apply_filters( 'edit_bookmark_link', $link, $bookmark->link_id ) . $after;
}
Expand full source code Collapse full source code View on Trac
Changelog Changelog
| Version | Description |
|---|---|
| 2.7.0 | Introduced. |
User Contributed Notes User Contributed Notes
You must log in before being able to contribute a note or feedback.
Default Usage
Displays edit bookmark link using defaults.
Displays Edit Bookmark in Paragraph Tag
Displays edit bookmark link, with link text “edit bookmark”, in a paragraph () tag.
<?php edit_bookmark_link('edit bookmark', '<p>', '</p>'); ?>