Skip to content

ACF fields not injected #27

@IlyaSemenov

Description

@IlyaSemenov

Search results returned by this plugin don't include ACF (Advanced Custom Fields) fields.

Compare:

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions