WordPress for Developers
Extending the REST Response Instead of Building an Endpoint
You need one more field on /wp/v2/posts. register_rest_field does it in a dozen lines, keeps pagination and permissions, and does not create a second…
You need one more field on /wp/v2/posts. register_rest_field does it in a dozen lines, keeps pagination and permissions, and does not create a second…
permission_callback is required, and __return_true is a decision not a placeholder. Namespaces, argument validation, and what a public endpoint really means.