Hello,
I am using views with a table display, where each line is tested before to be printed :
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-conditional if="( '[wpv-current-user]' eq '[wpv-post-author]' )"]
<tr>[wpv-post-body view_template="Loop item in Toutes les demandes en cours pour un produit"]</tr>
[/wpv-conditional]
[wpv-conditional if="( '[wpv-current-user]' ne '[wpv-post-author]' )"]
[toolset_access role="RespAchats" operator="allow"]
<tr>[wpv-post-body view_template="Loop item in Toutes les demandes en cours pour un produit"]</tr>
[/toolset_access]
[/wpv-conditional]
</wpv-loop>
<!-- wpv-loop-end -->
If the current user is the post author, then it show the line, if he is not, then he must have "RespAchats" role to see it.
The conditional shortcode works great, and if the view loads no result, both the wpv-found-count and wpv-items-count return "0".
But the access shortcode doesn't work that way, since it doesn't show the line that he shouldn't, BUT it counts them as if they were there : then, both wpv-found-count and wpv-items-count return the total number of results, including the ones hidden by access.
1. Can you try to add the condition directly inside the Content Template (over the content shortcodes) and see if it works that way?
2. And what happens when you test this with a native WP role (such as Author, Contributor, etc)?
3. wpv-found-count and wpv-items-count return "0".
==> I can't see these anywhere in the View loop you have provided, where and how you are using it?
4. There could be a better approach to do that, can you please explain with an example what you are trying to achieve.
Please also provide temporary website WP-admin and FTP info for your site so I can see your setup. Your next answer will be private which means only you and I have access to it.
=== Please backup your database and website ===
✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.
✙ Please add the Links to the [Custom Role, View / CT] Edit Screen and [Page link, etc] where we can see the issue.
It is expected result: the views shortcodes [wpv-found-count] and [wpv-items-count] return the total number of results.
Because of these:
The shortcodes [wpv-found-count], [wpv-items-count], [wpv-conditional] and [toolset_access] run after the view's query get result.
So, the shortcodes [wpv-conditional] and [toolset_access] can not modify the result of [wpv-found-count] and [wpv-items-count].
In your case, you still need to display another content template for those hidden posts, so I don't think there is any built-in feature within Views can achieve what you want.
As your request, I forward it to our supporter who is responsible for the feature request of Views plugin, but there isn't any ETA for it, I suggest you subscribe to our blog to get the updated news. https://toolset.com/blog/