WordPress.org

Support

Support » Plugins and Hacks » Widget Logic » [Resolved] Modify text in a text widget?

[Resolved] Modify text in a text widget?

  • Hi, can Widget Logic be used to modify the text (a shortcode with options) in a WP Text Widget?

    Basically I want a text widget to contain [calendar category=”1,2,3″] if user is admin, and [calendar category=”1″] if user is NOT admin

    I guess I could set up TWO text widgets and use is_admin() in one text widget and !is_admin() in the other, but would be nice to do it in one go!
    Thanks

    http://wordpress.org/extend/plugins/widget-logic/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author alanft

    @alanft

    your latter option is going to be WAY less prone to breaking in revisions of code and just easier to setup.

    WL *could* do what you say – the ‘widget_content’ filter is there to do things like this, take the content of a widget and change it, but I’m not even sure if it steps in before shortcodes are then expanded. I’m going to actually have a look into this anyway as you’ve brought the possibility up!

    chrisHe

    @chrishe

    Thanks, done as you suggest with two widgets!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Modify text in a text widget?’ is closed to new replies.
Skip to toolbar