admin管理员组

文章数量:1287488

Plugin: /

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:

Plugin: https://wordpress/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

Share Improve this question asked Oct 12, 2021 at 17:25 Jičínský RumcajsJičínský Rumcajs 111 bronze badge 1
  • Third-party plugins are out of scope here, but in general I would advise you not to edit plugins. As soon as a security update is applied, your changes are overwritten. – vancoder Commented Oct 12, 2021 at 21:00
Add a comment  | 

1 Answer 1

Reset to default 0

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/documentation/user-event-guest-submissions/.

本文标签: calendarSave event change in WP Fullcalendar editabledraggable