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

Commit dda1d37

Browse files
authored
Fix fatal with 1.x versions of the feature plugin (#502)
* Add plugin version check to prevent fatal error with core + 1.4 * Version bump
1 parent 0fc83ef commit dda1d37

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

assets/php/class-wgpb-block-library.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ public static function get_instance() {
3737
* Constructor.
3838
*/
3939
public function __construct() {
40+
// Shortcut out if we see the feature plugin, v1.4 or below.
41+
// note: `FP_VERSION` is transformed to `WGPB_VERSION` in the grunt copy task.
42+
if ( defined( 'FP_VERSION' ) && version_compare( FP_VERSION, '1.4.0', '<=' ) ) {
43+
return;
44+
}
4045
if ( function_exists( 'register_block_type' ) ) {
4146
add_action( 'init', array( 'WGPB_Block_Library', 'register_blocks' ) );
4247
add_action( 'init', array( 'WGPB_Block_Library', 'register_assets' ) );

package-lock.json

Lines changed: 1 addition & 1 deletion
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
@@ -2,7 +2,7 @@
22
"name": "@woocommerce/block-library",
33
"title": "WooCommerce Blocks",
44
"author": "Automattic",
5-
"version": "2.0.0-rc1",
5+
"version": "2.0.0-rc2",
66
"description": "WooCommerce blocks for the Gutenberg editor.",
77
"homepage": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/",
88
"keywords": [

woocommerce-gutenberg-products-block.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: WooCommerce Blocks
44
* Plugin URI: https://github.com/woocommerce/woocommerce-gutenberg-products-block
55
* Description: WooCommerce blocks for the Gutenberg editor.
6-
* Version: 2.0.0-rc1
6+
* Version: 2.0.0-rc2
77
* Author: Automattic
88
* Author URI: https://woocommerce.com
99
* Text Domain: woo-gutenberg-products-block
@@ -15,7 +15,7 @@
1515

1616
defined( 'ABSPATH' ) || die();
1717

18-
define( 'WGPB_VERSION', '2.0.0-rc1' );
18+
define( 'WGPB_VERSION', '2.0.0-rc2' );
1919
define( 'WGPB_PLUGIN_FILE', __FILE__ );
2020
define( 'WGPB_ABSPATH', dirname( WGPB_PLUGIN_FILE ) . '/' );
2121

0 commit comments

Comments
 (0)