wp_mail filter does not return filtered strings
|Reported by:||anmari||Owned by:|
|Component:||General||Keywords:||wp_mail, filters, extract|
Firstly, if calling function wp_mail directly, one gets this message:
Warning: extract() [function.extract]: First argument should be an array in pluggable.php line 256
The code is:
extract( apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) ) );
apply filters returns a string with "array" ?, so this code does not appear to work.
Further down the filters are applied again individually for 'wp_mail_from' and 'wp_mail_from_name'
why not apply the wp_mail filters on the subject and body lines there rather?
If I do this, it seems to work.
Change History (4)
- Resolution fixed deleted
- Status changed from closed to reopened