Merge pull request #442 from woocommerce/pcp-501-wp-doing-ajax

Use wp_doing_ajax instead of is_ajax
This commit is contained in:
Alex Pantechovskis 2022-01-18 16:31:01 +02:00 committed by GitHub
commit 29fe7ee559
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -59,7 +59,7 @@ class SettingsPageAssets {
add_action( add_action(
'admin_enqueue_scripts', 'admin_enqueue_scripts',
function() use ( $bearer ) { function() use ( $bearer ) {
if ( ! is_admin() || is_ajax() ) { if ( ! is_admin() || wp_doing_ajax() ) {
return; return;
} }

View file

@ -19,7 +19,7 @@ class SettingsPagesAssetsTest extends TestCase
when('is_admin') when('is_admin')
->justReturn(true); ->justReturn(true);
when('is_ajax') when('wp_doing_ajax')
->justReturn(false); ->justReturn(false);
$testee->register_assets(); $testee->register_assets();