-
Notifications
You must be signed in to change notification settings - Fork 28
Beta feature: Add endpoint to retrieve custom fields of a post type. #124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…nd on beta features anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
I'm also working on adding a new parameter to the same endpoint and needed to create the same `class-acf-rest-types-endpoint, so I started adding it in this same PR to avoid collisions but I'll add it in a follow-up in the end.
In the process, I removed the dependency with the beta features as the Command Palette will depend on the types endpoint changes. If we want to hide this behind the beta features, it should only be the part that registers the new fields, not the whole class. What do you think, @cbravobernal ?
* REST API | ||
* | ||
* @package Secure Custom Fields | ||
* @since 6.4.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important note here: using 6.4.0 as we are not introducing the REST API in this PR, only fixing the missing file annotation that resulted in errors.
No action required!
Sure, let's only hide the field registration. Done in 6c7beef |
I cannot approve my own PR, but looks good. |
What
Adds a new field
scf_field_groups
to the WordPress REST API's type(s) endpoints, providing information about field groups and fields associated with each post type. Includes metadata such as field group titles, field labels, and field typesWhy
Serves as the foundation to integrate the post metadata in the editor sidebar, as it requires knowing what fields a post type has.
Testing instructions
/wp-json/wp/v2/types
scf_field_groups
property containing an array of field groupstitle
andfields