Make WordPress Core
Read post

author filter now has the final say on post author notifications – Make WordPress Core

WordPress 7.1 changes the order of operations in `wp_new_comment_notify_postauthor()`: the comment approval status check now runs before the `notify_post_author` filter fires, not after. This means the filter receives an accurate boolean default and its return value is now authoritative. Previously, returning `true` from the filter could not force notifications for unapproved comments, and the filter received misleading defaults. Now, returning `true` will send notifications even for unapproved, spam, or trashed comments. Sites using `__return_true` on this filter should update their callbacks to check approval status if they don't want emails for non-approved comments. Additional changes include the default always being a strict boolean and the function returning `false` immediately for invalid comment IDs without firing the filter.

    #php#wordpress
Yesterday•3m read time•From make.wordpress.org
Post cover image
Table of contents
Share this:
7.7K Impressions
Make WordPress Core's image
Make WordPress Core

WordPressCore's platform is a central hub for WordPress developers and contributors, offering insigh...

425 Followers

•

1.4K Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard