Skip to content
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

Merged
merged 4 commits into from
Jan 20, 2021
Merged

Add filter to allow ajax calls #355

merged 4 commits into from
Jan 20, 2021

Conversation

Zodiac1978
Copy link
Member

To allow ajaxified comments, this adds a filter to allow ajax calls if necessary

To allow ajaxified comments, this adds a filter to allow ajax calls if necessary
@Zodiac1978 Zodiac1978 linked an issue Oct 1, 2020 that may be closed by this pull request
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 );
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow creation of comment form via ajax
3 participants