-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add filter to allow ajax calls #355
Conversation
To allow ajaxified comments, this adds a filter to allow ajax calls if necessary
Fixed wrongly named filter
@@ -119,7 +119,13 @@ public static function init() { | |||
) | |||
); | |||
|
|||
if ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) ) { | |||
$disallow_ajax = apply_filters( 'antispam_bee_disallow_ajax_calls', true ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer using the positive phrasing: $allow_ajax = apply_filters( 'antispam_bee_allow_ajax_calls', false );
It might be confusing to use true
to disable something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was easier to make it this way, but I get your point.
My second thought was, "true" for default seems better than false. But I'm fine with changing the logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also valid... I approved it, because it is really a personal thing...
To allow ajaxified comments, this adds a filter to allow ajax calls if necessary