Skip to content

Commit e93ad25

Browse files
committed
use wp_doing_ajax() instead of checking for global constant (#35)
The function is available since WP 4.7, so we could have been using it since v1.2. It defaults to the same logic but applies an additional filter internally.
1 parent 7beb003 commit e93ad25

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

includes/class-scliveticker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static function init(): void {
7676
add_filter( 'rest_scliveticker_tick_query', array( 'SCLiveticker\\Api', 'tick_query_filter' ), 10, 2 );
7777

7878
// Skip on AJAX if not enabled.
79-
if ( ( ! isset( self::$options['enable_ajax'] ) || 1 !== self::$options['enable_ajax'] ) && ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
79+
if ( ( ! isset( self::$options['enable_ajax'] ) || 1 !== self::$options['enable_ajax'] ) && wp_doing_ajax() ) {
8080
return;
8181
}
8282

0 commit comments

Comments
 (0)