Skip to content

Commit

Permalink
Make API url function work when permalinks are not pretty
Browse files Browse the repository at this point in the history
@coenjacobs for .14 too
  • Loading branch information
mikejolley committed Aug 23, 2013
1 parent fdbaac0 commit 5efb976
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,11 @@ public function api_request_url( $request, $ssl = null ) {
$scheme = 'http';
}

return esc_url_raw( trailingslashit( home_url( '/wc-api/' . $request, $scheme ) ) );
if ( get_option('permalink_structure') ) {
return esc_url_raw( trailingslashit( home_url( '/wc-api/' . $request, $scheme ) ) );
} else {
return esc_url_raw( add_query_arg( 'wc-api', $request, trailingslashit( home_url( '', $scheme ) ) ) );
}
}


Expand Down

0 comments on commit 5efb976

Please sign in to comment.