Skip to content

Commit

Permalink
= 4.0.9 =
Browse files Browse the repository at this point in the history
~ Added: hook learn-press/order/before-delete.
  • Loading branch information
tungnxt89 committed Apr 11, 2024
1 parent 4f0ee46 commit 04dfcd7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion inc/class-lp-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public function update( $new_instance, $old_instance ) {

switch ( $setting['type'] ) {
case 'number':
$instance[ $key ] = absint( $new_instance[ $key ] );
$instance[ $key ] = absint( $new_instance[ $key ] ?? '' );

if ( isset( $setting['min'] ) && '' !== $setting['min'] ) {
$instance[ $key ] = max( $instance[ $key ], $setting['min'] );
Expand Down
2 changes: 2 additions & 0 deletions inc/custom-post-types/order.php
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,8 @@ public function before_delete( int $order_id ) {

$lp_user_items_db->delete_user_items_old( $user_id, $course_id );
}

do_action( 'learn-press/order/before-delete', $order, $user_id );
}

// Delete lp_order_item, lp_order_itemmeta
Expand Down

0 comments on commit 04dfcd7

Please sign in to comment.