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

Commit 320ecbe

Browse files
albarinnielslange
authored andcommitted
Revert "Set inherit default to true only when is inserted in the archive product template (#8251)" (#8352)
This reverts commit 39b0f91.
1 parent f7d784e commit 320ecbe

File tree

2 files changed

+1
-23
lines changed

2 files changed

+1
-23
lines changed

assets/js/blocks/product-query/constants.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ const GLOBAL_HIDE_OUT_OF_STOCK = getSetting< boolean >(
4747
false
4848
);
4949

50-
const isArchiveProductTemplate = getSetting< boolean >(
51-
'is_archive_product_template',
52-
false
53-
);
54-
5550
export const QUERY_DEFAULT_ATTRIBUTES: QueryBlockAttributes = {
5651
allowedControls: DEFAULT_ALLOWED_CONTROLS,
5752
displayLayout: {
@@ -69,7 +64,7 @@ export const QUERY_DEFAULT_ATTRIBUTES: QueryBlockAttributes = {
6964
search: '',
7065
exclude: [],
7166
sticky: '',
72-
inherit: isArchiveProductTemplate,
67+
inherit: false,
7368
__woocommerceAttributes: [],
7469
__woocommerceStockStatus: GLOBAL_HIDE_OUT_OF_STOCK
7570
? Object.keys( objectOmit( STOCK_STATUS_OPTIONS, 'outofstock' ) )

src/BlockTypes/ProductQuery.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -113,23 +113,6 @@ public function update_query( $pre_render, $parsed_block ) {
113113
}
114114
}
115115

116-
/**
117-
* Extra data passed through from server to client for block.
118-
*
119-
* @param array $attributes Any attributes that currently are available from the block.
120-
* Note, this will be empty in the editor context when the block is
121-
* not in the post content on editor load.
122-
*/
123-
protected function enqueue_data( array $attributes = [] ) {
124-
parent::enqueue_data( $attributes );
125-
126-
global $pagenow;
127-
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
128-
$post_id = isset( $_GET['postId'] ) ? sanitize_text_field( wp_unslash( $_GET['postId'] ) ) : null;
129-
$is_archive_product_template = 'site-editor.php' === $pagenow && 'woocommerce/woocommerce//archive-product' === $post_id;
130-
$this->asset_data_registry->add( 'is_archive_product_template', $is_archive_product_template, true );
131-
}
132-
133116
/**
134117
* Update the query for the product query block in Editor.
135118
*

0 commit comments

Comments
 (0)