Logged In Conditional Text Widget

This is a fairly simple plugin. Excitingly it’s the first I ever contributed via WP Extend, rather than just sharing it with colleagues.

What does it add to your WordPress site?

  • A pair of text widgets – one only shows if user is logged in, and the other only shows if a user is not logged in. Intended to make it easy to conditionally show a Register link, but have other uses such as showing ads to logged out users or help text to signed in users.

Download latest version from WordPress Extend

Full Description

This adds two widgets – “Text (If Logged In)” and “Text (Not Logged In)”. These can be used much like the normal Text widget, except they only display if the condition is met. You can add HTML and JavaScript.

The intended usage is to allow you to add a link to a Register page, along with some text promoting registration, on a site with the bbPress 2.0 plugin.

You could also use this to display adverts to users who are not logged in, or useful links to users who are.

Unlike the normal Text widget which just has a toggle for paragraph on/off, this widget has four display options:

  • No formatting
  • Add paragraphs
  • Bullet list
  • Ordered list (numbered)

The additional list options are useful if you are adding a number of links – simply add each one on a new line and they’ll be turned into a bullet. There’s no additional styling here so they should match your other widgets.

What’s Planned?

This plugin will be tidied up for a 1.0 release whenever I find time. The to-do list currently stands as:

  • Make the title show in Admin when collapsed (like Text does)
  • Add i18n support

If there’s something you’d like me to add or amend, please suggest it below.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>