WordPress.org

Make WordPress Core

Changeset 27260


Ignore:
Timestamp:
02/25/2014 05:07:22 PM (7 years ago)
Author:
nacin
Message:

Make the user arguments for get_edit_profile_url() and get_dashboard_url() optional, defaulting to the current user.

props garyc40.
fixes #16686.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/about.php

    r26848 r27260  
    9494                do_action( 'admin_color_scheme_picker' );
    9595                ?>
    96             <p><?php printf( __( 'To change your color scheme later, just <a href="%1$s">visit your profile</a>.' ), get_edit_profile_url( get_current_user_id() ) ); ?></p>
     96            <p><?php printf( __( 'To change your color scheme later, just <a href="%1$s">visit your profile</a>.' ), get_edit_profile_url() ); ?></p>
    9797        </div>
    9898    </div>
  • trunk/src/wp-admin/includes/user.php

    r26868 r27260  
    421421    _e('You&rsquo;re using the auto-generated password for your account. Would you like to change it to something easier to remember?');
    422422    echo '</p><p>';
    423     printf( '<a href="%s">' . __('Yes, take me to my profile page') . '</a> | ', get_edit_profile_url( get_current_user_id() ) . '#password' );
     423    printf( '<a href="%s">' . __('Yes, take me to my profile page') . '</a> | ', get_edit_profile_url() . '#password' );
    424424    printf( '<a href="%s" id="default-password-nag-no">' . __('No thanks, do not remind me again') . '</a>', '?default_password_nag=0' );
    425425    echo '</p></div>';
  • trunk/src/wp-includes/link-template.php

    r27235 r27260  
    23442344 * @since 3.1.0
    23452345 *
    2346  * @param int $user_id User ID
     2346 * @param int $user_id Optional. User ID. Defaults to current user.
    23472347 * @param string $path Optional path relative to the dashboard. Use only paths known to both blog and user admins.
    23482348 * @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.
    23492349 * @return string Dashboard url link with optional path appended.
    23502350 */
    2351 function get_dashboard_url( $user_id, $path = '', $scheme = 'admin' ) {
    2352     $user_id = (int) $user_id;
     2351function get_dashboard_url( $user_id = 0, $path = '', $scheme = 'admin' ) {
     2352    $user_id = $user_id ? (int) $user_id : get_current_user_id();
    23532353
    23542354    $blogs = get_blogs_of_user( $user_id );
     
    23782378 * @since 3.1.0
    23792379 *
    2380  * @param int $user User ID
    2381  * @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.
     2380 * @param int    $user_id Optional. User ID. Defaults to current user.
     2381 * @param string $scheme  The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl().
     2382 *                        'http' or 'https' can be passed to force those schemes.
    23822383 * @return string Dashboard url link with optional path appended.
    23832384 */
    2384 function get_edit_profile_url( $user, $scheme = 'admin' ) {
    2385     $user = (int) $user;
     2385function get_edit_profile_url( $user_id = 0, $scheme = 'admin' ) {
     2386    $user_id = $user_id ? (int) $user : get_current_user_id();
    23862387
    23872388    if ( is_user_admin() )
     
    23902391        $url = network_admin_url( 'profile.php', $scheme );
    23912392    else
    2392         $url = get_dashboard_url( $user, 'profile.php', $scheme );
    2393 
    2394     return apply_filters( 'edit_profile_url', $url, $user, $scheme);
     2393        $url = get_dashboard_url( $user_id, 'profile.php', $scheme );
     2394
     2395    return apply_filters( 'edit_profile_url', $url, $user_id, $scheme);
    23952396}
    23962397
Note: See TracChangeset for help on using the changeset viewer.