Hello,
After reading the Using the WP-API to Fetch Posts article, https://css-tricks.com/using-the-wp-api-to-fetch-posts/, I found the unset feature very useful to switch off fields that were not needed, however, I was wondering if someone knew how to remove nested fields.
For example, adding unset( $data['author'] );
will remove the full set of Author information, such as the First Name, Last Name, Nickname, Avatar, etc.
I have tried adding unset( $data['author']['first_name' );
but to no avail. The name still remains in the JSON code.
Is there a way to remove just the 'first_name'
of the author field?
Thanks
Damien