Skip Navigation

[Resolved] How can I show hide child posts with a membership button tied to a userprofile?

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

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 7 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#407941
Screenshot 2016-06-16 15.08.29.png

I am trying to: implement an "Enroll" button that adds a course to a user profile, showing that the user is enrolled in the course. Being enrolled means that the user gets access to the lectures that are children of the course.

I visited this URL: I tried to create a form that sends a textfield to the user profile, but I can't find a way to prepopulate the field with the post-title (or any data of the post where the form is applied). I can't use a type-field shortcode in the form shortcode when it is applied in a post. Right?
Like this:

[cred_field field='course' post='user' value='[wpv-post-title]' urlparam='' readonly='true']

When used as above, it returns an empty value. I hide the form field btw. but I checked the code and it doesn't show.

I expected to see: I expected a form field populated with the title of the post.

Instead, I got: An empty value.

Is there perhaps an easier way to edit membership in context?

#408178

Dear thomas,

Are we talking about a CRED form for edit user?
If it is, the attribute value='[wpv-post-title]' won't work as you expected, this course field will display the user field value.

I suggest you create a cred_generic_field for it, then use CRED action hook cred_save_data to save the value into database, more help:
https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_generic_field
https://toolset.com/documentation/user-guides/cred-api/#csd

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