Created
July 7, 2024 14:51
-
-
Save shameemreza/81d201c24d026ed653144f56005553a0 to your computer and use it in GitHub Desktop.
Disable Square API calls in wp-admin when using WooCommerce Square
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'pre_http_request', 'sport_shooting_depot_mock_square_background_check', 10, 3 ); | |
function sport_shooting_depot_mock_square_background_check( $preemt, $args, $url ) { | |
if ( $url !== 'YOUR_SITE_URL_HERE/wp-admin/admin-ajax.php?action=wc_square_background_sync_test' ) { | |
return false; | |
} | |
return array( | |
'body' => '[TEST_LOOPBACK]', | |
'response' => array( | |
'code' => '200 OK' | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment