WordPress Plugin for Event Calendar
Build a WordPress plugin that adds events to any WordPress site and shows them on an interactive monthly calendar. Site editors create events in the WordPress admin like regular posts, with extra fields for the start and end date and time and the location; visitors see them on a FullCalendar.js calendar, added to any page with a shortcode, where they can switch months and click an event to open it. You'll learn how WordPress plugins work: custom post types, meta boxes and post meta, nonces and capability checks for security, the REST API, loading JavaScript properly with wp_enqueue_script, shortcodes, and a settings page.
- Estimate
- ~12h
- Steps
- 7
- Completed by
- 0
- Proposed by
- codeseed.app
WordPress Plugin API · FullCalendar.js
Project roadmap
- 01
Set up a local WordPress and the plugin
~1.5hRun WordPress locally, for example with wp-env (npx @wordpress/env start), Local or Docker. Create wp-content/plugins/event-calendar/ with a main PHP file containing the plugin header comment, and prefix all your functions (or use a class) to avoid name conflicts. Done when: the plugin appears in the WordPress admin and activates without errors.
- 02
Register the Event post type
~1.5hOn the init hook, register an ec_event custom post type with register_post_type: public, with an archive, supporting the title, editor and thumbnail, show_in_rest set to true, and a calendar menu icon. Register the post meta fields start, end and location with register_post_meta, including their types and a sanitize callback. Done when: an Events menu appears in the admin and events can be created.
- 03
Add the event details meta box
~2hAdd a meta box with add_meta_box containing datetime-local inputs for the start and end and a text input for the location. On save_post, verify a nonce, check the user can edit the post, skip autosaves, validate that the end is after the start, then save with update_post_meta. Show an admin notice when validation fails. Done when: event details are saved and shown again when the event is edited.
- 04
Expose events as JSON
~2hRegister a REST route with register_rest_route, GET /wp-json/ec/v1/events?start=&end=, returning published events that overlap the requested range, formatted the way FullCalendar expects (id, title, start, end, url and location). Validate the dates in the route's args, and query efficiently with a meta_query on the start and end. Done when: opening the URL in the browser returns the events for a given month.
- 05
Show the calendar with a shortcode
~2hAdd an [event_calendar] shortcode that outputs a container div and loads FullCalendar (bundle its files with the plugin rather than loading them from a CDN) plus your own script, with wp_enqueue_script, only on pages that use the shortcode. Pass the REST URL to the script with wp_localize_script or wp_add_inline_script. Initialize the calendar in month view with the events feed. Done when: a page with the shortcode shows the calendar, and clicking an event opens its page.
- 06
Add a settings page
~1.5hAdd a settings page under Settings using the Settings API (register_setting, add_settings_section and add_settings_field) with options for the first day of the week, the default view (month or list) and the event color. Pass these settings to the calendar script. Only users with manage_options can change them. Done when: changing the settings changes how the calendar looks.
- 07
Clean up and test
~1.5hAdd an uninstall.php that removes the plugin's options when the plugin is deleted. Escape all output (esc_html, esc_attr, esc_url) and check the code with PHP_CodeSniffer and the WordPress coding standards. Write a test checklist in TESTING.md (creating events, invalid dates, the calendar across months, settings, permissions) and go through it. Done when: phpcs reports no errors, and every item in TESTING.md is checked.
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack