WordPress.org

Making WordPress.org

Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#356 closed enhancement (fixed)

Add Jetpack JSON API support for WordCamp Custom Post Types

Reported by: dustyf Owned by:
Milestone: Priority: normal
Component: WordCamp Site & Plugins Keywords:
Cc:

Description

It would be valuable to have access to session, speaker, and other WordCamp post type information in a JSON format. Until the JSON API plugin is included in core (or if that would be installed on wordcamp.org), there is a JSON API built into Jetpack which is installed on all WordCamp sites. This should be ample for most cases. All that is needed to add CPTs to this is to hook into a filter in Jetpack passing it an array of CPTs to be whitelisted. Attached is a patch whitelisting the CPTs from the WC Post Types plugin.

Attachments (1)

wc-post-types.php.diff (558 bytes) - added by dustyf 5 years ago.
Patch including filter to add WC CPTs to Jetpack JSON API

Download all attachments as: .zip

Change History (7)

@dustyf
5 years ago

Patch including filter to add WC CPTs to Jetpack JSON API

#1 @iandunn
5 years ago

Since the JSON API from the GSoC project has been blessed for Core, I'd rather just go ahead and start using that in it's plugin form, so that all our endpoints can be standardized around it. Check out the plugin Marko wrote for the wordcamp post type in #222 for a rough example.

One thing that's really important to take into consideration is privacy, though. We don't just want to expose everything, only fields that are already public (e.g., their name and the session title). The wordcamp post type contains some private data (like organizer addresses and phone numbers), and wcb_speaker could potentially have things like that in the future too.

It might be good to wait a few weeks on this, too, since we're considering making some changes to the speaker/sponsor/organizer post types. They might get merged into a single 'person' post type, and then have a custom taxonomy to specify their role(s). Then we'd add a volunteer role too. It's also possible we'd just use the user accounts themselves, rather than CPTs.

#2 @dustyf
5 years ago

Perfect, that is even better. I'll try to look through it now and stay tuned for the other changes. I'll try to follow along to see what else I may be able to help on.

#3 @iandunn
5 years ago

Awesome, thanks :) I'll post an update here once the team has reached a decision and we can move forward from there.

#4 @iandunn
4 years ago

  • Resolution set to fixed
  • Status changed from new to closed

The JSON API is available now. None of the meta data is exposed for these yet, but that's on the list. Let me know if there's a particular field that's important to you and I can prioritize it accordingly.

http://sf.wordcamp.org/2014/wp-json/posts?type=wcb_speaker
http://sf.wordcamp.org/2014/wp-json/posts?type=wcb_session
http://sf.wordcamp.org/2014/wp-json/posts?type=wcb_sponsor

#5 @dustyf
4 years ago

Looking awesome so far!

First on my list would be Sessions and the related meta. I mainly wanted this for a few things I wanted to make for our WordCamp mostly surrounding the schedule like a mobile app and a schedule on a big screen tv/projector that would automatically pull the sessions.

For this, I'd want to get the sessions by the Track taxonomy and day and have the regular meta that displays for them on the schedule (Speaker, Date, Time).

#6 @iandunn
4 years ago

Cool, I've added those to the list :)

@aagam94 is also working on an app for all WordCamps, which may cover some of your use cases.

Note: See TracTickets for help on using tickets.