My latest WordPress widget is a simple text display. Currently a single widget lets you show text based on one or more conditions:
- Always
- User is logged in
- User is not logged in
- User has a specific role
- Only on specific dates
There is also a rudimentary format control where you can specify how the text is processed for output:
- Bulleted (unordered) text
- Numbered (ordered) text
- Paragraphed text
- Preformatted text
- Unformatted text
It’s easily expandable to handle other formats or conditions. Conditions are especially easy, because I just create a new ‘condition tester’ class and register it with the widget.