I'm really having a difficult time figuring this out conceptually. I'm trying to create a sort of management system for events/volunteering. Let's say I create a custom post type called events, for each of these post types I'd like a form to be tied to them (may have this form be built with gravity forms and have it manually in the theme template for the custom post page). When the user fills out the form, they become a user and register for the event (post type).

How do I set it up to tie each post id to a registration and when you look up the custom post types table you have a column that lists the amount of people signed up for that specific id? Is there also a way to limit the number of registrations to that event (custom post type id)? There are very few references for this.

  • You should create a custom post type (for example, name it event), and create a new user role (name it participant) mapped with that custom post type. And then use wp_insert_user with role set to participant to register an user under event post type. To limit number of registrations, use WP_User_Query with role and count_total. This is the basic idea. Hope you should be able to make something with this. – тнє Sufi May 24 '14 at 11:52
  • Thanks! I think I understand this! So when I map the user role with the post type you mean giving it capabilities based on the custom post type? – Alex Howell May 24 '14 at 14:56
  • Yes, by defining capability_type and capabilities in register_post_type. You will need to set map_meta_cap to true. – тнє Sufi May 24 '14 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.