[wp-trac] [WordPress Trac] #36901: Removing wp_die() from wp_allow_comment()
WordPress Trac
noreply at wordpress.org
Sat Oct 1 02:48:48 UTC 2016
#36901: Removing wp_die() from wp_allow_comment()
-------------------------------------------------+-------------------------
Reporter: websupporter | Owner:
Type: enhancement | rachelbaker
Priority: normal | Status: assigned
Component: Comments | Milestone: 4.7
Severity: normal | Version: 4.6
Keywords: has-patch needs-testing has-unit- | Resolution:
tests | Focuses:
-------------------------------------------------+-------------------------
Comment (by boonebgorges):
> Call the check_comment_flood_db() function directly from within
wp_allow_comment() instead of adding a wrapper function or filter.
@boonebgorges any back-compat concerns here that I am missed?
Yes, I think so. I've done the following on client sites:
{{{
remove_action( 'check_comment_flood', 'check_comment_flood_db' );
add_action( 'check_comment_flood', 'my_own_version' );
}}}
Pretty much what @websupporter lays out in [comment:15 his last comment].
(BTW, thanks for digging into the logs :) )
[attachment:36901.2.diff] is an ugly attempt at back compat for this
usage, but I think it works. Briefly: we continue to `add_action(
'check_comment_flood', 'check_comment_flood_db' );`. But
`check_comment_flood_db()` is now just a wrapper for an `add_filter()`
call, which attaches the *actual* comment flood checking function to the
new `wp_is_comment_flood` filter. (Phew.)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36901#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list