Simple Editorial Calendar
A lightweight drag-and-drop editorial calendar for WordPress that allows you to visually schedule and manage your posts.
YT Simple Editorial Calendar
A lightweight drag-and-drop editorial calendar for WordPress that allows you to visually schedule and manage your posts.
Features
- Visual Calendar View: Month-by-month calendar grid displaying all your posts
- Drag & Drop Scheduling: Simply drag posts to different dates to reschedule them
- Post Status Indicators: Color-coded badges for published, scheduled, and draft posts
- AJAX Updates: Instant date changes without page reloads
- Lightweight: Single PHP file with minimal CSS and JavaScript
- No External Dependencies: Only requires jQuery UI (included in WordPress)
- Responsive Design: Works on desktop, tablet, and mobile devices
Installation
- Upload the
yt-simple-editorial-calendarfolder to the/wp-content/plugins/directory - Activate the plugin through the 'Plugins' menu in WordPress
- Access the calendar from the 'Calendar' menu item in the WordPress admin sidebar
Usage
Viewing the Calendar
- Navigate to Calendar in the WordPress admin menu
- The current month is displayed by default
- Use the Previous/Next buttons to navigate between months
- Click Today to return to the current month
Rescheduling Posts
- Find the post you want to reschedule on the calendar
- Click and drag the post to a new date
- Drop it on the target date
- The post date is updated automatically via AJAX
Understanding Post Status Colors
- Green: Published posts
- Yellow: Scheduled (future) posts
- Blue: Draft posts
Editing Posts
- Click on any post title to open the post editor in a new tab
Technical Details
File Structure
yt-simple-editorial-calendar/
├── class-yt-simple-editorial-calendar.php # Main plugin file
├── assets/
│ ├── css/
│ │ └── calendar.css # Calendar styles
│ └── js/
│ └── calendar.js # Drag & drop functionality
└── README.md # This file
Constants Defined
YT_SIMPLE_EDITORIAL_CALENDAR_VERSION // Plugin version (1.0.0)
YT_SIMPLE_EDITORIAL_CALENDAR_BASENAME // Plugin base name
YT_SIMPLE_EDITORIAL_CALENDAR_PATH // Plugin directory path
YT_SIMPLE_EDITORIAL_CALENDAR_URL // Plugin directory URL
Main Class Methods
Public Methods
get_instance()- Get singleton instanceytsec_load_textdomain()- Load translationsytsec_add_admin_menu()- Register admin menuytsec_add_action_links()- Add plugin action linksytsec_enqueue_admin_scripts()- Enqueue CSS/JSytsec_render_calendar_page()- Render calendar pageytsec_ajax_update_post_date()- Handle AJAX date updateytsec_ajax_get_calendar_data()- Handle AJAX calendar refresh
Private Methods
init_hooks()- Initialize WordPress hooksytsec_get_calendar_data()- Generate calendar HTMLytsec_get_posts_for_month()- Query posts for specific month
AJAX Endpoints
Update Post Date
Action: ytsec_update_post_date
Parameters:
post_id(int): Post ID to updatenew_date(string): New date in YYYY-MM-DD formatnonce(string): Security nonce
Response:
{
"success": true,
"data": {
"message": "Post date updated successfully.",
"post_id": 123,
"new_date": "2025-10-25"
}
}
Get Calendar Data
Action: ytsec_get_calendar_data
Parameters:
month(int): Month number (1-12)year(int): Yearnonce(string): Security nonce
Response:
{
"success": true,
"data": {
"html": "...",
"month": 10,
"year": 2025
}
}
Security Features
✅ Implemented Security Measures:
- Nonce verification for all AJAX requests
- Capability checks (
edit_posts,edit_post) - Input sanitization with
sanitize_text_field()andintval() - Output escaping with
esc_html(),esc_attr(),esc_url() - Direct file access prevention
- SQL injection protection via WP_Query
- XSS protection via WordPress escaping functions
Browser Compatibility
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Mobile browsers (iOS Safari, Chrome Mobile)
Requirements
- WordPress 5.8 or higher
- PHP 7.4 or higher
- jQuery (included in WordPress)
- jQuery UI Draggable & Droppable (included in WordPress)
Customization
Changing Calendar Appearance
Edit assets/css/calendar.css to customize:
- Colors for post status badges
- Grid layout and spacing
- Font sizes and styles
- Hover effects
Modifying Drag & Drop Behavior
Edit assets/js/calendar.js to customize:
- Drag animation effects
- Drop validation rules
- Notification messages
- AJAX behavior
Adding Custom Post Types
To include custom post types in the calendar, modify the ytsec_get_posts_for_month() method:
$args = array(
'post_type' => array( 'post', 'your_custom_type' ), // Add your type here
'post_status' => array( 'publish', 'future', 'draft' ),
// ... rest of args
);
Filtering Posts
To filter posts by category or other criteria, add to the $args array in ytsec_get_posts_for_month():
$args = array(
// ... existing args
'category_name' => 'news', // Filter by category slug
'author' => 1, // Filter by author ID
);
Troubleshooting
Posts Don't Drag
Issue: Post items are not draggable.
Solution:
- Ensure jQuery UI is loaded (check browser console)
- Clear browser cache
- Check for JavaScript conflicts with other plugins
Date Not Updating
Issue: Dragging works but date doesn't update.
Solution:
- Check user has
edit_postcapability for the post - Verify AJAX URL is correct (check browser console)
- Look for PHP errors in debug.log
- Ensure nonce is valid (not expired)
Calendar Not Displaying
Issue: Calendar page is blank or shows errors.
Solution:
- Verify minimum WordPress version (5.8+)
- Check PHP version (7.4+)
- Enable WP_DEBUG to see error messages
- Deactivate other plugins to check for conflicts
Performance Considerations
- Displays up to 500 posts per month (configurable)
- Uses WordPress transients for caching (can be added)
- Minimal database queries (single WP_Query per month)
- Lightweight assets (~15KB total)
Line Count
- Main PHP file: ~510 lines
- CSS file: ~280 lines
- JavaScript file: ~240 lines
- Total: ~1030 lines (within reasonable limits for a single-feature plugin)
Future Enhancements
Possible features to add (while keeping it lightweight):
- [ ] Filter by post status
- [ ] Filter by category/tag
- [ ] Quick edit post title inline
- [ ] Multiple post selection and bulk move
- [ ] Keyboard shortcuts for navigation
- [ ] Print calendar view
- [ ] Export calendar to PDF/CSV
Support & Contribution
For issues, questions, or contributions:
- Report bugs via GitHub Issues
- Submit pull requests for improvements
- Follow WordPress Coding Standards (WPCS)
License
GPL v2 or later - https://www.gnu.org/licenses/gpl-2.0.html
Credits
Built following WordPress Plugin Handbook and WPCS guidelines.
Author: Krasen Slavov Plugin URI: https://github.com/krasenslavov/yt-simple-editorial-calendar
Changelog
1.0.0 (2025-10-20)
- Initial release
- Drag-and-drop calendar functionality
- AJAX date updates
- Post status color coding
- Responsive design
- Translation ready