mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
fix(WP): release 1.12
This commit is contained in:
parent
c9c2cf7624
commit
b40bef4fea
3 changed files with 7 additions and 17 deletions
|
@ -3,7 +3,7 @@
|
||||||
Plugin Name: WPGancio
|
Plugin Name: WPGancio
|
||||||
Plugin URI: https://gancio.org
|
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.
|
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
|
Author: Gancio
|
||||||
License: AGPL 3.0
|
License: AGPL 3.0
|
||||||
|
|
||||||
|
|
|
@ -8,10 +8,8 @@ add_action('eventorganiser_save_event', 'wpgancio_eo_save_event', 15);
|
||||||
function wpgancio_eo_save_event ($post_id) {
|
function wpgancio_eo_save_event ($post_id) {
|
||||||
$event = get_post( $post_id );
|
$event = get_post( $post_id );
|
||||||
|
|
||||||
printf(eo_get_share($post_id));
|
|
||||||
// do not save if it's a draft
|
// do not save if it's a draft
|
||||||
if ($event->post_status != 'publish' || !eo_get_share($post_id) ) {
|
if ($event->post_status != 'publish') {
|
||||||
printf("This event shouldn't be shared");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,16 +23,12 @@ function wpgancio_eo_save_event ($post_id) {
|
||||||
$tags = array_map('tagName', $tmp_tags);
|
$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 );
|
$start_datetime = eo_get_schedule_start( 'U', $post_id );
|
||||||
|
|
||||||
// get place details
|
// get place details
|
||||||
$venue_id = eo_get_venue($post_id);
|
$venue_id = eo_get_venue($post_id);
|
||||||
$place_name = eo_get_venue_name($venue_id);
|
$place_name = eo_get_venue_name($venue_id);
|
||||||
$place_address = eo_get_venue_address($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 (
|
$body = array (
|
||||||
'title' => $event->post_title,
|
'title' => $event->post_title,
|
||||||
|
@ -52,9 +46,6 @@ function wpgancio_eo_save_event ($post_id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
wpgancio_send_event_to_instance($body, $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);
|
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);
|
$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
|
// get the event start time
|
||||||
// the timestamp generated byt the plugin function is 2h shifted, substract 7200 s --> 2h
|
// 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;
|
$start_datetime = strtotime(tribe_get_start_date( $event, true, Tribe__Date_Utils::DBDATETIMEFORMAT )) - 7200;
|
||||||
|
|
|
@ -3,8 +3,8 @@ Contributors: lesion, nutria
|
||||||
Donate link: https://gancio.org
|
Donate link: https://gancio.org
|
||||||
Tags: events, gancio, fediverse, AP, activity pub
|
Tags: events, gancio, fediverse, AP, activity pub
|
||||||
Requires at least: 4.7
|
Requires at least: 4.7
|
||||||
Tested up to: 6.4
|
Tested up to: 6.5
|
||||||
Stable tag: 1.10
|
Stable tag: 1.12
|
||||||
Requires PHP: 7.0
|
Requires PHP: 7.0
|
||||||
License: AGPLv3 or later
|
License: AGPLv3 or later
|
||||||
License URI: https://www.gnu.org/licenses/agpl-3.0.html
|
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 ==
|
== Changelog ==
|
||||||
|
|
||||||
|
= 1.12 =
|
||||||
|
* Restore Event Organizer functionality
|
||||||
|
|
||||||
= 1.11 =
|
= 1.11 =
|
||||||
* Add support to The Events Calendar WordPress plugin
|
* Add support to The Events Calendar WordPress plugin
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue