Manish Pushkar Jha

Welcome to the hub of creativity, innovation, and scientific discovery!

I’m Manish Pushkar Jha, a seasoned web developer, designer, author, artist, and research scientist in quantum physics.

Whether it’s designing stunning websites, developing powerful WordPress solutions, crafting captivating stories and artworks, or diving into the complexities of quantum mechanics, I bring a blend of technical expertise, artistic
flair, and scientific insight to every project.

Let’s collaborate to elevate your online presence and explore new frontiers in the digital and scientific realms.


Events WordPress Plugin

27 Views

Team members

  1. Manish Pushkar Jha
    WordPress Plugin Development

Employment

Employer: Coredo

Based in Helsinki, Finland, We transform agency designs into high-performance websites – pixel-perfect, on time, and 100% white-labeled.

Website >

Client: -

Overview

The WP Coredo Events Management Plugin is a custom WordPress plugin for event management. It allows users to create events, store metadata (such as start and end dates), and automatically delete outdated events based on their expiry date.

The plugin uses WordPress Cron Jobs to schedule automatic deletions, ensuring that expired events are removed efficiently without manual intervention. Additionally, an admin option allows for manual deletion of outdated events.


Functional Flow

Registering the Events Post Type

  • The plugin registers a custom post type named “Events” (events).
  • This allows users to create, edit, and manage events like regular WordPress posts.
  • Supports metadata fields for event start and end dates.

Storing Event Metadata

  • When an event is created or updated, the event start date (_event_start_date) and event end date (_event_end_date) are stored as post meta fields.
  • These dates determine when an event is considered expired.

Automatic Deletion via WP-Cron

  • A scheduled cron job (wpcoredo_schedule_event_cleanup()) is registered to run daily.
  • This cron job triggers the function wpcoredo_delete_outdated_events(), which:
    • Fetches all events where the end date is in the past.
    • Deletes these outdated events.
  • If the cron job is not already scheduled, it is set up upon plugin activation.

Manual Deletion via Admin Panel

  • The plugin provides a settings page with a “Delete Outdated Events Now” button.
  • Clicking this button triggers the wpcoredo_delete_outdated_events() function manually.
  • A security nonce check ensures only authorized admins can initiate deletion.

Admin Notifications for Deleted Events

  • After automatic or manual deletion, an admin notice displays the number of removed events.

Technical Implementation

Registering the Custom Post Type

  • Uses register_post_type('events', $args) to define the event structure.
  • Adds support for title, editor, and custom metadata fields.

Saving Event Metadata

  • Hooks into save_post to store _event_start_date and _event_end_date.

Scheduling the Cron Job for Auto Deletion

  • Upon Plugin Activation
    • The cron job is registered using wp_schedule_event() to run daily.
  • Upon Plugin Deactivation
    • The scheduled event is removed to prevent unnecessary execution.

Automatic Event Deletion via Cron Job

  • The cron job runs the wpcoredo_delete_outdated_events() function, which:
    1. Queries events where _event_end_date is less than today’s date.
    2. Deletes the expired events.
    3. Logs the number of deleted events (for debugging and tracking).

Manual Deletion via Admin Panel

  • A settings page allows admins to trigger deletion instantly.
  • Uses a secure AJAX request with a nonce to prevent unauthorized access.

Admin Notifications

  • After execution, a message appears in the admin dashboard confirming the deletion of outdated events.
Plugin DevelopmentTheme DevelopmentWebsite DevelopmentWooCommerce Plugin DevelopmentWordPress Plugin DevelopmentWordPress Theme Development
Enquire now about "Events WordPress Plugin" !

    Your name
    Your email
    Your message