Automattic / Automattic/co-authors-plus

Get all posts from a coauthor using WP REST API

Open
#680 4 comments 0 reactions 0 assignees View on GitHub
priority: medium status: needs investigation type: enhancement
Dominant language
PHP
Stars
322
Forks
216
Avg merge
7h 50m
Merged PRs (30d)
65

Description

Hi,

after I add all coauthors in every post now I need retrieve all posts from a specific user, I'm using WP Rest API but only some users (usually only the first author assigned) get posts.

The endpoint I'm using is `/wp-json/wp/v2/posts?author=1&_embed=true`

For most authors I get no posts.

One possible workaround is create some function to get all posts ids from a specific author, with this info I can use `/posts` filtering post ids. This could be possible using `coauthors_posts_links()`?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the request at /wp-json/wp/v2/posts?author=1&_embed=true and read how co-authors are represented for posts. Investigate whether coauthors_posts_links() exposes the needed post IDs or whether the WordPress REST API integration handles only the first author. Done means posts associated with a selected coauthor can be retrieved through a documented API path.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.