It seems to be accessible from:
https://developer.wordpress.org/wp-json/wp/v2/wp-parser-class
https://developer.wordpress.org/wp-json/wp/v2/wp-parser-method
https://developer.wordpress.org/wp-json/wp/v2/wp-parser-hook
https://developer.wordpress.org/wp-json/wp/v2/wp-parser-function
and search with e.g.
https://developer.wordpress.org/wp-json/wp/v2/wp-parser-function?search=get_post_embed
but it's probably best to generate your own with the WP Parser here:
https://github.com/WordPress/phpdoc-parser
This will create custom post types for
- wp-parser-hook
- wp-parser-function
- wp-parser-class
- wp-parser-method
and related post meta (to e.g. store function input arguments, line numbers, class type, hook type and namespace) and taxonomies (to store info on files, package, since, namespaces) in your own WP install.
Here's the theme that runs on the code reference's site:
https://github.com/WordPress/wordpress.org/tree/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer
There we can see how it displays e.g. a function's source code and a
list of a input parameters, using the theme's helper functions get_source()
and get_params()
.
I ran a test with:
cd wp-content
cd plugins
git clone https://github.com/WordPress/phpdoc-parser.git
cd phpdoc-parser/
composer install
wp plugin activate phpdoc-parser
wp parser create /path/to/source/ --user=test
Here's a screenshot from my test install:
Also more DevHub info here:
https://make.wordpress.org/docs/handbook/devhub/
https://developer.wordpress.org/wp-json/wp/v2/wp-parser-function/
route for the documentation pages which are auto-parsed from code comments, for example. You can perform a search on thosewp-parser
post-types.https://developer.wordpress.org/?s=get_posts&post_type%5B%5D=wp-parser-function&post_type%5B%5D=wp-parser-hook&post_type%5B%5D=wp-parser-class&post_type%5B%5D=wp-parser-method
) was sometimes more beneficial than the REST API search.<meta>
tags in the<head>
section of doc pages for more hints - some of therel="link"
s will point to equivalent REST routes. All of that said, as this is not a question specifically regarding the WordPress software itself, it may be considered off-topic on this stack. But feel free to hit me up in the stack chat if you run into more issues