Changeset 9340 for trunk/wp-includes/link-template.php
- Timestamp:
- 10/25/2008 06:19:42 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/link-template.php
r9318 r9340 557 557 558 558 return $link; 559 } 560 561 /** 562 * Retrieve edit tag link. 563 * 564 * @since 2.7.0 565 * 566 * @param int $tag_id Tag ID 567 * @return string 568 */ 569 function get_edit_tag_link( $tag_id = 0 ) { 570 $tag = get_term($tag_id, 'post_tag'); 571 572 if ( !current_user_can('manage_categories') ) 573 return; 574 575 $location = admin_url('edit-tags.php?action=edit&tag_ID=') . $tag->term_id; 576 return apply_filters( 'get_edit_tag_link', $location ); 577 } 578 579 /** 580 * Display or retrieve edit tag link with formatting. 581 * 582 * @since 2.7.0 583 * 584 * @param string $link Optional. Anchor text. 585 * @param string $before Optional. Display before edit link. 586 * @param string $after Optional. Display after edit link. 587 * @param int|object $tag Tag object or ID 588 * @return string|null HTML content, if $echo is set to false. 589 */ 590 function edit_tag_link( $link = '', $before = '', $after = '', $tag = null ) { 591 $tag = get_term($tag, 'post_tag'); 592 593 if ( !current_user_can('manage_categories') ) 594 return; 595 596 if ( empty($link) ) 597 $link = __('Edit This'); 598 599 $link = '<a href="' . get_edit_tag_link( $tag->term_id ) . '" title="' . __( 'Edit tag' ) . '">' . $link . '</a>'; 600 echo $before . apply_filters( 'edit_tag_link', $link, $tag->term_id ) . $after; 559 601 } 560 602 … … 717 759 * @param string $before Optional. Display before edit link. 718 760 * @param string $after Optional. Display after edit link. 719 * @param bool $echo Optional, defaults to true. Whether to echo or return HTML.720 761 * @return string|null HTML content, if $echo is set to false. 721 762 */ 722 function edit_comment_link( $link = 'Edit This', $before = '', $after = '' , $echo = true) {763 function edit_comment_link( $link = 'Edit This', $before = '', $after = '' ) { 723 764 global $comment, $post; 724 765 … … 733 774 734 775 $link = '<a href="' . get_edit_comment_link( $comment->comment_ID ) . '" title="' . __( 'Edit comment' ) . '">' . $link . '</a>'; 735 $link = $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID ) . $after; 736 if ( $echo ) 737 echo $link; 738 else 739 return $link; 776 echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID ) . $after; 740 777 } 741 778
Note: See TracChangeset
for help on using the changeset viewer.