On this page
edit_bookmark_link( string $link = '', string $before = '', string $after = '', int $bookmark = null )
Displays the edit bookmark link anchor content.
Parameters
$linkstring Optional-
Anchor text. If empty, default is 'Edit This'.
Default:
'' $beforestring Optional-
Display before edit link.
Default:
'' $afterstring Optional-
Display after edit link.
Default:
'' $bookmarkint Optional-
Bookmark ID. Default is the current bookmark.
Default:
null
Source
File: wp-includes/link-template.php. View all references
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;
}
Hooks
- apply_filters( 'edit_bookmark_link',
string $link ,int $link_id ) -
Filters the bookmark edit link anchor tag.
Related
Uses
| Uses | Description |
|---|---|
| get_edit_bookmark_link() wp-includes/link-template.php | Displays the edit bookmark link. |
| get_bookmark() wp-includes/bookmark.php | Retrieves bookmark data. |
| current_user_can() wp-includes/capabilities.php | Returns whether the current user has the specified capability. |
| __() wp-includes/l10n.php | Retrieves the translation of $text. |
| esc_url() wp-includes/formatting.php | Checks and cleans a URL. |
| apply_filters() wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
Changelog
| Version | Description |
|---|---|
| 2.7.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/edit_bookmark_link