Tell us what you are trying to do?
When a user creates a profile on the site they need to selects some categories.
Example:
User 1 selects category A, C, E on account registration
User 2 selects category B, D on account registration
When user 1 goes to a CPT listing, they should only see posts with category A, C, E
When user 2 goes to the same CPT listing, they should only see posts with category B, D
Is there any documentation that you are following?
I haven't been able to find documentation that resolves this issue.
Is there a similar example that we can see?
I don't have an example
What is the link to your site?
Site is in development.
Hi,
There is no such feature available in Toolset.
You can use the Toolset access to set a post group to limit access to posts but it should be added by the admin of the website in the WordPress Dashboard and not by the user itself ins9ide a registration form:
https://toolset.com/course-lesson/setting-access-control/
Implementing such feature is outside of our support scope and you can consider hiring a developer for that:
https://toolset.com/contractors/
Thanks.
What about if I have User 1 and the user has a "company" CPT (Company 1)
The company has the following categories assigned to it: A, C, E
When the user views a list of all posts, the loop query get's the user's company categories and only shows the posts that share the same categories as the user's company?
So, based on the user, the company category get's passed to the query.
Is that possible?
Hi,
Your first sentence can be done. That is creating a post type and assigning a user to the post type entry by setting it as the author of that post type.
You can learn more about that here:
https://toolset.com/lesson-placement/lesson-placements-1622969-1929573/
The second part will be somehow set the custom post type entry for the user (company 1) to get categories that the user wants.
That is not what Toolset can do and it needs custom development. You might need to add generic fields for the form and intercept the form with cred_save hook and get which categories the customer selected. Then you will be able to assign those categories to the entry in question via code.
But is is way outside of our support scope. You can learn more about cred_save here:
https://toolset.com/documentation/programmer-reference/cred-api/
Thanks.
I think we were over thinking things.
I resolved this issue by adding a set of checkboxes to the user profile. When they sign-up they check their relevant boxes.
Then I have a conditional statement on the listing page that says:
If current user has checkbox A, then show items categorised as A.