Skip Navigation

[Resolved] Unlocking Content

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

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.

This topic contains 1 reply, has 1 voice.

Last updated by Adrian 6 years, 8 months ago.

Author
Posts
#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.