Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Don't try to load cart instance in API requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Aljullu committed Aug 16, 2021
1 parent aec1de9 commit c93cc4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/BlockTypes/MiniCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ protected function render( $attributes, $content ) {
* @return string The HTML markup.
*/
protected function get_markup() {
if ( is_admin() ) {
if ( is_admin() || WC()->is_rest_api_request() ) {
// In the editor we will display the placeholder, so no need to load
// real cart data and to print the markup.
return '';
Expand Down

0 comments on commit c93cc4d

Please sign in to comment.