Ticket #10141: registration.patch
File registration.patch, 6.1 KB (added by , 16 years ago) |
---|
-
wp-content/themes/default/sidebar.php
67 67 68 68 <li><h2>Meta</h2> 69 69 <ul> 70 < ?php wp_register(); ?>70 <li><?php wp_registration(); ?></li> 71 71 <li><?php wp_loginout(); ?></li> 72 72 <li><a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a></li> 73 73 <li><a href="http://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a></li> -
wp-includes/default-widgets.php
293 293 echo $before_title . $title . $after_title; 294 294 ?> 295 295 <ul> 296 < ?php wp_register(); ?>296 <li><?php wp_registration(); ?></li> 297 297 <li><?php wp_loginout(); ?></li> 298 298 <li><a href="<?php bloginfo('rss2_url'); ?>" title="<?php echo esc_attr(__('Syndicate this site using RSS 2.0')); ?>"><?php _e('Entries <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li> 299 299 <li><a href="<?php bloginfo('comments_rss2_url'); ?>" title="<?php echo esc_attr(__('The latest comments to all posts in RSS')); ?>"><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li> -
wp-includes/deprecated.php
1690 1690 the_author_meta('ID'); 1691 1691 } 1692 1692 1693 /** 1694 * Display the Registration or Admin link. 1695 * 1696 * Display a link which allows the user to navigate to the registration page if 1697 * not logged in and registration is enabled or to the dashboard if logged in. 1698 * 1699 * @since 1.5.0 1700 * @deprecated 2.8.1 1701 * @deprecated Use wp_registration() 1702 */ 1703 function wp_register( $before = '<li>', $after = '</li>' ) { 1704 _deprecated_function(__FUNCTION__, '2.8.1', 'wp_registration()'); 1705 echo $before; 1706 wp_registration(''); 1707 echo $after; 1708 } 1709 1693 1710 ?> 1711 No newline at end of file -
wp-includes/general-template.php
138 138 * or log out depending on whether or not they are currently logged in. 139 139 * 140 140 * @since 1.5.0 141 * @uses wp_login_url() to retrievethe Log In URL 142 * @uses wp_logout_url() to retrievethe Log Out URL 141 143 * @uses apply_filters() Calls 'loginout' hook on HTML link content. 142 144 * 143 145 * @param string $redirect Optional path to redirect to on login/logout. … … 152 154 } 153 155 154 156 /** 157 * Display the Registration or Admin link. 158 * 159 * Display a link which allows the user to navigate to the registration page if 160 * not logged in and registration is enabled or to the dashboard if logged in. 161 * 162 * @since 2.8.1 163 * @uses wp_registration_url() to retrievethe Registration URL 164 * @uses apply_filters() Calls 'registration' hook on register / admin link content. 165 * 166 * @param string $redirect Optional path to redirect to on registration. 167 */ 168 function wp_registration($redirect = '') { 169 170 if ( ! is_user_logged_in() ) { 171 if ( get_option('users_can_register') ) 172 $link = $before . '<a href="' . esc_url( wp_registration_url($redirect) ) . '">' . __('Register') . '</a>' . $after; 173 else 174 $link = ''; 175 } else { 176 $link = $before . '<a href="' . admin_url() . '">' . __('Site Admin') . '</a>' . $after; 177 } 178 179 echo apply_filters('registration', $link); 180 } 181 182 /** 155 183 * Returns the Log Out URL. 156 184 * 157 185 * Returns the URL that allows the user to log out of the site 158 186 * 159 * @since 2.7 187 * @since 2.7.0 160 188 * @uses wp_nonce_url() To protect against CSRF 161 189 * @uses site_url() To generate the log in URL 162 190 * @uses apply_filters() calls 'logout_url' hook on final logout url … … 180 208 * 181 209 * Returns the URL that allows the user to log in to the site 182 210 * 183 * @since 2.7 211 * @since 2.7.0 184 212 * @uses site_url() To generate the log in URL 185 213 * @uses apply_filters() calls 'login_url' hook on final login url 186 214 * … … 197 225 } 198 226 199 227 /** 228 * Returns the Registration URL. 229 * 230 * Returns the URL that allows the user to registre 231 * 232 * @since 2.8.1 233 * @uses site_url() To generate the registration URL 234 * @uses apply_filters() calls 'registration_url' hook on the registration url 235 * 236 * @param string $redirect Path to redirect to on registration. 237 */ 238 function wp_registration_url($redirect = '') { 239 $args = array( 'action' => 'register' ); 240 if ( !empty($redirect) ) { 241 $args['redirect_to'] = $redirect; 242 } 243 244 $registration_url = add_query_arg($args, site_url('wp-login.php', 'login')); 245 return apply_filters('registration_url', $registration_url, $redirect); 246 } 247 248 /** 200 249 * Returns the Lost Password URL. 201 250 * 202 251 * Returns the URL that allows the user to retrieve the lost password … … 218 267 } 219 268 220 269 /** 221 * Display the Registration or Admin link.222 *223 * Display a link which allows the user to navigate to the registration page if224 * not logged in and registration is enabled or to the dashboard if logged in.225 *226 * @since 1.5.0227 * @uses apply_filters() Calls 'register' hook on register / admin link content.228 *229 * @param string $before Text to output before the link (defaults to <li>).230 * @param string $after Text to output after the link (defaults to </li>).231 */232 function wp_register( $before = '<li>', $after = '</li>' ) {233 234 if ( ! is_user_logged_in() ) {235 if ( get_option('users_can_register') )236 $link = $before . '<a href="' . site_url('wp-login.php?action=register', 'login') . '">' . __('Register') . '</a>' . $after;237 else238 $link = '';239 } else {240 $link = $before . '<a href="' . admin_url() . '">' . __('Site Admin') . '</a>' . $after;241 }242 243 echo apply_filters('register', $link);244 }245 246 /**247 270 * Theme container function for the 'wp_meta' action. 248 271 * 249 272 * The 'wp_meta' action can have several purposes, depending on how you use it,