WordPress.org

Forums

Widget Logic
How to test two current_user_can('role')? (4 posts)

  1. dunster
    Member
    Posted 2 years ago #

    I want to show a widget when the user has role=leden or role=ai1ec_event_assistar.

    I thought I place in the Widget Logic area this code:
    current_user_can('leden') || current_user_can('ai1ec_event_assistar'
    But this is not working.

    The both roles seperately are working, but how do I use two roles with the "OR" ?

    Thanks
    dunster

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

  2. alanft
    Member
    Plugin Author

    Posted 2 years ago #

    assuming the missing ) off the end is just a copy/paste error, that looks like it should work to me

  3. dunster
    Member
    Posted 2 years ago #

    That was a copy/paste error.

    I found out now, I made a new role for ai1ec_event_assistar with the same autorities.
    Now it is working .... really strange
    The ai1ec_event_assistar was automatically made by the events plugin.

  4. pbaker21
    Member
    Posted 2 years ago #

    Help - not too sure if I'm in the right place to ask this question?

    If I wanted to create for example a hotel search engine. Would I use 2 Widgets, one with the search criteria and the other as the results?

    How would you go about creating a search engine where you can decide on which pages you want your search criteria and results to go?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic