Skip Navigation

[Resolved] View didn't respect defined Access to custom posts

This support ticket is created 4 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 4.24 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Author
Posts
#1513719

Multisite environment, /dev site.

I am trying to:
Generally speaking i want to limit to Administrator the visibility of the custom post type "tutorpost" (Tutor Posts).
I'm trying to create a view where Posts (standard Posts) and Tutor Posts are all listed (title, excerpt and links).
I have disabled all type of access to Tutor Posts by everyone else than Administrator.
I have create the /blog page and embedded a Toolset View
Here is the Loop Item code used in that view:


[wpv-conditional if="( '[wpv-post-type]' eq 'post' )"]
<div class="post">
  <h4>[wpv-post-link class="title"]</h4>
  <div class="excerpt">[wpv-post-excerpt class="tpostexcerpt"]</div>
  <ul class="urlgroup">
    <li class="url">[types field='archiveurl' target='_blank' separator='</li><li class="url">'][/types]</li>
  </ul>
</div>
[/wpv-conditional]
[wpv-conditional if="( '[wpv-post-type]' eq 'tutorpost' )"]
<div class="tpost">
  <h4>[wpv-post-link class="title"]</h4>
  <div class="excerpt">[wpv-post-excerpt class="tpostexcerpt"]</div>
  <ul class="urlgroup">
    <li class="url">[types field='archiveurl' target='_blank' separator='</li><li class="url">'][/types]</li>
  </ul>
</div>
[/wpv-conditional]

Link to a page where the issue can be seen:
The View based page: hidden link
The standard Tutor Posts Archive page: hidden link

I expected to see in the Blog page:
The View based page: hidden link
As an Administrator, i expected to see a list with all of the Posts and Tutor Posts
As an Editor, i expected to see a list with only Posts and no Tutor Posts

I expected to see in the Standard Archive page:
The standard Tutor Posts Archive page: hidden link
As an Administrator all of Tutor Posts
As an Editor ... none posts

Instead, using an Editor account, I got:
In the blog page the Editor can see all the posts
In the standard Archive page the Editor doesn't see any Tutor Post

Is it a standard behaviour or is it a bug?
Am i doing some errors?
Just one more spec: the /dev site is inside a WordPress Multisite environment
The problem is at the moment in the /dev site
I can't provide a Duplicator package since it's a Multisite and i'm using All In one WP Migration.
I have provided you the Administrator access.
To test the Editor access, You can change the password of "testeditor" account since i have no space to give you a second account information.

#1515873

Hi,

First sorry about the delay in reply, as we had an unusually high number of tickets in the queue.

Your observation is correct and the restrictions added through Access post type and posts group settings don't automatically extend to the loop items in the post views and WordPress archives.

For restricting these loop items/results, based on user roles, you can wrap the target content in "toolset_access" shortcode:
https://toolset.com/documentation/user-guides/access-control/access-control-texts-inside-page-content/

And for post groups based restrictions, you can use the steps from this guide:
https://toolset.com/documentation/user-guides/access-control/using-access-to-hide-certain-posts-from-view-results/

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1517203

I'm really sorry. I searched a lot in the forum but I had not read the user guides 🙁
Not really an obvious behaviour but ... ok, my issue is resolved now.
Many thanks for your support.