Changeset 15800
- Timestamp:
- 10/14/2010 07:35:13 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/default-list-tables.php
r15759 r15800 1655 1655 $name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag ); 1656 1656 $qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' ); 1657 $edit_link = "edit-tags.php?action=edit&taxonomy=$taxonomy&post_type=$post_type&tag_ID=$tag->term_id";1657 $edit_link = get_edit_term_url( $tag->term_id, $taxonomy, $post_type ); 1658 1658 1659 1659 $out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $name ) ) . '">' . $name . '</a></strong><br />'; -
trunk/wp-includes/link-template.php
r15792 r15800 650 650 * 651 651 * @param int $tag_id Tag ID 652 * @return string 653 */ 654 function get_edit_tag_link( $tag_id = 0, $taxonomy = 'post_tag' ) { 652 * @param string $taxonomy Taxonomy 653 * @return string 654 */ 655 function get_edit_tag_link( $tag_id, $taxonomy = 'post_tag' ) { 655 656 return apply_filters( 'get_edit_tag_link', get_edit_term_url( $tag_id, $taxonomy ) ); 656 657 } … … 678 679 * 679 680 * @param int $term_id Term ID 680 * @param int $taxonomy Taxonomy 681 * @return string 682 */ 683 function get_edit_term_url( $term_id = 0, $taxonomy = 'post_tag' ) { 684 $tax = get_taxonomy($taxonomy); 685 if ( !current_user_can($tax->cap->edit_terms) ) 686 return; 687 688 $term = get_term($term_id, $taxonomy); 689 690 $location = admin_url('edit-tags.php?action=edit&taxonomy=' . $taxonomy .'&tag_ID=' . $term->term_id); 691 692 return apply_filters( 'get_edit_term_url', $location ); 681 * @param string $taxonomy Taxonomy 682 * @param string $object_type The object type 683 * @return string 684 */ 685 function get_edit_term_url( $term_id, $taxonomy, $object_type = '' ) { 686 $tax = get_taxonomy( $taxonomy ); 687 if ( !current_user_can( $tax->cap->edit_terms ) ) 688 return; 689 690 $term = get_term( $term_id, $taxonomy ); 691 692 $args = array( 693 'action' => 'edit', 694 'taxonomy' => $taxonomy, 695 'tag_ID' => $term->term_id, 696 ); 697 698 if ( $object_type ) 699 $args['post_type'] = $object_type; 700 701 $location = add_query_arg( $args, admin_url( 'edit-tags.php' ) ); 702 703 return apply_filters( 'get_edit_term_url', $location, $term_id, $taxonomy, $object_type ); 693 704 } 694 705 … … 705 716 */ 706 717 function edit_term_link( $link = '', $before = '', $after = '', $term = null, $echo = true ) { 707 708 if ( $term == null ) { 718 if ( is_null( $term ) ) { 709 719 global $wp_query; 710 720 $term = $wp_query->get_queried_object(); 711 721 } 712 722 713 723 $tax = get_taxonomy( $term->taxonomy ); 714 724 if ( !current_user_can($tax->cap->edit_terms) ) 715 725 return; 716 726 717 if ( empty( $link) )727 if ( empty( $link ) ) 718 728 $link = __('Edit This'); 719 729 720 730 $link = '<a href="' . get_edit_term_url( $term->term_id, $term->taxonomy ) . '" title="' . $link . '">' . $link . '</a>'; 721 731 $link = $before . apply_filters( 'edit_term_link', $link, $term->term_id ) . $after; 722 732 723 733 if ( $echo ) 724 734 echo $link;
Note: See TracChangeset
for help on using the changeset viewer.