• Resolved Prati1310

    (@prati1310)


    Hi Andres,

    First up, thanks for the plugin.

    I am trying to use it to show content only to loggedin users except one.

    That is I want to hide content to all non-logged-in users and a certain logged-in user.

    Possible?

    I have tried the following,

    [hide for=”all” exclude=”username=[!]{username}”] the content [/hide]

    [hide for=”!logged, username:{username}”] the content [/hide]

    [hide for=”!username:{username}” for=”!logged”]the content[/hide]

    It would be really helpful, if you can direct me as to how this can be resolved.

    Many thanks!

    https://wordpress.org/plugins/hide-this/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Andrés Villarreal

    (@andrezrv)

    (Sorry, disregard the previous answer, I didn’t understand it correctly)

    That’s not something that can be done with only one shortcode call, since different types of rules cannot be combined in the same attribute (check “Accepted attributes” in the plugin page).

    Combining shortcodes should do the trick:

    [hide for="!logged"][hide for="username:{username}"]Your content[/hide][/hide]

    For more advanced usage, you may want to check the Hide_This class in hide-this.class.php, which is used by the shortcode. With that, you can get more control over what you’re showing or hiding.

    Hope this helps.

    Best,

    Andrés.

    The suggestion above doesn’t seem to work for me. My guess is that the shortcode end-tags are not being matched up correctly by wordpress. By using the alternate shortcode name for one of the shortcodes, things seem to work:

    [hidethis for="!logged"][hide for="username:{username}"]Your content[/hide][/hidethis]

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide for all non-logged users and One Logged user?’ is closed to new replies.