WordPress.org

Ready to get started?Download WordPress

Forums

Restrict Content if (3 posts)

  1. Ashkir
    Member
    Posted 2 years ago #

    Hi there! I've been using this to show things to administrators only:

    <?php if(current_user_can('administrator')): ?>

    How would I go about to adding the "editor" role to it? I tried this but it didn't work.

    <?php if(current_user_can('administrator,editor')): ?>

  2. YouON
    Member
    Posted 2 years ago #

    I'm not a php programmer but hope this may works... or something like that :)

    <?php if(current_user_can('administrator') || current_user_can('editor')): ?>

  3. YouON
    Member
    Posted 2 years ago #

    Or probably you can define an array ;)

Topic Closed

This topic has been closed to new replies.

About this Topic