[wp-trac] [WordPress Trac] #4648: Addition to the function wp_loginout ()

WordPress Trac wp-trac at lists.automattic.com
Tue Jul 17 13:46:14 GMT 2007


#4648: Addition to the function wp_loginout ()
-------------------------+--------------------------------------------------
 Reporter:  jorgeka      |       Owner:  anonymous
     Type:  enhancement  |      Status:  new      
 Priority:  low          |   Milestone:           
Component:  General      |     Version:           
 Severity:  trivial      |    Keywords:           
-------------------------+--------------------------------------------------
 It's just a small thing that bothered me a tiny bit; each time I wanted
 the '''''wp_loginout ()''''' to take the user to some other page, I had to
 manually type the '''''redirect_to'''''-link in the document, and to save
 myself of writing 10-20 characters the few times I wanted it to take the
 user somewhere, I added the '''''redirect_to''''' as a parameter to the
 function, leaving it to look something like this:
 {{{
 #!php
 function wp_loginout($redirect_to = '/') {
         if ( ! is_user_logged_in() )
                 $link = '<a href="' . get_option('siteurl') . '/wp-
 login.php?redirect_to=' . $redirect_to . '">' . __('Login') . '</a>';
         else
                 $link = '<a href="' . get_option('siteurl') . '/wp-
 login.php?action=logout&redirect_to=' . $redirect_to . '">' . __('Logout')
 . '</a>';

         echo apply_filters('loginout', $link);
 }
 }}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4648>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list