WordPress 7.1 changes when wp_new_comment_notify_postauthor() checks a comment’s approval status: the check now happens before the notify_post_author filter is applied, rather than after. As a result, the filter receives an accurate default value, and its return value fully determines whether a notification is sent. See #64217.

Previous behavior

The filter received a default derived only from the comments_notify option (or the wp_notes_notify option for notes). The comment’s approval status was checked after the filter ran, which had two consequences:

The filter received a misleading default of true for unapproved comments whenever the option was enabled, even though no notification would be sent. Returning true from the filter could not force a notification for an unapproved comment

Click here to continue reading this article.