• So I am having issues as we have a custom frontend to create events sometimes the event_rsvp_date is saved as the first day of the event and not the end date.
    I am trying to understand if with a hook/filter I can force a specific date to ignore the data saved in the post type.

    Reading the plugin code I was not able to find a filter for this.
    Do you have any suggestions?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    you can try to edit and modify the template file at events-manager/templates/forms/event-editor.php

    to use templates: https://wp-events-plugin.com/documentation/using-template-files/

    eg. wp-content/themes/Your Theme/plugins/events-manager/forms/event-editor.php

    Yeah I got that part but is not clear how I can define from here the date for that parameter.
    I was hoping that there is something on server side that I can execute for all the events not just the new one that will created with that parameter.
    I need to act also on old events not just the new one and editing the editor is not helping in this.

    // em-event.php 585: apply_filters( 'em_event_load_postdata', $this );
    add_filter( 'em_event_load_postdata', 'mozilla_force_rsvp_end', 10, 2 );
    function mozilla_force_rsvp_end( $event ) {
    	$event->event_rsvp_date = $event->event_end_date;
    	return $event;
    }

    So I modded the plugin in this way to change the value after the SQL query as this is the value used and not the post_meta.

    I hope that a filter on load_postdata is added.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Force a specific event_rsvp_date with an hook’ is closed to new replies.