Skip to content

Commit

Permalink
Update nomenclature
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed Jul 27, 2022
1 parent 90a87ed commit 6ade0cf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
14 changes: 7 additions & 7 deletions assets/js/blocks/products/all-products/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
22 changes: 11 additions & 11 deletions src/BlockTypesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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(
'<gutenberg-interactive-block ' .
'data-gutenberg-block-type="%1$s" ' .
'data-gutenberg-uses-block-context="%2$s" ' .
'data-gutenberg-provides-block-context="%3$s" ' .
'data-gutenberg-attributes="%4$s" ' .
'data-gutenberg-sourced-attributes="%5$s" ' .
'data-gutenberg-block-props="%6$s" ' .
'data-gutenberg-hydrate="idle">',
'<wp-block ' .
'data-wp-block-type="%1$s" ' .
'data-wp-block-uses-block-context="%2$s" ' .
'data-wp-block-provides-block-context="%3$s" ' .
'data-wp-block-attributes="%4$s" ' .
'data-wp-block-sourced-attributes="%5$s" ' .
'data-wp-block-props="%6$s" ' .
'data-wp-block-hydration="idle">',
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</gutenberg-interactive-block>';
) . '%1$s</wp-block>';

$template_wrapper = '<template class="gutenberg-inner-blocks">%1$s</template>';
$template_wrapper = '<template class="wp-inner-blocks">%1$s</template>';

$empty_template = sprintf( $template_wrapper, '' );
$template = sprintf( $template_wrapper, sprintf( $block_wrapper, $block_content . $empty_template ) );
Expand Down

0 comments on commit 6ade0cf

Please sign in to comment.