Tell us what you are trying to do?
Using a view, I'm trying to display the posts that a user-role has access to based on roles assigned in Access Posts Groups.
Is there any documentation that you are following? https://toolset.com/documentation/user-guides/access-control/using-access-to-hide-certain-posts-from-view-results/
I'm able to output the group id and I have my conditional statements in my View as follows:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop wrap="1" pad="true">
[wpv-conditional if="( $(_wpcf_access_group) eq 'wpcf-custom-group-6a73bd885214879e8ea0c34a7acf174c' )"]
[wpv-post-title]
[wpv-post-body view_template="None"]
[/wpv-conditional]
[wpv-conditional if="( $(_wpcf_access_group) eq 'wpcf-custom-group-5720b93f882189a20e69a14e70cc76f3' )"]
[wpv-post-title]
[wpv-post-body view_template="None"]
[/wpv-conditional]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]
However, both results are being output, and there should only be 1 (again, based on the user roles assigned in Post Groups).
What is the link to your site? hidden link
Here's a better link: hidden link
Hello,
I have tried it in my localhost, the shortcodes [wpv-conditional] ... [/wpv-conditional] work just fine.
And in your case, since you don't want display those posts of specific 'post groups' at all, it is recommended to user query filter instead of [wpv-conditional] shortcode, for example, you can edit the post view you mentioned above, in section "Query Filter", add a custom field filter:
Select items with field:
_wpcf_access_group is a string equal to wpcf-custom-group-5720b93f882189a20e69a14e70cc76f3
See screenshot group-filter.JPG