Forums

How to exclude from search result a certain taxonomy on a per role basis? (1 post)

  1. gian-ava
    Member
    Posted 10 months ago #

    I am trying to exclude certain post types with a specific taxonomy assigned from search result, for certain roles.

    It should do this:
    If user don't have "this privilege", than exclude this "Custom Post" that got this "Taxonomy" from search result.

    I am working on something like this:
    <?php if (!current_user_can('read_caribbean') && !current_user_can('create_users')) {
    if (get_post_type() == 'event') continue; //exclude post type
    } ?>

    But it doesn't do the trick and I need filter only specific post type (events) that got a certain taxonomy, not all!

    Any help is appreciate.
    Thanks.

Reply

You must log in to post.

About this Topic