edit_bookmark_link

Displays the edit bookmark link anchor content.

Description

edit_bookmark_link( (string) $link = '', (string) $before = '', (string) $after = '', (null) $bookmark = null ); 

Parameters (4)

0. $link — Optional. (string) => ''
Anchor text. Default empty.
1. $before — Optional. (string) => ''
Display before edit link. Default empty.
2. $after — Optional. (string) => ''
Display after edit link. Default empty.
3. $bookmark — Optional. (null) => null
Bookmark ID. Default is the current bookmark.

Usage

  1. if ( !function_exists( 'edit_bookmark_link' ) ) { 
  2. require_once ABSPATH . WPINC . '/link-template.php'; 
  3.  
  4. // Optional. Anchor text. Default empty. 
  5. $link = ''; 
  6.  
  7. // Optional. Display before edit link. Default empty. 
  8. $before = ''; 
  9.  
  10. // Optional. Display after edit link. Default empty. 
  11. $after = ''; 
  12.  
  13. // Optional. Bookmark ID. Default is the current bookmark. 
  14. $bookmark = null; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = edit_bookmark_link($link, $before, $after, $bookmark); 
  18.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/link-template.php  
  1. function edit_bookmark_link( $link = '', $before = '', $after = '', $bookmark = null ) { 
  2. $bookmark = get_bookmark($bookmark); 
  3.  
  4. if ( !current_user_can('manage_links') ) 
  5. return; 
  6.  
  7. if ( empty($link) ) 
  8. $link = __('Edit This'); 
  9.  
  10. $link = '<a href="' . esc_url( get_edit_bookmark_link( $bookmark ) ) . '">' . $link . '</a>'; 
  11.  
  12. /** 
  13. * Filters the bookmark edit link anchor tag. 
  14. * @since 2.7.0 
  15. * @param string $link Anchor tag for the edit link. 
  16. * @param int $link_id Bookmark ID. 
  17. */ 
  18. echo $before . apply_filters( 'edit_bookmark_link', $link, $bookmark->link_id ) . $after;