JPF Login/Logout WordPress Plugin

The built in ‘wp_loginout’ function is hard-coded to display either a ‘Login’ or a ‘Logout’ link. If you want to display different wording, you’re out of luck, until now. The jpf_loginout function allows you to determine what text is displayed as the link for logging in or out. It also allows you to include what text or coding you want included before or after the link. The plugin accepts the following parameters:

jpf_loginout ( '<before>;', '<after>', '<login>', '<logout>')

If you don’t specify any parameters (ie. just put jpf_loginout()) it will behave the same as wp_loginout, that is it won’t include anything before or after the link, and the link will either say ‘Login’, or ‘Logout’.

Let’s say you want to include a login/logout link in your sidebar, along with some of the other plugins you have. You could use it like this:

<?php jpf_loginout ('<li>', '</li>', 'Log Me In!', 'Log Me Out!'); ?>

Maybe you want to include it somewhere else in your page, but just want the links to say something different:

<?php jpf_loginout ('', '', 'Let me in', 'Let me out'); ?>

or

<?php jpf_loginout ('<p>', '</p>', 'Log On', 'Log Off'); ?>

Want more control over how the link is formatted? Wrap it in a <div> so you can control it with CSS:

<?php jpf_loginout ('<div class="login">', '</div>', 'Lemme in!', 'Lemme out'); ?>

Still not good enough? Use any image:

<?php jpf_loginout ('', '', '<img src="/images/login.gif" />', '<img src="/images/logout.gif" />'); ?>

Note: Tested with WordPress versions up to and including 2.3

Posted: 06 October 13
Under: Wordpress
Viewed: 8,785 views

14 Responses to “JPF Login/Logout WordPress Plugin”

  1. Jauhari says:

    So where is the FORM for USERNAME and PASSWORD on the Sidebar?

    The Plugins just give litle bit info about user.

    Thanks

  2. [...] There is another one called JPF Login/Logout plugin where you could customize the display text.    The plugin page is here. [...]

  3. psycentr says:

    Very easy, right-outta-the-box plugin. I like being able to customize every pixel of my sites…thank you!

  4. Tim says:

    Superb.

    I needed to amend a friend’s site to another language. This part was causing me all the hassle. Once I installed this plug-in, it was fixed in two seconds. ;)

    Thanks!

  5. charles says:

    One to customize the Site Admin text would be GREAT! I HATE the words Site Admin.. My Account would be so much better. It’s the tag.

    Thanks!

  6. Joe says:

    @Charles: Way ahead of you. Check out my JPF Register plugin which allows you to change the default ‘Register/Site Admin’ text to whatever you want using the same syntax as this plugin.

  7. EMOruffino says:

    So Joe, when are you going to update this for 2.5?

    only thing not working with it is when i login the picture doesn’t change.

  8. [...] Version: 0.3 – License: GPL – Author: SoJoe – Plugin Page – » Download [...]

  9. [...] JPF Login/Out 1.0 (Giri? ve ç?k?? linklerini düzenlemenize yarayan bir eklenti) [...]

  10. [...] I could modify the text assocaited with logging in and logging out. The plugin for this is called JPF Login/out and is really just one file. Once it is installed you can use the following code to display the [...]

  11. [...] JPF Login/Out 1.0 (Giri? ve ç?k?? linklerini düzenlemenize yarayan bir eklenti) [...]

  12. Gold Jewelry says:

    This ought to be a very lucky day for me. Usually, I had to surf the net for a long while to get the precise information for my small research work. But today, I merely typed a few words relating to the subject of my work, pressed Enter on the keyboard…and…LOL! Your blog post shown up on the first page. And then, I am very pleased to convey that it merely took me a couple of hours to finish my project work; at other times this normally had taken me a whole long day to do so. Really thanks, buddy! I appreciate your work highly.

Leave a Reply