Changeset 41159
- Timestamp:
- 07/26/2017 04:44:34 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/admin-bar.php
r40657 r41159 599 599 */ 600 600 function wp_admin_bar_edit_menu( $wp_admin_bar ) { 601 global $tag, $wp_the_query ;601 global $tag, $wp_the_query, $user_id; 602 602 603 603 if ( is_admin() ) { … … 649 649 'href' => get_term_link( $tag ) 650 650 ) ); 651 } elseif ( 'user-edit' == $current_screen->base 652 && isset( $user_id ) 653 && ( $user_object = get_userdata( $user_id ) ) 654 && $user_object->exists() 655 && $view_link = get_author_posts_url( $user_object->ID ) ) 656 { 657 $wp_admin_bar->add_menu( array( 658 'id' => 'view', 659 'title' => __( 'View User' ), 660 'href' => $view_link, 661 ) ); 651 662 } 652 663 } else { … … 676 687 'title' => $tax->labels->edit_item, 677 688 'href' => $edit_term_link 689 ) ); 690 } elseif ( is_a( $current_object, 'WP_User' ) 691 && current_user_can( 'edit_user', $current_object->ID ) 692 && $edit_user_link = get_edit_user_link( $current_object->ID ) ) 693 { 694 $wp_admin_bar->add_menu( array( 695 'id' => 'edit', 696 'title' => __( 'Edit User' ), 697 'href' => $edit_user_link, 678 698 ) ); 679 699 }
Note: See TracChangeset
for help on using the changeset viewer.