[wp-trac] [WordPress Trac] #33735: Reduce Duplication and Improve Comment Notification Email Functions
WordPress Trac
noreply at wordpress.org
Sun Nov 3 16:51:02 UTC 2019
#33735: Reduce Duplication and Improve Comment Notification Email Functions
-------------------------------------------------+-------------------------
Reporter: dshanske | Owner:
| SergeyBiryukov
Type: enhancement | Status: reviewing
Priority: low | Milestone: 5.4
Component: Comments | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests dev- | Focuses:
feedback needs-refresh |
-------------------------------------------------+-------------------------
Changes (by dshanske):
* milestone: Future Release => 5.4
Comment:
I haven't done much Core work in a while, but wanted to revisit a few of
my failed attempts. I tried to address the issues here.
The goal of this is multi-faceted and remains unchanged.
wp_notify_moderator and wp_notify_postauthor are long and duplicative. I
tried to address the old feedback by @birgire but I think I need some
more people looking at this mater.
A few issues are noticeable regardless of complexity. In order to add more
data, such as comment meta, to the email, you have to completely rewrite
the output from both functions. In order to cover custom comment types,
accepting such things aren't officially supported in core...you have to
rewrite the entire output from both functions.
I'd love to solve this in future by supporting comment type registration,
with callbacks for each function like this, but there is no extensive work
being done on comments right now. This addresses the issue.
The code in question also adds in calls to the existing comment filters,
which allows for additional flexibility if you are already filtering
comment text or such,
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33735#comment:35>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list