Skip Navigation

[Resolved] Custom taxonomy doesn’t list private custom posts

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to show the proper "Next" and "Previous" links in an archive, based on the posts that the current User has permissions to View.

Solution: The latest version of Access has an improvement that corrects the behavior of the navigation links based on the User's Access permissions.

This support ticket is created 7 years, 5 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.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#530406
Custom_posts list_with_taxonomy.JPG
custom_taxo_not_listing_private_posts.JPG

I have created custom post type "Topos" that I want to filter in a loop based on custom taxonomy "Massifs", "Zones géographiques" and "Types de voies".
the problem is that I have published some custom posts as private in order to show only for logged-in users. Not logged users will only see public custom posts.

The issue is that custom taxonomies are only counted for "public" posts. In the screenshots you can see only 2 custom posts with "Vercors" as "Massifs" taxonomy and no other posts, while in the "Topos" posts list one can see there are a lot of custom posts with other "Massifs" taxonomy (e.g. "Chartreuse") and much more than 2 for "Vercors".
This is because it only count "public" posts.

The effect on front-end is that the "Chartreuse" taxonomy for "Massifs" doesn't show-up in the view filter.
What is wrong with custom Taxonomy not listing private posts?

#530539

Hi, this is how WordPress taxonomies work, even for standard Posts and Categories. You can try this by publishing a private Post with a new category. Return to the Category term list. The number of posts associated with this term will be "0".

In order to accomplish this effectively, I would not rely on "public" and "private" posts. Instead I would use Toolset Access to create Post Groups, which you can then hide from guest users. Multiple posts can be assigned to Post Groups.

#531134

Hi Christian,
OK, thanks for clarification. I'll configure the Toolset Access plugin which I didn't activate yet.

#531339

Hi Christian,
Your advice is fine thanks. I can easily manage access to specific custom posts using the Posts Groups from Toolset Access.
I still have an issue now in the View I created for this Post Type: the bottom navigation links (next and previous posts) still display (for Guests) links to the not accessible posts from the specific Post Groups.
These posts are now publish as public and access is not possible thanks to the Access Group. But Guests can still see the links when navigating through the publicly accessible posts.
Is there a configuration for Toolset Access I didn't set or is it linked to the View?

#531369

Just one precision, this issue is only affecting one post that should not be seen by Guests and that I can still see in the navigation links. The settings for this post are the same as the others: public and part of the new Access Group with no read access to Guests.

#531435

Hi, what should your Guest users see instead of the link to the "hidden" page? Would you like them to see no link at all, or should they see a link to the following post, skipping the hidden post?

#531514

well, normally Guest should not see link to hidden posts.
this is the case in all hidden posts but this one and there is no difference in the post configuration wrt the Access Group and public/private setting.
It is strange that only one post has this problem.
And in the view, it is displayed as a blank space. I have a grid view with 3 posts in a row. All the hidden posts don't show in the grid but this one as blank slot.

#531535

Can you share the URL of the post so I can see what's happening? I would also like to take a look at your wp-admin area if that's okay. I had login credentials from another ticket but they do not appear to be active now. I will enable a private reply area here if you want to share new credentials.

#531565

If needed I can reactivate the previous login you have. It has not changed, just deactivated.

#531603

I think I can get by with just a screen shot showing your View or Layout where you have created your Grid. I'd like to see the code associated with this grid if possible.

I'm able to replicate this on a default installation with a default theme (View shows posts that should be hidden by Access, Next / Prev links show posts that should be hidden), so I need to escalate those to our 2nd tier supporters. As soon as I have some information from them I'll give you an update here.

#531604
topo_public_view_loop.JPG
topo_public_view_layout2.JPG
topo_public_view_layout1.JPG
topo_public_view_filter.JPG

Hi Christian,
Thanks, I uploaded screenshots of the complete view (filter, layout and loop).
I also noticed that I didn't see this issue on a mobile device where each post appear vertically one by one and not on a grid layout.
Waiting for your feedback

#531622
Screen Shot 2017-06-01 at 6.07.27 PM.png

What you're seeing in the grid could be expected, because you've got a conditional wrapped around your content template code (see screenshot). So the View filter may find a result, which causes it to create a grid element. However, this conditional appears to be suppressing the contents of that grid element. I do not recommend conditionals in Loop items for this very reason - they will lead to confusing results. If you want to enforce this condition, you should instead implement it in the Query Filter of your View.

I also noticed that I didn't see this issue on a mobile device where each post appear vertically one by one and not on a grid layout.
Empty vertical space and empty horizontal space are handled a bit differently in this case, and unless a grid element has a predefined height (yours do not) then it's possible that this empty vertical space simply collapsed. I think your issue here is probably the conditional mentioned above.

#531890

Hi Christian,
Thank you for your advice, it was helpful to have a clean display of selected/authorized posts to Guests with no blank slots.
Nevertheless, the initial issue is still there: navigation links still show all posts. The posts from reduced access group defined and the posts with no reduced access group (i.e. public).
You said that you have raised this to your 2nd level support as you can reproduce this issue.
When do you expect a feedback on this?

#532443

Hi, our 2nd tier supporters have escalated this to our development team, where it is being considered in their queue of usability issues. I don't have a timeline for their consideration or implementation right now, but when I have something to share I'll let you know here.

#549219

Hi, just a quick update to let you know that the issue with hidden posts showing up in navigation is being resolved in the next release of Access, version 2.4.2. I will let you know when that is available to download so you can apply the fix to your site.