Skip Navigation

[Resuelto] How to hide posts connecting two different custom post types?

This support ticket is created hace 6 años, 11 meses. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 2 respuestas, has 2 mensajes.

Last updated by hossamH-2 hace 6 años, 11 meses.

Assisted by: Nigel.

Autor
Mensajes
#531182

It's a very urgent question but very simple too..

I have two CPTs X and Y having a many-to-many relationship through a 3rd Z CPT that is nothing but a virtual link between X and Y. Every post in Z should naturally be a link between a post of type X and a post of type Y.

Now, how can I hide these posts (or the CPT itself) from being accessed on the frontend? If I set those posts to private, the two X and Y CPTs - to my surprise - don't become accessible. Setting them to password protected still get them publicly accessible URLs, so this is not a solution neither.

Even if I decided to use the ACCESS plugin to set this CPT access level, it would still be accessible on the fronted but requiring a login or something, so this is not working too.

There must be a lot of folks here who needed to link two CPTs using something that they don't want it publicly accessible. How to hide that?

Thanks in advance,
Hossam

#531270

Nigel
Supporter

Languages: Inglés (English ) Español (Español )

Timezone: Europe/London (GMT+01:00)

Hi Hossam

I'm not sure what the problem with using Access is.

If you manage the intermediary custom post type with Access and deny read access to guests then users who are not logged in will by default see a 404 page not found error, and if you have logged-in users who you do not want to see these posts then for their role you would also deny read access.

Have you tested it and found something different?

#531684

Thanks for your reply, Nigel. I have found out that there is a property "public available" when editing the post type; when unchecked it does the job. There is no need to use Access plugin or any additional plugins.

Regarding using Access, I assumed that non logged-in users will get 401 unauthorized instead of 404, but I was wrong. Thanks though.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.