| | |
| | | add_action('before_delete_post', [$this, 'cleanupPostFavourites']); |
| | | add_action('delete_term', [$this, 'cleanupTermFavourites'], 10, 3); |
| | | |
| | | add_action('jvbUserRegistered', [$this, 'maybeAcceptListInvite'], 10, 3); |
| | | |
| | | // Register cleanup scheduler |
| | | add_action('jvb_cleanupOrphanedFavourites', [$this, 'cleanupOrphanedFavourites']); |
| | |
| | | $by_type[$type][] = (int)$fav->target_id; |
| | | } |
| | | |
| | | $response_data = [ |
| | | return [ |
| | | 'success' => true, |
| | | 'items' => $by_type, |
| | | 'has_more' => false, |
| | | ]; |
| | | |
| | | return $response_data; |
| | | |
| | | } catch (Exception $e) { |
| | | $this->logError( |
| | | $e->getMessage(), |
| | |
| | | $list_name, |
| | | $inviteButton, |
| | | $inviteUrl, |
| | | jvbSignature() |
| | | JVB()->email()->signature() |
| | | ); |
| | | |
| | | return jvbMail($email, $subject, $message); |
| | | return JVB()->email()->sendEmail($email, $subject, $message); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | |
| | | public function maybeAcceptListInvite(int $user_id, string $email, array $data):void |
| | | { |
| | | if (array_key_exists('list_token', $data) && !empty($data['list_token'])) { |
| | | $this->acceptListInvitation($data['list_token'], $email); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Get the owner ID for a content item |
| | | * |