Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/tha-springer-dude/tamino-featured-image-api/archive/refs/heads/main.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
A custom WordPress plugin that exposes a REST API endpoint for programmatically assigning featured images to posts. Designed to integrate WordPress with external automation workflows, including n8n.
Features
- Provides a custom WordPress REST API endpoint.
- Assigns featured images to posts using their post ID.
- Accepts an existing WordPress media attachment ID.
- Uses a configurable fallback image if the supplied image ID is missing or invalid.
- Validates post existence and image attachments.
- Restricts access to authenticated users with the
edit_postscapability.
API Endpoint
POST
/wp-json/ob/v1/set-featured-image
Parameters
| Parameter | Required | Description |
|---|---|---|
post_id |
Yes | WordPress post ID |
image_id |
No | WordPress media attachment ID |
Example Request
{
"post_id": 1234,
"image_id": 5678
}
Example Response
{
"success": true,
"post_id": 1234,
"image_id": 5678
}
n8n Integration
Designed as part of an automated WordPress publishing workflow:
- n8n receives content through a webhook.
- A WordPress post is created.
- An HTTP Request node calls the custom featured image endpoint.
- The featured image is assigned automatically.
- The workflow continues with subsequent processing steps.
Technical Details
- Platform: WordPress
- Language: PHP
- API: WordPress REST API
- Integration: n8n / HTTP Request
- HTTP Method: POST
- Data Format: JSON
Author
Willie Springer
- Website: https://www.ki-o.eu
- GitHub: https://github.com/tha-springer-dude
Part of the Tamino Travel automation and WordPress integration projects.