Make WordPress Core


Ignore:
Timestamp:
08/27/2008 10:04:12 PM (17 years ago)
Author:
ryan
Message:

Add edit and delete links to the Content->Links rows. Add get_edit_bookmark_link(). Add caching for individual bookmarks. see #7552

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r8706 r8758  
    548548}
    549549
     550function get_edit_bookmark_link( $link = 0 ) {
     551    $link = &get_bookmark( $link );
     552
     553    if ( !current_user_can('manage_links') )
     554        return;
     555
     556    $location = admin_url('link.php?action=edit&link_id=') . $link->link_id;
     557    return apply_filters( 'get_edit_bookmark_link', $location, $link->link_id );
     558}
     559
     560function edit_bookmark_link( $link = '', $before = '', $after = '', $bookmark = null ) {
     561    $bookmark = get_bookmark($bookmark);
     562
     563    if ( !current_user_can('manage_links') )
     564        return;
     565
     566    if ( empty($link) )
     567        $link = __('Edit This');
     568
     569    $link = '<a href="' . get_edit_bookmark_link( $link ) . '" title="' . __( 'Edit link' ) . '">' . $link . '</a>';
     570    echo $before . apply_filters( 'edit_bookmark_link', $link, $bookmark->link_id ) . $after;
     571}
     572
    550573// Navigation links
    551574
Note: See TracChangeset for help on using the changeset viewer.