Fix the PHP warning in which the null was passed to json_decode (#50661)
* Fix the PHP warning in which the null was passed to json_decode * Add changelog
This commit is contained in:
parent
381c87da80
commit
f1be869ff4
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: tweak
|
||||
|
||||
Product Collection: fix the PHP deprecated warning
|
|
@ -226,7 +226,7 @@ class ProductCollection extends AbstractBlock {
|
|||
'data-wc-navigation-id',
|
||||
'wc-product-collection-' . $this->parsed_block['attrs']['queryId']
|
||||
);
|
||||
$current_context = json_decode( $p->get_attribute( 'data-wc-context' ), true ) ?? [];
|
||||
$current_context = json_decode( $p->get_attribute( 'data-wc-context' ) ?? '{}', true );
|
||||
$p->set_attribute(
|
||||
'data-wc-context',
|
||||
wp_json_encode(
|
||||
|
|
Loading…
Reference in New Issue