• Resolved chommer

    (@chommer)


    Hello! Sorry for the seemingly simple question, I’ve searched both existing plug ins and the support documentation and haven’t found a clear answer to this.

    Is there a way to place links in the sidebar that are only visible to someone logged in as an admin. These would be custom links defined by me and not links to the admin section of the dashboard.

    Thanks in advance!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Helen Hou-Sandi

    (@helen)

    Core Lead Developer and 4.0, 4.7, and 5.6 Release Lead

    You might try the Widget Logic plugin to have a widget that only shows to an admin: http://wordpress.org/extend/plugins/widget-logic/

    The check for an admin would be something like current_user_can('administrator')

    Thread Starter chommer

    (@chommer)

    Worked perfectly, thank you!

    In case anyone else needs this, the actual syntax for widget logic should be:

    current_user_can(‘level_10’)

    Thanks again!

    Moderator Helen Hou-Sandi

    (@helen)

    Core Lead Developer and 4.0, 4.7, and 5.6 Release Lead

    No problem! I’d avoid levels and maybe choose a capability, like 'manage_options' instead, but if it works for you, I’m sure you’ll be happy! Be sure to mark this thread as resolved as well 🙂

    Thread Starter chommer

    (@chommer)

    Done. Thanks. 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Admin only links’ is closed to new replies.