WordPress.org

Make WordPress Core

Ticket #10141: registration.patch

File registration.patch, 6.1 KB (added by ramiy, 5 years ago)
  • wp-content/themes/default/sidebar.php

     
    6767 
    6868                                <li><h2>Meta</h2> 
    6969                                <ul> 
    70                                         <?php wp_register(); ?> 
     70                                        <li><?php wp_registration(); ?></li> 
    7171                                        <li><?php wp_loginout(); ?></li> 
    7272                                        <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> 
    7373                                        <li><a href="http://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a></li> 
  • wp-includes/default-widgets.php

     
    293293                        echo $before_title . $title . $after_title; 
    294294?> 
    295295                        <ul> 
    296                         <?php wp_register(); ?> 
     296                        <li><?php wp_registration(); ?></li> 
    297297                        <li><?php wp_loginout(); ?></li> 
    298298                        <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> 
    299299                        <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

     
    16901690        the_author_meta('ID'); 
    16911691} 
    16921692 
     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 */ 
     1703function 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 
    16931710?> 
     1711 No newline at end of file 
  • wp-includes/general-template.php

     
    138138 * or log out depending on whether or not they are currently logged in. 
    139139 * 
    140140 * @since 1.5.0 
     141 * @uses wp_login_url() to retrievethe Log In URL 
     142 * @uses wp_logout_url() to retrievethe Log Out URL 
    141143 * @uses apply_filters() Calls 'loginout' hook on HTML link content. 
    142144 * 
    143145 * @param string $redirect Optional path to redirect to on login/logout. 
     
    152154} 
    153155 
    154156/** 
     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 */ 
     168function 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/** 
    155183 * Returns the Log Out URL. 
    156184 * 
    157185 * Returns the URL that allows the user to log out of the site 
    158186 * 
    159  * @since 2.7 
     187 * @since 2.7.0 
    160188 * @uses wp_nonce_url() To protect against CSRF 
    161189 * @uses site_url() To generate the log in URL 
    162190 * @uses apply_filters() calls 'logout_url' hook on final logout url 
     
    180208 * 
    181209 * Returns the URL that allows the user to log in to the site 
    182210 * 
    183  * @since 2.7 
     211 * @since 2.7.0 
    184212 * @uses site_url() To generate the log in URL 
    185213 * @uses apply_filters() calls 'login_url' hook on final login url 
    186214 * 
     
    197225} 
    198226 
    199227/** 
     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 */ 
     238function 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/** 
    200249 * Returns the Lost Password URL. 
    201250 * 
    202251 * Returns the URL that allows the user to retrieve the lost password 
     
    218267} 
    219268 
    220269/** 
    221  * Display the Registration or Admin link. 
    222  * 
    223  * Display a link which allows the user to navigate to the registration page if 
    224  * not logged in and registration is enabled or to the dashboard if logged in. 
    225  * 
    226  * @since 1.5.0 
    227  * @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                 else 
    238                         $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 /** 
    247270 * Theme container function for the 'wp_meta' action. 
    248271 * 
    249272 * The 'wp_meta' action can have several purposes, depending on how you use it,