-
Notifications
You must be signed in to change notification settings - Fork 24
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
Update to get acf in taxonomies #42
base: master
Are you sure you want to change the base?
Conversation
addACFDataTermV2 function don't add acf to taxonomies term i suppose with get_taxonomies() it will be better. tell me if i miss something or there is other way to get this data. thanks.
Thanks for this @omaretna - I'll do some testing later this week and hopefully fold this in. Just to clarify, is this to ensure custom terms within taxonomies have ACF data, or something else? |
Welcome, its to add ACF to custom taxonomies because when your put register_api_field(term, acf...) that dont do nothing in V2. :) |
IMO this fix is incomplete. From Beta 11 there is no longer any endpoints for A proposed fix could be function addACFDataTermV2() {
register_rest_field( 'tag',
'acf',
array(
'get_callback' => array( $this, 'addACFDataTermV2cb' ),
'update_callback' => null,
'schema' => null,
)
);
register_rest_field( 'category',
'acf',
array(
'get_callback' => array( $this, 'addACFDataTermV2cb' ),
'update_callback' => null,
'schema' => null,
)
);
register_rest_field( get_taxonomies(),
'acf',
array(
'get_callback' => array( $this, 'addACFDataTermV2cb' ),
'update_callback' => null,
'schema' => null,
)
);
} |
i think that
cant just work fine because get_taxonomies() contain tag and categories i think for v2 there is category but maybe i am wrong. |
any news on this? i am using ACF to REST API and was thinking of using this plugin instead but i need taxonomy support. |
Hy @chrishutchinson did you check this pull request ? |
addACFDataTermV2 function don't add acf to taxonomies term i suppose with get_taxonomies() it will be better.
tell me if i miss something or there is other way to get this data.
thanks.