Skip Navigation

[Résolu] Unlocking Content

This support ticket is created Il y a 6 années et 8 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Ce sujet contient 1 réponse, a 1 voix.

Dernière mise à jour par Adrian Il y a 6 années et 8 mois.

Auteur
Publications
#627501

Hi,

I was discussing this previously here: https://toolset.com/forums/topic/unlock-content/ but the thread closed on me. Basically I would like to set up a function that once you submit a CRED Form, it adds the ID of the custom post type "listing" to the repeating field "listing_ids" within the custom post type "profile". At the same time I would like to decrease the numeric field "remaining_listings" by 1 which can be found within the "profile" Post type.

The post types look like this:

- Listing (ID)
- Profile
-- listing_ids (repeating numeric field) // designed to contain all the listing IDs
-- remaining_listings (numeric field) // designed to count down to 0

Not sure where to even begin ...

The previous post suggested creating a CRED Form that only has a submit button and use the cred_save_data hook to do this, but I am not sure if the form should be editing the listing it is being placed on, or the profile associated with the user currently logged in.

I have a shortcode that can retrieve the ID of the profile associated with the currently logged in user.

Any help would be greatly appreciated.

Thank you

#627544

Ok so I ended up going with a different solution and created my own plugin and functions. No need to rely on CRED for this as I would be overcomplicating everything.