WordPress.org

Make WordPress Core

Ticket #16686: 16686.2.diff

File 16686.2.diff, 2.8 KB (added by garyc40, 10 years ago)

default user for get_dashboard_url() as well

  • wp-admin/admin-header.php

    diff --git wp-admin/admin-header.php wp-admin/admin-header.php
    index ac79340..736bc8e 100644
    if ( is_multisite() && is_super_admin() ) { 
    153153        if ( !is_network_admin() )
    154154                $links[10] = '| <a href="' . network_admin_url() . '" title="' . ( ! empty( $update_title ) ? $update_title : esc_attr__('Network Admin') ) . '">' . __('Network Admin') . ( ! empty( $total_update_count ) ? ' (' . number_format_i18n( $total_update_count ) . ')' : '' ) . '</a>';
    155155        else
    156                 $links[10] = '| <a href="' . get_dashboard_url( get_current_user_id() ) . '" title="' . esc_attr__('Site Admin') . '">' . __('Site Admin') . '</a>';
     156                $links[10] = '| <a href="' . get_dashboard_url() . '" title="' . esc_attr__('Site Admin') . '">' . __('Site Admin') . '</a>';
    157157}
    158158$links[15] = '| <a href="' . wp_logout_url() . '" title="' . esc_attr__('Log Out') . '">' . __('Log Out') . '</a>';
    159159
  • wp-includes/link-template.php

    diff --git wp-includes/link-template.php wp-includes/link-template.php
    index 33f0a7d..a20e2bc 100644
    function self_admin_url($path = '', $scheme = 'admin') { 
    22902290 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes.
    22912291 * @return string Dashboard url link with optional path appended
    22922292 */
    2293 function get_dashboard_url( $user_id, $path = '', $scheme = 'admin' ) {
    2294         $user_id = (int) $user_id;
     2293function get_dashboard_url( $user_id = 0, $path = '', $scheme = 'admin' ) {
     2294        $user_id = ( $user_id ) ? (int) $user_id : get_current_user_id();
    22952295
    22962296        $blogs = get_blogs_of_user( $user_id );
    22972297        if ( empty($blogs) ) {
    function get_dashboard_url( $user_id, $path = '', $scheme = 'admin' ) { 
    23192319 *
    23202320 * @since 3.1.0
    23212321 *
    2322  * @param int $user User ID
     2322 * @param int $user_id User ID
    23232323 * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes.
    23242324 * @return string Dashboard url link with optional path appended
    23252325 */
    2326 function get_edit_profile_url( $user, $scheme = 'admin' ) {
    2327         $user = (int) $user;
     2326function get_edit_profile_url( $user_id = 0, $scheme = 'admin' ) {
     2327        $user_id = ( $user_id ) ? (int) $user_id : get_current_user_id();
    23282328
    23292329        if ( is_user_admin() )
    23302330                $url = user_admin_url( 'profile.php', $scheme );
    23312331        elseif ( is_network_admin() )
    23322332                $url = network_admin_url( 'profile.php', $scheme );
    23332333        else
    2334                 $url = get_dashboard_url( $user, 'profile.php', $scheme );
     2334                $url = get_dashboard_url( $user_id, 'profile.php', $scheme );
    23352335
    2336         return apply_filters( 'edit_profile_url', $url, $user, $scheme);
     2336        return apply_filters( 'edit_profile_url', $url, $user_id, $scheme);
    23372337}
    23382338
    23392339/**