Skip to content
This repository was archived by the owner on Oct 4, 2019. It is now read-only.

Commit 9c11c40

Browse files
author
Allen Snook
committed
Change to testing the request uri since REST_REQUEST isn't yet available
when this filter gets run
1 parent 647a3e0 commit 9c11c40

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hotfixes/wc-api-dev-jetpack-hotfixes.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
*/
2323

2424
function wc_api_dev_jetpack_sync_sender_should_load( $sender_should_load ) {
25-
if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
25+
$starts_with = '/wp-json/wc/v';
26+
if ( $starts_with === substr( $_SERVER[ 'REQUEST_URI' ], 0, strlen( $starts_with ) ) ) {
2627
$sender_should_load = false;
2728
}
2829

0 commit comments

Comments
 (0)