Skip Navigation

[Resuelto] Favorites function user permission help

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

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

Este tema contiene 5 respuestas, tiene 2 mensajes.

Última actualización por Minesh hace 7 años.

Asistido por: Minesh.

Autor
Mensajes
#591046

Hello,

I have been following the below support thread in order to implement a user favorites function to my site.

https://toolset.com/forums/topic/favorites-view/page/2/

I have implemented the code provided by Christian to my theme's functions.php file, as well as built a button only CRED (post edit type) form that ads the users id number to a repeating number field for the post. This button is added to the post to allow users to add it to favorites. Right now I have a series of posts that I have created as the admin, and added a few to "my favorites". I have a view setup that shows the posts I have Favorited. But when I log out and use a pseudo user account, the button to add to favorites disappears because I only allow the post author to edit the post.

The issue is I need to find a way to permit all users (except guests) to edit the repeating number field of the post, but only that field. Is there a way to do this? Can do this without created a child post type with all user permissions?

Thanks,
Tom

#591099

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - I would like to know where you would like to allow all users to edit the repeating field - on frontend or at backend (admin)?

#591200

Sorry, this edit will be done on the front end, on the actual post itself.

This is for a classified listing site, so no users will have admin panel access. The CRED form to edit the field is simply a button only form inserted into the listing. Then theres coding to add the user ID to the repeating number field when the cred form is clicked.

Thanks,
Tom

#591205

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Well - you can use CRED hook cred_save_data to save your repeating field value.

More info:
=> https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

Regarding restricting the CRED form access you can use Toolset Access plugin:
=> https://toolset.com/documentation/user-guides/access-control-for-cred-forms/

#591607

Ok thanks. Part of this function is how to handle guests. I would like for guests to choose favorite post but then delete their info when they leave.

Is there a way to handle guest Id number? What does the id of a guest look like?

Thanks,
Tom

#591612

Minesh
Supporter

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

No - there is no such feature exists. You should add your custom programming as per your requirement to build such function as custom programming is beyond the scope of our support policy.