• 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

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

      Plugin Page

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘New Plugin: JPF Register’ is closed to new replies.