Skip to content

Commit

Permalink
Update to add hook if it's not AJAX
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahmon committed Oct 14, 2021
1 parent 1ecc579 commit bce6f63
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions includes/classes/Features.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ class Features {
* @since 2.1
*/
public function setup() {
// hooks order matters, make sure feature activation goes before features setup
add_action( 'admin_init', array( $this, 'handle_feature_activation' ), 0 );
add_action( 'admin_init', array( $this, 'setup_features' ), 0 );

if ( ! wp_doing_ajax() ) {
// hooks order matters, make sure feature activation goes before features setup
add_action( 'admin_init', array( $this, 'handle_feature_activation' ), 0 );
add_action( 'admin_init', array( $this, 'setup_features' ), 0 );
}
}

/**
Expand Down

0 comments on commit bce6f63

Please sign in to comment.