Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions includes/subscriptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,39 @@ function send_notifications( $post ) {
$update_subscriptions = true;

wp_delete_post( $subscription_id, true );

/**
* Fires after Distributor pushes a post subscription
*
* @since TBD
* @hook dt_after_set_meta
*
* @param {int} $post_id Post ID
* @param {int} $subscription_id Subscription ID
* @param {array} $request Request array
*/
do_action( 'dt_subscription_after_post_push', $post_id, $subscription_id, $request );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the status is currently failure at this point, should we consider tweaking the filter name to reflect this?

}


}

}

if ( $update_subscriptions ) {
update_post_meta( $post_id, 'dt_subscriptions', $subscriptions );
}

/**
* Fires after Distributor completes all subscriptions regardless of success/failure
*
* @since TBD
* @hook dt_after_set_meta
*
* @param {int} $post_id Post ID
* @param {array} $subscriptions Array of Subscriptions
*/
do_action( 'dt_subscriptions_after_post_push', $post_id, $subscriptions );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also include $update_subscriptions as a third parameter so users can be informed of the success or failure status?

}

/**
Expand Down