-
Notifications
You must be signed in to change notification settings - Fork 51
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
Add missing hooks #55
base: master
Are you sure you want to change the base?
Conversation
// Compact the input and apply the filters | ||
$atts = apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) ); | ||
|
||
$pre_wp_mail = apply_filters( 'pre_wp_mail', null, $atts ); |
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.
Does core fire the pre_ hook after the wp_mail hook? Seems maybe the wrong way around
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.
This is still subject to testing to confirm everything is correct, but yes it does: https://github.com/WordPress/wordpress-develop/blob/f58f64587b221f5fade3b8d0a4163a08eb041ed9/src/wp-includes/pluggable.php#L177-L214
Fixes #54 by adding missing filters and actions that have been added to the core
wp_mail()
pluggable function since this package was originally built.The minimum PHP version bump is so we can use
list()
with keys instead ofextract()
.Refs:
wp_mail
andpre_wp_mail
: https://github.com/WordPress/wordpress-develop/blob/a4a4f3a1dc68d84e2f3d24c8c9951ae962c6860d/src/wp-includes/pluggable.php#L175-L214wp_mail_failed
: https://github.com/WordPress/wordpress-develop/blob/a4a4f3a1dc68d84e2f3d24c8c9951ae962c6860d/src/wp-includes/pluggable.php#L573-L581wp_mail_succeeded
: https://github.com/WordPress/wordpress-develop/blob/a4a4f3a1dc68d84e2f3d24c8c9951ae962c6860d/src/wp-includes/pluggable.php#L548-L567