Getting Author Nickname with Wordpress api

23 Views Asked by At

My company has a page on one of our websites(non wordpress site, it's codeigniter) that is using the wordpress api to call our main wordpress website where we have all our employees/writers stored. They want to display blogs they write and have their information on the page.

Originally I needed the author name and figured out how to get embedded author data like this:

https://www.example.com/wp-json/wp/v2/posts?categories=7903&_embed&per_page=32

Then I can get author name as such:

var blog_author = response[<?php echo $post_id['pid']; ?>]._embedded.author[0]['name']

This works and I can get the authors name, but now they want the nickname displayed on the page too. The nickname is set when a user is added to WordPress and it's a required field so it's got to be accessible somewhere. However, I've searched the objects and it's not there?

I've searched a solution for a long time, I don't like to just immediately ask stackoverflow but I'm stumped on this one.

0

There are 0 best solutions below