Save event change in WP Fullcalendar: editable + draggable

Plugin: https://wordpress.org/plugins/wp-fullcalendar/

I use a plugin to display my “custom_post_type” events.

  1. I have modified the “wp-fullcalendar.php” plugin file in several places to show the start and end time of the “custom_fields” event.
  2. I also edited the “inline.js” file in the “includes / js /” folder to make the calendar “editable” and “dragable”.
  3. But I CAN’T set the calendar to save the change to my “custom_post_type” event when I make a change by moving the event on the calendar.

I read the documentation for the JS plugin “calendar.io”, but I can’t insert the code into the already finished plugin “WP Fullcalendar”.

Will you help please? Thanks!!!

These are my edits to the plugin code

wp-fullcaleendar.php

/*
$post_date = substr($post-post_date, 0, 10);
    $post_timestamp = strtotime($post-post_date);
    */
    $post_date = substr($post-_EventStartDate, 0, 10);
    $post_timestamp = strtotime($post-_EventStartDate);
    
    $post_end_date = substr($post-_EventEndDate, 0, 10);
    $post_end_timestamp = strtotime($post-_EventEndDate);

include/js/inline.js

editable: true,
droppable: true,
eventOverlap: true,
dayMaxEvents: true,

I need to save my appointment as soon as I drag its location on my calendar or when I change its duration. And I just can't do this. The source of the code, how to achieve this, is here:

https://fullcalendar.io/docs/event-dragging-resizing

Topic drag-drop plugin-events-calendar calendar Wordpress

Category Web


I do agree with @vancoder's advice on editing plugins. That being said, I think you might need to do two things:

  1. Edit the JavaScript to use the eventDrop callback. https://fullcalendar.io/docs/eventDrop
  2. When the callback is fired, is there currently a method to update an event? I see in their documentation that you can allow users to create events, but I didn't see anything for editing. https://wp-events-plugin.com/documentation/user-event-guest-submissions/.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.