From 6ade0cf011d65f9800335b81778183e3d47d2d7e Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Wed, 27 Jul 2022 14:05:19 +0200 Subject: [PATCH] Update nomenclature --- .../blocks/products/all-products/block.json | 14 ++++++------ src/BlockTypesController.php | 22 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/assets/js/blocks/products/all-products/block.json b/assets/js/blocks/products/all-products/block.json index 3dec50ab5..4bc1ec144 100644 --- a/assets/js/blocks/products/all-products/block.json +++ b/assets/js/blocks/products/all-products/block.json @@ -19,32 +19,32 @@ "attributes": { "columns": { "type": "number", - "frontend": "true" + "public": "true" }, "rows": { "type": "number", - "frontend": "true" + "public": "true" }, "alignButtons": { "type": "boolean", - "frontend": "true" + "public": "true" }, "contentVisibility": { "type": "object", - "frontend": "true" + "public": "true" }, "orderby": { "type": "string", - "frontend": "true" + "public": "true" }, "layoutConfig": { "type": "array", - "frontend": "true" + "public": "true" }, "isPreview": { "type": "boolean", "default": false, - "frontend": "true" + "public": "true" } } } diff --git a/src/BlockTypesController.php b/src/BlockTypesController.php index 7b0a73de1..f1e962dd1 100644 --- a/src/BlockTypesController.php +++ b/src/BlockTypesController.php @@ -142,7 +142,7 @@ function hydration_block_wrapper( $block_content, $block, $instance ) { $attributes = array(); $sourced_attributes = array(); foreach( $attr_definitions as $attr => $definition ) { - if ( ! empty( $definition['frontend'] ) ) { + if ( ! empty( $definition['public'] ) ) { if ( ! empty( $definition['source'] ) ) { $sourced_attributes[ $attr ] = array( "selector" => $definition['selector'], // TODO: Guard against unset. @@ -166,23 +166,23 @@ function hydration_block_wrapper( $block_content, $block, $instance ) { \WP_Block_Supports::$block_to_render = $previous_block_to_render; $block_wrapper = sprintf( - '', + '', esc_attr( $block['blockName'] ), esc_attr( json_encode( $block_type->uses_context ) ), esc_attr( json_encode( $block_type->provides_context ) ), esc_attr( json_encode( $attributes ) ), esc_attr( json_encode( $sourced_attributes ) ), esc_attr( json_encode( $block_supports_attributes ) ) - ) . '%1$s'; + ) . '%1$s'; - $template_wrapper = ''; + $template_wrapper = ''; $empty_template = sprintf( $template_wrapper, '' ); $template = sprintf( $template_wrapper, sprintf( $block_wrapper, $block_content . $empty_template ) );