Skip to content

Commit 604890a

Browse files
authored
[N/A] Misc Bug Fixes (#3)
* [#1] Ignore minor version in Tested up to value * [N/A] Fix a bug with tagName not working * [N/A] Fix a bug when 'css' is not returned. * v1.1.1: Version bump and changelog updates
1 parent 33f1774 commit 604890a

File tree

8 files changed

+25
-13
lines changed

8 files changed

+25
-13
lines changed

includes/helpers.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,11 +456,16 @@ function get_core_classes( array $block ): array { // phpcs:ignore
456456
* @return string
457457
*/
458458
function get_core_styles( array $block ): string { // phpcs:ignore
459-
if ( ! empty( $block['style'] ) ) {
460-
$styles = wp_style_engine_get_styles( $block['style'] );
461-
return $styles['css'];
459+
if ( empty( $block['style'] ) || ! function_exists( 'wp_style_engine_get_styles' ) ) {
460+
return '';
461+
}
462+
463+
$styles = wp_style_engine_get_styles( $block['style'] );
464+
465+
if ( empty( $styles['css'] ) ) {
466+
return '';
462467
}
463468

464-
return '';
469+
return $styles['css'];
465470
}
466471
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "viget-blocks-toolkit",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "Custom Block support and button icons.",
55
"author": "Viget",
66
"license": "GPL-2.0-or-later",

packages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"package": {
33
"name": "viget/viget-blocks-toolkit",
4-
"version": "1.1.0",
4+
"version": "1.1.1",
55
"source": {
66
"url": "/root/path/not/relative/path/to/viget-blocks-toolkit/.git",
77
"type": "git",

readme.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Contributors: viget, briandichiara, nathanschmidt
33
Tags: blocks,icons,components,editor,acf
44
Requires at least: 5.7
5-
Tested up to: 6.7.2
6-
Stable tag: 1.1.0
5+
Tested up to: 6.8
6+
Stable tag: 1.1.1
77
Requires PHP: 8.1
88
License: GPLv2 or later
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -30,5 +30,10 @@ No. There are several features of this plugin that can be used without Advanced
3030

3131
== Changelog ==
3232

33+
= 1.1.1 =
34+
* Bumps Tested up to version to 6.8.
35+
* Fixes a bug where the `block.json` `tagName` was not supported correctly.
36+
* Fixes a bug when the core function `wp_style_engine_get_styles` does not return the `css` array key index.
37+
3338
= 1.1.0 =
3439
* Initial Release

src/classes/BlockRegistration.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ function ( array $metadata ): array {
112112
$block['url'] = self::path_to_url( $block['path'] );
113113
}
114114

115+
$block['tagName'] = $metadata['tagName'] ?? 'section';
116+
115117
// Pass the block template data to the block.
116118
$block['template'] = self::get_inner_blocks( $block, $metadata );
117119

views/jsx.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
];
1919
}
2020

21-
$tag = $block['tagName'] ?? 'section';
21+
$tag = $block['tagName'];
2222
$inner = [
2323
'template' => $block['template'] ?? $block_template ?? [],
2424
];

viget-blocks-toolkit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Viget Blocks Toolkit
44
* Plugin URI: https://github.com/vigetlabs/viget-blocks-toolkit
55
* Description: Simplifying Block Registration and other block editor related features.
6-
* Version: 1.1.0
6+
* Version: 1.1.1
77
* Requires at least: 5.7
88
* Requires PHP: 8.1
99
* Author: Viget
@@ -17,7 +17,7 @@
1717
*/
1818

1919
// Plugin version.
20-
const VGTBT_VERSION = '1.1.0';
20+
const VGTBT_VERSION = '1.1.1';
2121

2222
// Plugin path.
2323
define( 'VGTBT_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );

0 commit comments

Comments
 (0)