Wanted:
- Add the ability to join/unjoint an event for registered client.
- Allow the admin to manage/review easily each event participants.
Here is what I will do for a full management
CMS
- Create a custom meta box that you will attach to your CPT “event”.
(this meta box will display the name of every person that are linked
to the event, also, the remove/add event should be added inside the admin). - Modify the CPT saving function to save all your users id inside a variable (table).
- Attach this variable as a meta tag linked to a post of your custom post type “event”.
Template
Once a user is register, you should check if the user has applied to the event and display a join button (join/unjoin should be the same button, only one function).
-
Create a function that will get the event new meta tag information and compare if the user has register to the event. (function should return: yes or no -> useful for latter work )
-
Create a function that will update the meta tag value on the button click event. This function should change the button text by join/unjoin and should update/write the new meta tag variable.
Hope this help, if you have any questions, let me know, I can send you examples.