• 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" />'); ?>

    Plugin Page

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘New Plugin: JPF Login/Out’ is closed to new replies.