Task Manager API
A custom WordPress plugin that adds a REST API for managing tasks. Demonstrates plugin development with custom REST API endpoints for CRUD operations.
by Lucifer9973 · github.com/lucifer9973/wp-custom-task-manager-plugin · website
★ 1stars
1forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/lucifer9973/wp-custom-task-manager-plugin/archive/refs/heads/main.zipA lightweight WordPress plugin that demonstrates custom REST API development with database integration.
Features
- Custom REST API Endpoints - Full CRUD operations for task management
- Database Integration - Uses WordPress
$wpdbfor data persistence - Security - Includes nonce verification and authentication
- No UI - API-only plugin focusing on backend functionality
REST API Endpoints
Get All Tasks
GET /wp-json/tasks/v1/all
Retrieve all tasks from the database.
Response:
{
"success": true,
"data": [
{
"id": 1,
"title": "Task Title",
"description": "Task Description",
"status": "pending",
"created_at": "2024-01-08 10:00:00"
}
]
}
Create Task
POST /wp-json/tasks/v1/create
Create a new task.
Request Body:
{
"title": "New Task",
"description": "Task description",
"status": "pending"
}
Required Headers:
X-WP-Nonce: [nonce_value]- WordPress nonce token
Installation
- Copy the
task-manager-apifolder to/wp-content/plugins/ - Activate the plugin from WordPress admin
- Plugin creates custom table on activation
File Structure
task-manager-api/
├── task-manager-api.php # Main plugin file
├── includes/
│ ├── class-database.php # Database setup & queries
│ └── class-api.php # REST API endpoints
└── README.md
Technical Details
- Language: PHP 7.4+
- Database: Custom
wp_taskstable - Authentication: WordPress Nonce verification
- Namespace:
tasks/v1
Development
This plugin demonstrates:
- Custom post types via database
- REST API registration
- WordPress security practices
- Database migrations on activation