Make WordPress Core

Ticket #43633: 43633.2.diff

File 43633.2.diff, 926 bytes (added by danieltj, 7 years ago)

Refreshed the patch

  • wp-includes/admin-bar.php

    diff --git wp-includes/admin-bar.php wp-includes/admin-bar.php
    index 1be7034..6f4ba50 100644
    function wp_admin_bar_my_account_menu( $wp_admin_bar ) { 
    261261        if ( $current_user->display_name !== $current_user->user_login )
    262262                $user_info .= "<span class='username'>{$current_user->user_login}</span>";
    263263
     264        /**
     265         * Filter the user archive link.
     266         *
     267         * @since 5.0
     268         *
     269         * @param string The link to the user archive page.
     270         * @param int    The user id of the current user.
     271         */
     272        $user_archive_link = apply_filters( 'pre_profile_archive_link', get_author_posts_url( $current_user->ID ), $current_user->ID );
     273
    264274        $wp_admin_bar->add_menu( array(
    265275                'parent' => 'user-actions',
    266276                'id'     => 'user-info',
    267277                'title'  => $user_info,
    268                 'href'   => $profile_url,
     278                'href'   => $user_archive_link,
    269279                'meta'   => array(
    270280                        'tabindex' => -1,
    271281                ),