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

Commit

Permalink
Fix fatal with 1.x versions of the feature plugin (#502)
Browse files Browse the repository at this point in the history
* Add plugin version check to prevent fatal error with core + 1.4

* Version bump
  • Loading branch information
ryelle authored Mar 22, 2019
1 parent 0fc83ef commit dda1d37
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions assets/php/class-wgpb-block-library.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ public static function get_instance() {
* Constructor.
*/
public function __construct() {
// Shortcut out if we see the feature plugin, v1.4 or below.
// note: `FP_VERSION` is transformed to `WGPB_VERSION` in the grunt copy task.
if ( defined( 'FP_VERSION' ) && version_compare( FP_VERSION, '1.4.0', '<=' ) ) {
return;
}
if ( function_exists( 'register_block_type' ) ) {
add_action( 'init', array( 'WGPB_Block_Library', 'register_blocks' ) );
add_action( 'init', array( 'WGPB_Block_Library', 'register_assets' ) );
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@woocommerce/block-library",
"title": "WooCommerce Blocks",
"author": "Automattic",
"version": "2.0.0-rc1",
"version": "2.0.0-rc2",
"description": "WooCommerce blocks for the Gutenberg editor.",
"homepage": "https://github.com/woocommerce/woocommerce-gutenberg-products-block/",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions woocommerce-gutenberg-products-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: WooCommerce Blocks
* Plugin URI: https://github.com/woocommerce/woocommerce-gutenberg-products-block
* Description: WooCommerce blocks for the Gutenberg editor.
* Version: 2.0.0-rc1
* Version: 2.0.0-rc2
* Author: Automattic
* Author URI: https://woocommerce.com
* Text Domain: woo-gutenberg-products-block
Expand All @@ -15,7 +15,7 @@

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

define( 'WGPB_VERSION', '2.0.0-rc1' );
define( 'WGPB_VERSION', '2.0.0-rc2' );
define( 'WGPB_PLUGIN_FILE', __FILE__ );
define( 'WGPB_ABSPATH', dirname( WGPB_PLUGIN_FILE ) . '/' );

Expand Down

0 comments on commit dda1d37

Please sign in to comment.