JPF Register WordPress Plugin

The built in ‘wp_register’ function is hard-coded to display either a ‘Register’ or a ‘Site Admin’ link. If you want to display different wording, you’re out of luck, until now. The jpf_register function allows you to determine what text is displayed as the link for registering. It also allows you to include what text or coding you want included before or after the link. Finally, if you don’t want a link to be displayed at all if a user is already registered (based on if they are logged in or not), it can do that to. The plugin accepts the following parameters:

jpf_register ( '<before>', '<after>', '<not_registered>', '<registered>')

If you don’t specify any parameters (ie. just put jpf_register()) it will behave the same as wp_register, that is it will put a <li> before and </li> after the link, and the link will either say ‘Register’, or ‘Site Admin’.

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

<?php jpf_register ('<li>', '</li>', 'Register Me!', 'Admin'); ?>

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

<?php jpf_register ('', '', 'Sign Me Up', 'Control Panel'); ?>

or

<?php jpf_register ('<p>', '</p>', 'Join Now!', 'Profile Options'); ?>

Want more control over how the link is formatted? Wrap it in a <div> and use CSS to format it:

<?php jpf_register ('<div class="register">', '</div>', 'Register', 'Site Admin'); ?>

Don’t want the link to show up at all if someone is logged in (and therefore obviously registered)? Make the link disappear:

<?php jpf_register ('<li>', '</li>', 'Register', ''); ?>

Still not good enough? Use any image:

<?php jpf_register ('', '', '<img src="/images/register.gif" />', '<img src="/images/siteadmin.gif" />'); ?>

Note: Tested with WordPress versions up to and including 2.3

Posted: 06 October 13
Under: Wordpress
Viewed: 7,373 views

9 Responses to “JPF Register WordPress Plugin”

  1. Lorin Rivers says:

    Hey Joe, I found this plugin through the wordpress forums . There are two bad links in the posts about your plugin there. You might want to look for what links are pointing to your plugins there and do some redirecting or something.

  2. Lorin Rivers says:

    I tried to post a link, but it was stripped out.

    wordpress.org/support/topic/90852

  3. leSinge says:

    Thanks! excellent plugin..

  4. sketcher says:

    i am trying to make register link for my site sketches.despre.org/ but i cant, only link for admin appear

  5. Joe says:

    What code did you put in your template (for example, did you put jpf_register (‘

    ‘, ‘

    ‘, ‘Join Now!’, ‘Profile Options’))?

Leave a Reply