-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(#524): Add hooks for subscription(s) post push #1043
base: develop
Are you sure you want to change the base?
Conversation
This feature adds to hooks for dt_subscription_after_post_push and dt_subscriptions_after_post_push to be able to take action after a subscribed post has been pushed and after the entire set of subscriptions have been pushed
I can review this draft request and the 2.0 project to make sure this is still accurate. It's been a while since I looked at this |
@aaronware are you interested in continuing the extension work here (assuming primarily for deeper Woo support)? |
@jeffpaul yes definitely. Now that 2.x has been out in the wild I can revisit. My apprehension before and why I drafted this was adding to the 1.9.x branch when so much was changing in 2.x. There are some quick wins to add hooks like what I drafted, however, I wasn't sure if you all wanted something more structured when integrating with Distributor for other plugins similar to Steam for example |
* @param {int} $post_id Post ID | ||
* @param {array} $subscriptions Array of Subscriptions | ||
*/ | ||
do_action( 'dt_subscriptions_after_post_push', $post_id, $subscriptions ); |
There was a problem hiding this comment.
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?
* @param {int} $subscription_id Subscription ID | ||
* @param {array} $request Request array | ||
*/ | ||
do_action( 'dt_subscription_after_post_push', $post_id, $subscription_id, $request ); |
There was a problem hiding this comment.
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?
Description of the Change
This feature adds to hooks for to subscriptions.php
dt_subscription_after_post_push
anddt_subscriptions_after_post_push
to be able to take action after a post has been pushed to a subscription and after the entire set of subscriptions have been pushed regardless of success or failure.These hooks are not nearly as robust as
dt_push_post
as I tried to keep the change as slim as possible.Closes #524 (as potentially stale issue or could be considered a separate issue)
How to test the Change
utilize
Changelog Entry
Credits
Props @aaronware,
Checklist: