Ticket #14787: 14787.diff

File 14787.diff, 5.3 KB (added by scribu, 3 years ago)
  • wp-login.php

     
    547547                } 
    548548                // If the user can't edit posts, send them to their profile. 
    549549                if ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() ) ) 
    550                         $redirect_to = admin_url('profile.php'); 
     550                        $redirect_to = get_user_edit_link(); 
    551551                wp_safe_redirect($redirect_to); 
    552552                exit(); 
    553553        } 
  • wp-includes/comment-template.php

     
    15311531                'fields'               => apply_filters( 'comment_form_default_fields', $fields ), 
    15321532                'comment_field'        => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>', 
    15331533                'must_log_in'          => '<p class="must-log-in">' .  sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>', 
    1534                 'logged_in_as'         => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>', 
     1534                'logged_in_as'         => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ), get_user_edit_link(), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>', 
    15351535                'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email address will not be published.' ) . ( $req ? $required_text : '' ) . '</p>', 
    15361536                'comment_notes_after'  => '<p class="form-allowed-tags">' . sprintf( __( 'You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: %s' ), ' <code>' . allowed_tags() . '</code>' ) . '</p>', 
    15371537                'id_form'              => 'commentform', 
  • wp-includes/link-template.php

     
    958958        echo $before . apply_filters( 'edit_bookmark_link', $link, $bookmark->link_id ) . $after; 
    959959} 
    960960 
     961/** 
     962 * Retrieve edit user link 
     963 * 
     964 * @since 3.1.0 
     965 * 
     966 * @param int $user_id Optional. User ID. 
     967 * @return string 
     968 */ 
     969function get_edit_user_link( $user_id = 0 ) { 
     970        if ( !$user_id || get_current_user_id() == $user_id ) 
     971                $link = 'profile.php'; 
     972        else 
     973                $link = 'user-edit.php?user_id=' . $user_id; 
     974 
     975        return apply_filters( 'get_edit_user_link', self_admin_url( $link ), $user_id ); 
     976} 
     977 
    961978// Navigation links 
    962979 
    963980/** 
  • wp-includes/theme-compat/comments.php

     
    7070 
    7171<?php if ( is_user_logged_in() ) : ?> 
    7272 
    73 <p><?php printf(__('Logged in as <a href="%1$s">%2$s</a>.'), get_option('siteurl') . '/wp-admin/profile.php', $user_identity); ?> <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php _e('Log out of this account'); ?>"><?php _e('Log out &raquo;'); ?></a></p> 
     73<p><?php printf(__('Logged in as <a href="%1$s">%2$s</a>.'), get_user_edit_link(), $user_identity); ?> <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php _e('Log out of this account'); ?>"><?php _e('Log out &raquo;'); ?></a></p> 
    7474 
    7575<?php else : ?> 
    7676 
  • wp-includes/theme-compat/comments-popup.php

     
    6868 
    6969<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> 
    7070<?php if ( $user_ID ) : ?> 
    71         <p><?php printf(__('Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out &raquo;</a>'), get_option('siteurl') . '/wp-admin/profile.php', $user_identity, wp_logout_url(get_permalink())); ?></p> 
     71        <p><?php printf(__('Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out &raquo;</a>'), get_user_edit_link(), $user_identity, wp_logout_url(get_permalink())); ?></p> 
    7272<?php else : ?> 
    7373        <p> 
    7474          <input type="text" name="author" id="author" class="textarea" value="<?php echo esc_attr($comment_author); ?>" size="28" tabindex="1" /> 
  • wp-admin/user-edit.php

     
    143143} 
    144144 
    145145if ( !is_wp_error( $errors ) ) { 
    146         $redirect = (IS_PROFILE_PAGE ? "profile.php?" : "user-edit.php?user_id=$user_id&"). "updated=true"; 
     146        $redirect = add_query_arg('updated', true, get_edit_user_link($user_id) ); 
    147147        $redirect = add_query_arg('wp_http_referer', urlencode($wp_http_referer), $redirect); 
    148148        wp_redirect($redirect); 
    149149        exit;