Assign Post to Author
A 4-step recipe with WordPress. We can help you get access.
Recipe · 4 steps
Assign Post to Author
with WordPress
Find a user by role and publish a post attributed to them.
- List users filtered to the supplied role, returning the first matching account to attribute the post to.
- Read the selected user by id to confirm the account before attributing a post to it.
- Create a published post with its author set to the confirmed user id.
- Read the created post back by id to confirm it was attributed to the chosen author.
What you'll need to have ready
- authorization: HTTP Basic Authorization header value built from a WordPress Application Password (e.g. "Basic dXNlcjpwYXNzd29yZA==").
- role: The user role to filter authors by (e.g. "author").
- postTitle: The title for the new post.
- postContent: The HTML content body for the new post.
For your developer
Arazzo workflow wordpress:assign-post-to-author, 4 operations: listUsers → getUser → createPost → getPost. Specs on APIs.io.