WordPress.org

Ready to get started?Download WordPress

Forums

New Plugin: JPF Register (3 posts)

  1. jpfieber
    Member
    Posted 7 years ago #

    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

  2. before and
  3. 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

  • spencerp
    Member
    Posted 7 years ago #

    Nice one! Thanks for sharing.. ;)

    spencerp

  • Orin
    Member
    Posted 7 years ago #

    The link doesn't seem to work anymore, but if I may be so forthright as to post a direct link, here it is:

    http://sojoe.info/Downloads/jpf_register.zip

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags