Opened 7 years ago

Closed 5 years ago

#2349 closed enhancement (fixed)

DevHub: Allow CPT be accessed via the REST API

Reported by: grapplerulrich's profile grapplerulrich Owned by: tellyworth's profile tellyworth
Milestone: Priority: normal
Component: Developer Hub Keywords: has-patch


Enable show_in_rest for all of the custom post types and taxonomies that contain the data on the functions.

This could be a data source for different projects.

For example we just created a WPCS sniff to check for all deprecated functions. I am thinking of creating a sniff that return an error on all WordPress functions that are not escaped on output if they should be. This would easily provide me with a list of public WordPress functions.

Attachments (2)

2349.patch (1.7 KB) - added by SergeyBiryukov 7 years ago.
2349.2.patch (2.2 KB) - added by SergeyBiryukov 7 years ago.

Download all attachments as: .zip

Change History (15)

#1 @SergeyBiryukov
7 years ago

  • Component changed from General to Developer Hub

#2 @SergeyBiryukov
7 years ago

  • Summary changed from DebHub: Allow CPT be accessed via the REST API to DevHub: Allow CPT be accessed via the REST API

This ticket was mentioned in Slack in #docs by kadamwhite. View the logs.

7 years ago

#4 @kadamwhite
7 years ago

This would be particularly desirable for the CPT "rest-api-handbook", as we could then dogfood the API a bit to experiment with interfaces for crowd-sourcing docs improvements.

7 years ago

#5 @SergeyBiryukov
7 years ago

  • Keywords has-patch added

#6 @DrewAPicture
7 years ago

Talked with @coffee2code about this a bit in person. While in theory this is a good idea, it's also worth considering what kind of potential traffic we're opening ourselves up to in making this data programatically available.

For instance, there are several development environments that would probably love to use this data for real-time reference information. And while that's awesome, I wonder what that would look like in practice.

Short answer: sure, we should do it. But be prepared to scale it back if necessary.

#7 @DrewAPicture
7 years ago

Also worth noting that a lot of the data is in meta and won't naturally be exposed by just making the cpts and taxonomies available.

#8 @mihdan
7 years ago

I'm developing a specialized bot to search the documentation for the WordPress functions directly from a chat in Telegram. For it to work would be enough to have the entity name and its description. I don't need the additional metadata. It is very inconvenient to parse the documentation site and then parse it using DomDocument. We hope for your understanding and early application of the patch from @SergeyBiryukov.

#9 @Responsor
7 years ago

Yeah, it would be great to have that functionality available!

#10 @Sh14
7 years ago

Agree. That functionality will be very useful!

This ticket was mentioned in Slack in #docs by netweb. View the logs.

6 years ago

This ticket was mentioned in Slack in #meta-devhub by drew. View the logs.

6 years ago

#13 @tellyworth
5 years ago

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

In 8869:

DevHub: allow CPT access via REST API

There's some discussion on the ticket about possible load issues, but the best way to find out is to try it and revert if necessary.

Props SergeyBiryukov.
Fixes #2349.

Note: See TracTickets for help on using tickets.