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

Disable compatibility layer when the WooCommerce Product Grid Block block and WooCommerce Single Product Block are used #8538

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions bin/hook-docs/data/actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1056,9 +1056,14 @@
"file": "Templates/AbstractTemplateCompatibility.php",
"type": "action",
"doc": {
"description": "",
"description": "Action to render the content of a hook.",
"long_description": "",
"tags": [],
"tags": [
{
"name": "since",
"content": "9.5.0"
}
],
"long_description_html": ""
},
"args": 0
Expand Down
20 changes: 12 additions & 8 deletions bin/hook-docs/data/filters.json
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,10 @@
"description": "When extensions implement their equivalent blocks of the template hook functions, they can use this filter to register their old hooked data here, so in the blockified template, the old hooked functions can be removed in favor of the new blocks while keeping the old hooked functions working in classic templates.",
"long_description": "Accepts an array of hooked data. The array should be in the following format: [ [ hook => <hook-name>, function => <function-name>, priority => <priority>, ], ... ] Where: - hook-name is the name of the hook that have the functions hooked to. - function-name is the hooked function name. - priority is the priority of the hooked function.",
"tags": [
{
"name": "since",
"content": "9.5.0"
},
{
"name": "param",
"content": "Additional hooked data. Default to empty",
Expand Down Expand Up @@ -732,11 +736,11 @@
},
{
"name": "woocommerce_disable_compatibility_layer",
"file": "Templates/BlockTemplatesCompatibility.php",
"file": "Templates/AbstractTemplateCompatibility.php",
"type": "filter",
"doc": {
"description": "Filters to disable the compatibility layer for the blockified templates.",
"long_description": "This hooks allows to disable the compatibility layer for the blockified.",
"description": "Filter to disable the compatibility layer for the blockified templates.",
"long_description": "This hook allows to disable the compatibility layer for the blockified.",
"tags": [
{
"name": "since",
Expand All @@ -752,17 +756,17 @@
"variable": ""
}
],
"long_description_html": "<p>This hooks allows to disable the compatibility layer for the blockified.</p>"
"long_description_html": "<p>This hook allows to disable the compatibility layer for the blockified.</p>"
},
"args": 1
},
{
"name": "woocommerce_disable_compatibility_layer",
"file": "Templates/BlockTemplatesCompatibility.php",
"file": "Templates/AbstractTemplateCompatibility.php",
"type": "filter",
"doc": {
"description": "Filters to disable the compatibility layer for the blockified templates.",
"long_description": "This hooks allows to disable the compatibility layer for the blockified.",
"description": "Filter to disable the compatibility layer for the blockified templates.",
"long_description": "This hook allows to disable the compatibility layer for the blockified templates.",
"tags": [
{
"name": "since",
Expand All @@ -778,7 +782,7 @@
"variable": ""
}
],
"long_description_html": "<p>This hooks allows to disable the compatibility layer for the blockified.</p>"
"long_description_html": "<p>This hook allows to disable the compatibility layer for the blockified templates.</p>"
},
"args": 1
},
Expand Down
2 changes: 1 addition & 1 deletion docs/third-party-developers/extensibility/hooks/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ do_action( 'woocommerce_{$product->get_type()}_add_to_cart' )
## {$hook}



Action to render the content of a hook.

```php
do_action( '{$hook}' )
Expand Down
8 changes: 4 additions & 4 deletions docs/third-party-developers/extensibility/hooks/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -582,15 +582,15 @@ apply_filters( 'woocommerce_cart_contents_changed', array $cart_contents )
## woocommerce_disable_compatibility_layer


Filters to disable the compatibility layer for the blockified templates.
Filter to disable the compatibility layer for the blockified templates.

```php
apply_filters( 'woocommerce_disable_compatibility_layer', \Automattic\WooCommerce\Blocks\Templates\boolean. $argument0 )
```

### Description

<p>This hooks allows to disable the compatibility layer for the blockified.</p>
<p>This hook allows to disable the compatibility layer for the blockified.</p>

### Parameters

Expand All @@ -601,8 +601,8 @@ apply_filters( 'woocommerce_disable_compatibility_layer', \Automattic\WooCommerc
### Source


- [Templates/BlockTemplatesCompatibility.php](../../../../src/Templates/BlockTemplatesCompatibility.php)
- [Templates/BlockTemplatesCompatibility.php](../../../../src/Templates/BlockTemplatesCompatibility.php)
- [Templates/AbstractTemplateCompatibility.php](../../../../src/Templates/AbstractTemplateCompatibility.php)
- [Templates/AbstractTemplateCompatibility.php](../../../../src/Templates/AbstractTemplateCompatibility.php)

---

Expand Down
4 changes: 2 additions & 2 deletions src/Templates/AbstractTemplateCompatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ function( $parsed_block, $source_block, $parent_block ) {
'render_block',
function ( $block_content, $block ) {
/**
* Filters to disable the compatibility layer for the blockified templates.
* Filter to disable the compatibility layer for the blockified templates.
*
* This hooks allows to disable the compatibility layer for the blockified.
* This hook allows to disable the compatibility layer for the blockified.
*
* @since TBD
* @param boolean.
Expand Down