Skip to content

Commit

Permalink
Merge pull request #30 from studiopress/fix/simpler-fatal-error-attempt
Browse files Browse the repository at this point in the history
Prevent an error on activating when BL 1.5.6 is active
  • Loading branch information
kienstra authored Sep 1, 2020
2 parents b21e450 + 489d860 commit b4285ea
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@ Plugin released!
* Easily create custom blocks
* 13 fields to add
* Simple templating, with PHP files

### 1.0.1 - 2020-09-01 ###

Fix an error if Block Lab 1.5.6 is also active

* Fixes an error with Block Lab 1.5.6, where it defines functions twice
* Error does not occur with latest Block Lab
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: gutenberg, blocks, block editor, fields, template
Requires at least: 5.0
Tested up to: 5.5
Requires PHP: 5.6
Stable tag: 1.0.0
Stable tag: 1.0.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl

Expand Down
2 changes: 1 addition & 1 deletion genesis-custom-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* Plugin Name: Genesis Custom Blocks
* Description: The easy way to build custom blocks for Gutenberg.
* Version: 1.0.0
* Version: 1.0.1
* Author: Genesis Custom Blocks
* Author URI: https://studiopress.com
* License: GPL2
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
@@ -1,7 +1,7 @@
{
"name": "genesis-custom-blocks",
"title": "Genesis Custom Blocks",
"version": "1.0.0",
"version": "1.0.1",
"description": "WordPress plugin with a simple templating system for building custom blocks.",
"author": "Genesis Custom Blocks",
"license": "GPL-2.0-or-later",
Expand Down
11 changes: 9 additions & 2 deletions php/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ function() {
$onboarding->plugin_activation();
}
);

$this->require_helpers();
}

/**
Expand All @@ -74,7 +76,6 @@ function() {
public function plugin_loaded() {
$this->admin = new Admin();
$this->register_component( $this->admin );
$this->require_helpers();
}

/**
Expand All @@ -92,7 +93,13 @@ public function require_deprecated() {
* Requires helper functions.
*/
private function require_helpers() {
require_once __DIR__ . '/Helpers.php';
require_once __DIR__ . '/BlockApi.php';

if ( function_exists( 'block_field' ) || function_exists( 'block_value' ) ) {
return;
}

require_once __DIR__ . '/Helpers.php';

}
}

0 comments on commit b4285ea

Please sign in to comment.