Home › Forums › Backend Issues (wp-admin) › Setting up ACF Pro with WP REST API › Reply To: Setting up ACF Pro with WP REST API
Here is how I solved it. I was missing a filter for my custom post type which I added to my “custom_setup” function.
add_filter('rest_prepare_custom_nav', function($response) {
$response->data['acf'] = get_fields($response->data['id']);
return $response;
});
So the filter is a wild card filter, applied like
apply_filter("rest_prepare_YOUR-CUSTOM-POST-TYPE-NAME-HERE", ...
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.