Opened 7 years ago
Closed 4 years ago
#2940 closed enhancement (reported-upstream)
WordCamp Attendee JSON
Reported by: | codexdemon | Owned by: | |
---|---|---|---|
Milestone: | Priority: | low | |
Component: | WordCamp Site & Plugins | Keywords: | needs-patch good-first-bug |
Cc: |
Description
Is there way to get JSON of WordCamp Attendee, was working on attendee page in android so i could not able to figure out WP Json for Attendee of Camptix
Attachments (2)
Change History (12)
#2
@
7 years ago
- Keywords needs-patch good-first-bug added
- Owner set to coreymckrill
- Status changed from new to accepted
This ticket was mentioned in Slack in #meta-wordcamp by coreymckrill. View the logs.
7 years ago
#6
@
7 years ago
Here's a first patch for the attendees endpoint. The patch exposes wp-json/wp/v2/tix_attendees
endpoint and it can use the same parameters than the posts
endpoint with some changes:
- The endpoint includes a few fields like first name, last name and a list of avatars URLs.
- It doesn't allow the
per_page
parameter (same than the[camptix]
shortcode) - It won't display attendees marked as private
Not done yet:
- Create a new tab in Camptix settings to select questions to display in the endpoint.
- Add those fields in the response.
Still, without the questions, I think the endpoint is pretty usable already.
#7
@
7 years ago
I haven't had a chance to look closely at the patch, but it looks to be going in the right direction at first glance.
We might want to use wcorg_register_meta_only_on_endpoint()
from helper-functions.php
, to avoid the privacy issues explained in that function's docblock. I can't think of a use case where exposing first/last names would be a big deal, but there could be one that I haven't thought of yet.
#8
@
7 years ago
@iandunn
I'm uploading a new patch. I had to add 'custom-fields'
to support
array when the post type is registered. I'm not sure if there's any security concern about it but I had no other way if I wanted to return the meta
array in the response.
The questions are still missing but I don't really know if adding a new tab in Camptix settings would worth it as I guess no WC organizer will care about the REST API. I think the Twitter username and site URL would be more interesting to add. I see that there are a few actions hooked into the attendees shortcode like camptix_question_field_twitter
. I'm thinking if it would be a good idea to check if has_action( 'camptix_question_field_twitter' )
or similar and then display that field in the response or not. I can't think right now on another way to decide if the field should appear or not.
This ticket was mentioned in Slack in #meta-wordcamp by ryelle. View the logs.
5 years ago
#10
@
4 years ago
- Resolution set to reported-upstream
- Status changed from assigned to closed
This ticket has been moved to GitHub https://github.com/WordPress/wordcamp.org/issues/654
This would require creating a new plugin or enhancing the core CampTix plugin to add a new REST API endpoint for the
tix_attendee
post type. The controller for the endpoint would need to follow similar logic to the[camptix_attendees]
shortcode to ensure that attendees marked as "private" do not get included in the response. There would also probably need to be a way within the UI to mark which questions/answers get included as fields in the REST response. And it would need to be possible to filter by ticket type.