Skip to content

Commit

Permalink
fix: add check for AJAX and autosave from v2, refs #500
Browse files Browse the repository at this point in the history
  • Loading branch information
florianbrinkmann committed Jun 2, 2023
1 parent 697133b commit fba065b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@
* Init function of the plugin
*/
function init() {
$disallow_ajax = apply_filters( 'antispam_bee_disallow_ajax_calls', true );

if ( defined( 'DOING_AJAX' ) && DOING_AJAX && $disallow_ajax ) {
return;
}

if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
return;
}

// Construct all modules to initialize.
$modules = array(
DashboardWidgets::class,
Expand Down

0 comments on commit fba065b

Please sign in to comment.