Skip to content
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

Adding title to response data not working #203

Closed
arjendejong12 opened this issue Jan 16, 2018 · 1 comment
Closed

Adding title to response data not working #203

arjendejong12 opened this issue Jan 16, 2018 · 1 comment

Comments

@arjendejong12
Copy link

arjendejong12 commented Jan 16, 2018

Hello,

I'm trying to add the post title to a custom post type's response $data, but it's not appearing. It only works when I add it to the $data['acf'] array.

add_filter( 'acf/rest_api/locaties/get_fields', function( $data ) {
	$title = get_the_title( $data['id'] );
	$data['acf']['title'] = $title; // works
	$data['title'] = $title; // does not work
	return $data;
}, 10, 2 );

Is it possible to solve this? It's looks like the same thing you do here, but that is also not working.

@airesvsg
Copy link
Owner

Hello @arjendejong12 ,
Yes, any modifications should be happen, because this filter is only to modify act data.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants