Home › Forums › General Issues › Include instead of \r\n\r\n WP REST API › Reply To: Include instead of \r\n\r\n WP REST API
From your description it appears that the plugin is not applying filters to the ACF wysiwyg fields.
The ACF to rest API is a 3rd party plugin. I hate to do this to you but you should contact the developer of that plugin or ask them the question. The reason I hate to do this is that it does not appear that plugin is being maintained.
I did some looking and I did find this on the github repo https://github.com/airesvsg/acf-to-rest-api/issues/215
I would amend that code because if the plugin is not applying autop then it not running any filters on the fields.
add_filter( 'acf/rest_api/{type}/get_fields', function( $data, $response ) {
if ( isset( $data['acf']['my_field'] ) ) {
// my change here
$data['acf']['my_field']->post_content = apply_filters('acf_the_content', $data['acf']['my_field']->post_content );
}
return $data;
}, 10, 2 );
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.