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

Commit

Permalink
Update comments with better wording
Browse files Browse the repository at this point in the history
  • Loading branch information
ralucaStan committed Apr 12, 2022
1 parent 921edda commit d859d9d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/BlockTypes/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ protected function render( $attributes, $content ) {
wp_dequeue_style( 'select2' );

/**
* We need to check if $content has any templates from prior iterations of the block, in order to update to the latest iteration
* When testing for inner blocks presence, only test for blocks with the locked:{remove:true} attribute.
* We need to check if $content has any templates from prior iterations of the block, in order to update to the latest iteration.
* We test the iteration version by searching for new blocks brought in by it.
* The blocks used for testing should be always available in the block (not removable by the user).
*/

$regex_for_filled_cart_block = '/<div[\n\r\s\ta-zA-Z0-9_\-=\'"]*data-block-name="woocommerce\/filled-cart-block"[\n\r\s\ta-zA-Z0-9_\-=\'"]*>/mi';
Expand Down
4 changes: 3 additions & 1 deletion src/BlockTypes/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ protected function render( $attributes, $content ) {
wp_dequeue_style( 'select2' );

/**
* We need to check if $content has any templates from prior iterations of the block, in order to update to the latest iteration
* We need to check if $content has any templates from prior iterations of the block, in order to update to the latest iteration.
* We test the iteration version by searching for new blocks brought in by it.
* The blocks used for testing should be always available in the block (not removable by the user).
* Checkout i1's content was returning an empty div, with no data-block-name attribute
*/
$regex_for_empty_block = '/<div class="[a-zA-Z0-9_\- ]*wp-block-woocommerce-checkout[a-zA-Z0-9_\- ]*"><\/div>/mi';
Expand Down

0 comments on commit d859d9d

Please sign in to comment.