-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Search results returned by this plugin don't include ACF (Advanced Custom Fields) fields.
Compare:
- http://wp.local/wp-json/wp/v2/posts/
- http://wp.local/wp-json/wp/v2/multiple-post-type?type[]=post&search=test
The former will include acf in the results, the latter will not.
I traced the reason, it turned out that ACF plugin only injects acf fields when it sees that a REST request is coming for a certain known post type: https://github.com/AdvancedCustomFields/acf/blob/ada1e58a2e5564e7d62ded661ebdaf6a153ccb1f/includes/rest-api/class-acf-rest-api.php#L60-L64
// If the object sub type ($post_type, $taxonomy, 'user') cannot be determined from the current request, // we don't know what endpoint to register the field against. Bail if that is the case.
Any way to work around that?
I realise that this project is effectively abandoned but may be there's a recipe someone will be wanting to share?
diegormb06 and MastaBaba
Metadata
Metadata
Assignees
Labels
No labels