@@ 1423-1446 (lines=24) @@ | ||
1420 | * @param string $before Optional. Display before edit link. Default empty. |
|
1421 | * @param string $after Optional. Display after edit link. Default empty. |
|
1422 | */ |
|
1423 | function edit_comment_link( $text = null, $before = '', $after = '' ) { |
|
1424 | $comment = get_comment(); |
|
1425 | ||
1426 | if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) { |
|
1427 | return; |
|
1428 | } |
|
1429 | ||
1430 | if ( null === $text ) { |
|
1431 | $text = __( 'Edit This' ); |
|
1432 | } |
|
1433 | ||
1434 | $link = '<a class="comment-edit-link" href="' . esc_url( get_edit_comment_link( $comment ) ) . '">' . $text . '</a>'; |
|
1435 | ||
1436 | /** |
|
1437 | * Filters the comment edit link anchor tag. |
|
1438 | * |
|
1439 | * @since 2.3.0 |
|
1440 | * |
|
1441 | * @param string $link Anchor tag for the edit link. |
|
1442 | * @param int $comment_id Comment ID. |
|
1443 | * @param string $text Anchor text. |
|
1444 | */ |
|
1445 | echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID, $text ) . $after; |
|
1446 | } |
|
1447 | ||
1448 | /** |
|
1449 | * Displays the edit bookmark link. |
|
@@ 1485-1505 (lines=21) @@ | ||
1482 | * @param string $after Optional. Display after edit link. Default empty. |
|
1483 | * @param int $bookmark Optional. Bookmark ID. Default is the current bookmark. |
|
1484 | */ |
|
1485 | function edit_bookmark_link( $link = '', $before = '', $after = '', $bookmark = null ) { |
|
1486 | $bookmark = get_bookmark($bookmark); |
|
1487 | ||
1488 | if ( !current_user_can('manage_links') ) |
|
1489 | return; |
|
1490 | ||
1491 | if ( empty($link) ) |
|
1492 | $link = __('Edit This'); |
|
1493 | ||
1494 | $link = '<a href="' . esc_url( get_edit_bookmark_link( $bookmark ) ) . '">' . $link . '</a>'; |
|
1495 | ||
1496 | /** |
|
1497 | * Filters the bookmark edit link anchor tag. |
|
1498 | * |
|
1499 | * @since 2.7.0 |
|
1500 | * |
|
1501 | * @param string $link Anchor tag for the edit link. |
|
1502 | * @param int $link_id Bookmark ID. |
|
1503 | */ |
|
1504 | echo $before . apply_filters( 'edit_bookmark_link', $link, $bookmark->link_id ) . $after; |
|
1505 | } |
|
1506 | ||
1507 | /** |
|
1508 | * Retrieves the edit user link. |