Skip to content

Commit

Permalink
delete transactions when an order is deleted, per #263
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasplevy committed Oct 3, 2018
1 parent 54a3146 commit 046c3dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -17,6 +17,7 @@ v3.24.0 - 2018-09-??

##### Bug fixes

+ When an order is deleted, all order transactions will also be deleted. This does not happen until the order is deleted (transactions will remain while the order is in the trash)
+ Fixed an issue causing duplicated quizzes to initially show images for question images & image choices (reorder pictures & picture choice) but the image data would not be properly saved so when returning to the builder or viewing a quiz on the frontend the images would be lost


Expand Down
12 changes: 10 additions & 2 deletions includes/class.llms.post.relationships.php
@@ -1,10 +1,10 @@
<?php
if ( ! defined( 'ABSPATH' ) ) { exit; }
defined( 'ABSPATH' ) || exit;

/**
* Hooks and actions related to post relationships
* @since 3.16.12
* @version 3.16.12
* @version [version]
*/
class LLMS_Post_Relationships {

Expand All @@ -28,6 +28,14 @@ class LLMS_Post_Relationships {
),
),

'llms_order' => array(
array(
'action' => 'delete',
'meta_key' => '_llms_order_id',
'post_type' => 'llms_transaction',
),
),

'llms_quiz' => array(
array(
'action' => 'delete', // delete = force delete; trash = move to trash
Expand Down

0 comments on commit 046c3dc

Please sign in to comment.