How can PHP be used to store and retrieve data for a custom calendar plugin in Wordpress?

To store and retrieve data for a custom calendar plugin in WordPress using PHP, you can utilize the WordPress options API to save and retrieve data in the database. This allows you to store calendar events, settings, or any other data related to your plugin.

// Save data to database
function save_calendar_data($data) {
    update_option('calendar_data', $data);
}

// Retrieve data from database
function get_calendar_data() {
    return get_option('calendar_data');
}