Code Duplication    Length = 21-24 lines in 2 locations

wp-includes/link-template.php 2 locations

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