fix(WP): release 1.12

This commit is contained in:
lesion 2024-04-28 23:58:01 +02:00
parent c9c2cf7624
commit b40bef4fea
No known key found for this signature in database
GPG key ID: 352918250B012177
3 changed files with 7 additions and 17 deletions

View file

@ -3,7 +3,7 @@
Plugin Name: WPGancio
Plugin URI: https://gancio.org
Description: Connects an user of a gancio instance to a Wordpress user so that published events are automatically pushed with Gancio API.
Version: 1.10
Version: 1.12
Author: Gancio
License: AGPL 3.0

View file

@ -8,10 +8,8 @@ add_action('eventorganiser_save_event', 'wpgancio_eo_save_event', 15);
function wpgancio_eo_save_event ($post_id) {
$event = get_post( $post_id );
printf(eo_get_share($post_id));
// do not save if it's a draft
if ($event->post_status != 'publish' || !eo_get_share($post_id) ) {
printf("This event shouldn't be shared");
if ($event->post_status != 'publish') {
return;
}
@ -25,16 +23,12 @@ function wpgancio_eo_save_event ($post_id) {
$tags = array_map('tagName', $tmp_tags);
}
$gancio_id = get_post_meta($post_id, 'wpgancio_gancio_id', TRUE);
$start_datetime = eo_get_schedule_start( 'U', $post_id );
// get place details
$venue_id = eo_get_venue($post_id);
$place_name = eo_get_venue_name($venue_id);
$place_address = eo_get_venue_address($venue_id);
$instance_url = get_option('wpgancio_instance_url') ?: get_site_option('wpgancio_instance_url');
$body = array (
'title' => $event->post_title,
@ -52,9 +46,6 @@ function wpgancio_eo_save_event ($post_id) {
}
wpgancio_send_event_to_instance($body, $post_id);
set_transient("wpgancio_message_{$post_id}", "Event updated. <a href='{$event_url}'>{$event_url}</a>");
update_post_meta($post_id, 'wpgancio_gancio_id', intval($data->id));
}
add_action('wp_trash_post', 'wpgancio_eo_delete_post', 15);
@ -100,10 +91,6 @@ function wpgancio_tec_save_event($post_id) {
$tags = array_map('tagName', $tmp_tags);
}
// gancio instance details
$gancio_id = get_post_meta($post_id, 'wpgancio_gancio_id', TRUE);
$instance_url = get_option('wpgancio_instance_url') ?: get_site_option('wpgancio_instance_url');
// get the event start time
// the timestamp generated byt the plugin function is 2h shifted, substract 7200 s --> 2h
$start_datetime = strtotime(tribe_get_start_date( $event, true, Tribe__Date_Utils::DBDATETIMEFORMAT )) - 7200;

View file

@ -3,8 +3,8 @@ Contributors: lesion, nutria
Donate link: https://gancio.org
Tags: events, gancio, fediverse, AP, activity pub
Requires at least: 4.7
Tested up to: 6.4
Stable tag: 1.10
Tested up to: 6.5
Stable tag: 1.12
Requires PHP: 7.0
License: AGPLv3 or later
License URI: https://www.gnu.org/licenses/agpl-3.0.html
@ -19,6 +19,9 @@ for this to work an event manager plugin is required, [Event Organiser](https://
== Changelog ==
= 1.12 =
* Restore Event Organizer functionality
= 1.11 =
* Add support to The Events Calendar WordPress plugin