| 692 | * Display or retrieve edit term link with formatting. |
| 693 | * |
| 694 | * @since 3.1 |
| 695 | * |
| 696 | * @param string $link Optional. Anchor text. |
| 697 | * @param string $before Optional. Display before edit link. |
| 698 | * @param string $after Optional. Display after edit link. |
| 699 | * @param object $term Term object |
| 700 | * @return string HTML content. |
| 701 | */ |
| 702 | function edit_term_link( $link = '', $before = '', $after = '', $term = null ) { |
| 703 | |
| 704 | if ( $term == null ) { |
| 705 | global $wp_query; |
| 706 | $term = $wp_query->get_queried_object(); |
| 707 | } |
| 708 | |
| 709 | $tax = get_taxonomy( $term->taxonomy ); |
| 710 | if ( !current_user_can($tax->cap->edit_terms) ) |
| 711 | return; |
| 712 | |
| 713 | if ( empty($link) ) |
| 714 | $link = __('Edit This'); |
| 715 | |
| 716 | $link = '<a href="' . get_edit_tag_link( $term->term_id, $term->taxonomy ) . '" title="' . $link . '">' . $link . '</a>'; |
| 717 | echo $before . apply_filters( 'edit_term_link', $link, $term->term_id ) . $after; |
| 718 | } |
| 719 | |
| 720 | /** |