The MU forums have moved to WordPress.org

[From Admin Page] How to hide content if not a user of the blog and vice versa? (2 posts)

  1. chibib0
    Member
    Posted 15 years ago #

    [From Admin Page] How to hide content if the userid is not a user of the blog?

    I want a function that can hide specific content to a userid that is not a user of the blog and vice versa.

    Like,

    if ($UserID->Not_a_member_of_this_blog)
    {
    Hide this
    } else {
    Show it
    }

    Or

    if ($UserID->a_member_of_this_blog)
    {
    Show this
    }
    else {
    Hide this
    }

    I tried the conditional tags of wpmu but I can't get it worked with this function.
    Thanks and I hope for your help guys!

  2. andrea_r
    Moderator
    Posted 15 years ago #

    Something more like

    if user_has_cap .

    If they are not a user on the blog, they have no capabilities there (the cap).

About this Topic

  • Started 15 years ago by chibib0
  • Latest reply from andrea_r