WordPress.org

Making WordPress.org

Opened 2 years ago

Last modified 6 months ago

#2349 new enhancement

DevHub: Allow CPT be accessed via the REST API

Reported by: grapplerulrich Owned by:
Milestone: Priority: normal
Component: Developer Hub Keywords: has-patch
Cc:

Description

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 2 years ago.
2349.2.patch (2.2 KB) - added by SergeyBiryukov 2 years ago.

Download all attachments as: .zip

Change History (14)

#1 @SergeyBiryukov
2 years ago

  • Component changed from General to Developer Hub

#2 @SergeyBiryukov
2 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.


2 years ago

#4 @kadamwhite
2 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.

@SergeyBiryukov
2 years ago

#5 @SergeyBiryukov
2 years ago

  • Keywords has-patch added

#6 @DrewAPicture
2 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
2 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
17 months 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
17 months ago

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

#10 @Sh14
17 months ago

Agree. That functionality will be very useful!

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


15 months ago

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


6 months ago

Note: See TracTickets for help on using tickets.