WpPosts vue_meta term links, terms and excerpts are empty and displayed posts are all uncategorized even though they have associated taxonomy of terms and categories. At first get_term_link was returning empty and producing a cannot convert to string error, but I managed to solve that by using $term_data->slug instead of name. A var_dump of $additional_post_data returns the correct info when looking at a post in the editor:
(size=5)
'custom_excerpt' => string 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam lobortis magna ut tellus vehicula malesuada eu eget turpis. Lorem ipsum dolor sit amet, consectetur adipiscing โฆ' (length=182)
'terms' =>
array (size=2)
0 => string 'design' (length=6)
1 => string 'dev' (length=3)
'term_links' =>
array (size=2)
0 => string 'design' (length=54)
1 => string 'dev' (length=48)
'featuredmedia_alt' => string 'Beachy City' (length=11)
'featuredmedia_url' => string '//localhost:3002/app/uploads/2020/05/d8db3e70-f8c0-383b-9c7c-2f23a8031043.jpg' (length=77)
The array on the post editor page contains the term_links, terms, and custom_excerpt.
When looking in postman I get a lot of errors for extend-api.php on lines 45 and 60.
/wp-json/wp/v2/posts?per_page=100&page=1&_fields=id,title,link,vue_meta
Notice: Undefined index: categories in /var/www/public/wp-content/themes/vuetwentyseventeen/includes/extend-api.php on line 45
Warning: Invalid argument supplied for foreach() in /var/www/public/wp-content/themes/vuetwentyseventeen/includes/extend-api.php on line 45
Looks like it is having issues with the forEach loop
Further down the response in postman There are cannot modify header information headers already sent errors. I don't know if the data is available at the time it starts the loop and the excerpt property seems to also be unavailable, but for some reason the image data for the post is available
Any help in resolving this would be appreciated. Thank you.
Warning: Cannot modify header information - headers already sent by (output started at /var/www/public/wp-content/themes/vuetwentyseventeen/includes/extend-api.php:45) in /var/www/public/wp-includes/rest-api/class-wp-rest-server.php on line 1337