Ticket #20307: 20307.patch
File 20307.patch, 1.5 KB (added by , 13 years ago) |
---|
-
wp-includes/admin-bar.php
470 470 'title' => $tax->labels->edit_item, 471 471 'href' => get_edit_term_link( $current_object->term_id, $current_object->taxonomy ) 472 472 ) ); 473 } elseif ( is_a( $current_object, 'WP_User' ) 474 && current_user_can( 'edit_user', $current_object->ID ) ) 475 { 476 if ( get_current_user_id() == $current_object->ID ) 477 $title = __( 'Edit My Profile' ); 478 else 479 $title = __( 'Edit User' ); 480 $wp_admin_bar->add_menu( array( 481 'id' => 'edit', 482 'title' => $title, 483 'href' => get_edit_user_link( $current_object->ID ) 484 ) ); 473 485 } 474 486 } 475 487 } -
wp-includes/link-template.php
737 737 } 738 738 739 739 /** 740 * Retrieve edit user url. 741 * 742 * @since 3.4 743 * 744 * @param int $user_id User ID 745 * @return string 746 */ 747 function get_edit_user_link( $user_id ) { 748 if ( !current_user_can( 'edit_user', $user_id ) ) 749 return; 750 751 $user = new WP_User( $user_id ); 752 753 if ( get_current_user_id() == $user->ID ) 754 $location = admin_url( 'profile.php' ); 755 else 756 $location = esc_url( add_query_arg( 'user_id', $user->ID, admin_url( 'user-edit.php' ) ) ); 757 758 return apply_filters( 'get_edit_user_link', $location, $user_id ); 759 } 760 761 /** 740 762 * Retrieve permalink for search. 741 763 * 742 764 * @since 3.0.0