Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shameemreza/81d201c24d026ed653144f56005553a0 to your computer and use it in GitHub Desktop.
Save shameemreza/81d201c24d026ed653144f56005553a0 to your computer and use it in GitHub Desktop.
Disable Square API calls in wp-admin when using WooCommerce Square
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