Changeset 10931
- Timestamp:
- 04/14/2009 06:31:49 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/classic/comments.php
r10767 r10931 43 43 44 44 <?php if ( get_option('comment_registration') && !$user_ID ) : ?> 45 <p><?php printf(__('You must be <a href="%s">logged in</a> to post a comment.'), get_option('siteurl')."/wp-login.php?redirect_to=".urlencode(get_permalink()));?></p>45 <p><?php printf(__('You must be <a href="%s">logged in</a> to post a comment.'), wp_login_url( get_permalink() ) );?></p> 46 46 <?php else : ?> 47 47 -
trunk/wp-content/themes/default/comments.php
r10177 r10931 58 58 59 59 <?php if ( get_option('comment_registration') && !$user_ID ) : ?> 60 <p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>60 <p>You must be <a href="<?php echo wp_login_url( get_permalink() ); ?>">logged in</a> to post a comment.</p> 61 61 <?php else : ?> 62 62 -
trunk/wp-includes/comment-template.php
r10875 r10931 985 985 986 986 if ( get_option('comment_registration') && !$user_ID ) 987 $link = '<a rel="nofollow" href="' . site_url('wp-login.php?redirect_to=' . get_permalink()) . '">' . $login_text . '</a>';987 $link = '<a rel="nofollow" href="' . wp_login_url( get_permalink() ) . '">' . $login_text . '</a>'; 988 988 else 989 989 $link = "<a rel='nofollow' class='comment-reply-link' href='" . wp_specialchars( add_query_arg( 'replytocom', $comment->comment_ID ) ) . "#" . $respond_id . "' onclick='return addComment.moveForm(\"$add_below-$comment->comment_ID\", \"$comment->comment_ID\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>"; … … 1036 1036 1037 1037 if ( get_option('comment_registration') && !$user_ID ) { 1038 $link = '<a rel="nofollow" href="' . site_url('wp-login.php?redirect_to=' . get_permalink()) . '">' . $login_text . '</a>';1038 $link = '<a rel="nofollow" href="' . wp_login_url( get_permalink() ) . '">' . $login_text . '</a>'; 1039 1039 } else { 1040 1040 $link = "<a rel='nofollow' class='comment-reply-link' href='" . get_permalink($post->ID) . "#$respond_id' onclick='return addComment.moveForm(\"$add_below-$post->ID\", \"0\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>"; -
trunk/wp-includes/functions.php
r10897 r10931 2318 2318 $html .= "</p><p><a href='" . remove_query_arg( 'updated', clean_url( wp_get_referer() ) ) . "'>" . __( 'Please try again.' ) . "</a>"; 2319 2319 elseif ( 'log-out' == $action ) 2320 $html .= "</p><p>" . sprintf( __( "Do you really want to <a href='%s'>log out</a>?"), wp_ nonce_url( site_url('wp-login.php?action=logout', 'login'), 'log-out') );2320 $html .= "</p><p>" . sprintf( __( "Do you really want to <a href='%s'>log out</a>?"), wp_logout_url() ); 2321 2321 2322 2322 wp_die( $html, $title); -
trunk/wp-includes/general-template.php
r10810 r10931 155 155 * @uses wp_nonce_url() To protect against CSRF 156 156 * @uses site_url() To generate the log in URL 157 * @uses apply_filters() calls 'logout_url' hook on final logout url 157 158 * 158 159 * @param string $redirect Path to redirect to on logout. 159 160 */ 160 161 function wp_logout_url($redirect = '') { 161 if ( strlen($redirect) ) 162 $redirect = "&redirect_to=$redirect"; 163 164 return wp_nonce_url( site_url("wp-login.php?action=logout$redirect", 'login'), 'log-out' ); 162 $args = array( 'action' => 'logout' ); 163 if ( !empty($redirect) ) { 164 $args['redirect_to'] = $redirect; 165 } 166 167 $logout_url = add_query_arg($args, site_url('wp-login.php', 'login')); 168 $logout_url = wp_nonce_url( $logout_url, 'log-out' ); 169 170 return apply_filters('logout_url', $logout_url, $redirect); 165 171 } 166 172 … … 172 178 * @since 2.7 173 179 * @uses site_url() To generate the log in URL 180 * @uses apply_filters() calls 'login_url' hook on final login url 174 181 * 175 182 * @param string $redirect Path to redirect to on login. 176 183 */ 177 184 function wp_login_url($redirect = '') { 178 if ( strlen($redirect) ) 179 $redirect = "?redirect_to=$redirect"; 180 181 return site_url("wp-login.php$redirect", 'login'); 185 $login_url = site_url('wp-login.php', 'login'); 186 187 if ( !empty($redirect) ) { 188 $login_url = add_query_arg('redirect_to', $redirect, $login_url); 189 } 190 191 return apply_filters('login_url', $login_url, $redirect); 182 192 } 183 193 -
trunk/wp-includes/pluggable.php
r10838 r10931 751 751 $redirect = ( strpos($_SERVER['REQUEST_URI'], '/options.php') && wp_get_referer() ) ? wp_get_referer() : $proto . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 752 752 753 $login_url = site_url( 'wp-login.php?redirect_to=' . urlencode( $redirect ), 'login');753 $login_url = wp_login_url($redirect); 754 754 755 755 wp_redirect($login_url); … … 1103 1103 $message = sprintf(__('Username: %s'), $user_login) . "\r\n"; 1104 1104 $message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n"; 1105 $message .= site_url("wp-login.php", 'login') . "\r\n";1105 $message .= wp_login_url() . "\r\n"; 1106 1106 1107 1107 wp_mail($user_email, sprintf(__('[%s] Your username and password'), get_option('blogname')), $message);
Note: See TracChangeset
for help on using the changeset viewer.