Skip to content

Commit

Permalink
Fixed bug with user used during subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
antonio-goncalves-unp committed Aug 29, 2024
1 parent 6ec8510 commit f2eb9f2
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Plugin Name: IoT Catalogue Integration
* Description: Display in WordPress content from IoT Catalogue
* Version: 1.10.2
* Version: 1.10.3
* Author: UNPARALLEL Innovation, Lda
* Author URI: https://www.unparallel.pt
*/
Expand Down Expand Up @@ -45,10 +45,15 @@ function send_async_subscribe() {
if($current_subscription == false) {
return;
}
$current_subscription -> get_data();
iotcat_log_me("Data synchronized");
$interval = intval($iotcat_field_data_update_interval)*60;
as_schedule_single_action(time() + $interval ,'async_subscribe', array() );
$user_id = get_option("iotcat_plugin_admin_user_id");
if($user_id > 0){
wp_set_current_user($user_id);
$current_subscription -> get_data();
iotcat_log_me("Data synchronized");
$interval = intval($iotcat_field_data_update_interval)*60;
as_schedule_single_action(time() + $interval ,'async_subscribe', array() );
}

}


Expand Down

0 comments on commit f2eb9f2

Please sign in to comment.