Example Custom REST API Endpoint
Registers a read-only endpoint at /wp-json/wpide/v1/latest that returns your latest posts in a compact format, as a starting point for your own API routes.
Snippet Library
Snippets for developers: debugging helpers, custom cron schedules, body classes, REST API tweaks and admin tools for checking hooks and queries. Building blocks for people who write code for WordPress every day.
Registers a read-only endpoint at /wp-json/wpide/v1/latest that returns your latest posts in a compact format, as a starting point for your own API routes.
Adds a public /wp-json/site/v1/image-sizes endpoint listing every registered image size with its width, height and crop setting, so headless front ends can pick the right size for each layout.
Adds a public /wp-json/site/v1/menu/{location} endpoint that returns the menu assigned to a theme location as a nested list, ready for a headless or app front end.
Adds a /wp-json/site/v1/stats endpoint that returns post, page, comment and user counts to logged-in editors or application-password clients, for reporting tools and status boards.
Adds a public /wp-json/site/v1/random endpoint that returns one random published post with its title, link and excerpt, for "surprise me" buttons or widgets.
Adds a public /wp-json/site/v1/identity endpoint with the site name, tagline, logo, site icon, language and home URL, so headless front ends and apps can brand themselves from WordPress.
Adds a lightweight /wp-json/site/v1/ping endpoint for uptime monitors. It answers 200 only when WordPress can reach the database, and 503 otherwise, without exposing any versions.