Page Builder Gutenberg Blocks – CoBlocks - Version 2.8.1

Version Description

Download this release

Release Info

Developer Godaddy
Plugin Icon 128x128 Page Builder Gutenberg Blocks – CoBlocks
Version 2.8.1
Comparing to
See all releases

Code changes from version 2.8.0 to 2.8.1

class-coblocks.php CHANGED
@@ -4,7 +4,7 @@
4
  * Description: CoBlocks is a suite of professional <strong>page building content blocks</strong> for the WordPress Gutenberg block editor. Our blocks are hyper-focused on empowering makers to build beautifully rich pages in WordPress.
5
  * Author: GoDaddy
6
  * Author URI: https://www.godaddy.com
7
- * Version: 2.8.0
8
  * Text Domain: coblocks
9
  * Domain Path: /languages
10
  * Tested up to: 5.6
@@ -25,7 +25,7 @@ if ( ! defined( 'ABSPATH' ) ) {
25
  exit;
26
  }
27
 
28
- define( 'COBLOCKS_VERSION', '2.8.0' );
29
  define( 'COBLOCKS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
30
  define( 'COBLOCKS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
31
  define( 'COBLOCKS_PLUGIN_FILE', __FILE__ );
@@ -123,9 +123,6 @@ if ( ! class_exists( 'CoBlocks' ) ) :
123
  require_once COBLOCKS_PLUGIN_DIR . 'src/components/gutter-control/gutter-wrapper.php';
124
  require_once COBLOCKS_PLUGIN_DIR . 'src/components/form-label-colors/label-color-wrapper.php';
125
 
126
- // Require CoBlocks custom utilities.
127
- require_once COBLOCKS_PLUGIN_DIR . 'src/utils/utils.php';
128
-
129
  if ( is_admin() ) {
130
  require_once COBLOCKS_PLUGIN_DIR . 'src/extensions/layout-selector/index.php';
131
  }
4
  * Description: CoBlocks is a suite of professional <strong>page building content blocks</strong> for the WordPress Gutenberg block editor. Our blocks are hyper-focused on empowering makers to build beautifully rich pages in WordPress.
5
  * Author: GoDaddy
6
  * Author URI: https://www.godaddy.com
7
+ * Version: 2.8.1
8
  * Text Domain: coblocks
9
  * Domain Path: /languages
10
  * Tested up to: 5.6
25
  exit;
26
  }
27
 
28
+ define( 'COBLOCKS_VERSION', '2.8.1' );
29
  define( 'COBLOCKS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
30
  define( 'COBLOCKS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
31
  define( 'COBLOCKS_PLUGIN_FILE', __FILE__ );
123
  require_once COBLOCKS_PLUGIN_DIR . 'src/components/gutter-control/gutter-wrapper.php';
124
  require_once COBLOCKS_PLUGIN_DIR . 'src/components/form-label-colors/label-color-wrapper.php';
125
 
 
 
 
126
  if ( is_admin() ) {
127
  require_once COBLOCKS_PLUGIN_DIR . 'src/extensions/layout-selector/index.php';
128
  }
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: page builder, Gutenberg blocks, WordPress blocks, gutenberg, blocks
5
  Requires at least: 5.0
6
  Tested up to: 5.6
7
  Requires PHP: 5.6
8
- Stable tag: 2.8.0
9
  License: GPL-2.0
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -115,13 +115,5 @@ Developers can also apply minor style touch-ups to their themes if necessary. If
115
 
116
  == Changelog ==
117
 
118
- ### Enhancements
119
- * Introduce ability to Link to images within Service block [#1807](https://github.com/godaddy-wordpress/coblocks/pull/1807)
120
- * Improve Gist block User Experience with updated styles [#1820](https://github.com/godaddy-wordpress/coblocks/pull/1820)
121
-
122
  ### Bug Fixes
123
- * Fix gallery captions rich text controls visibility [#1821](https://github.com/godaddy-wordpress/coblocks/pull/1821)
124
- * Fix Posts block missing images and improper layout [#1825](https://github.com/godaddy-wordpress/coblocks/pull/1825)
125
- * Fix Author block button removal and image placeholder alignment [#1822](https://github.com/godaddy-wordpress/coblocks/pull/1822)
126
- * Fix unintentional limit on block patterns count [#1818](https://github.com/godaddy-wordpress/coblocks/pull/1818)
127
- * Fix focus state to improve accessibility of Layout Selector [#1821](https://github.com/godaddy-wordpress/coblocks/pull/1821)
5
  Requires at least: 5.0
6
  Tested up to: 5.6
7
  Requires PHP: 5.6
8
+ Stable tag: 2.8.1
9
  License: GPL-2.0
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
115
 
116
  == Changelog ==
117
 
 
 
 
 
118
  ### Bug Fixes
119
+ * Fix backward compatibility with WP_Block_Supports [#1828](https://github.com/godaddy-wordpress/coblocks/pull/1828)
 
 
 
 
src/components/gutter-control/gutter-wrapper.php CHANGED
@@ -49,9 +49,9 @@ add_filter( 'coblocks_render_wrapper_class', 'coblocks_add_gutter_class', 10, 2
49
  function coblocks_register_gutter_support( $block_type ) {
50
  $has_gutter_support = false;
51
 
52
- if ( property_exists( $block_type, 'supports' ) ) {
53
 
54
- $has_gutter_support = coblocks_experimental_get( $block_type->supports, array( 'gutter' ), false );
55
 
56
  }
57
 
@@ -87,10 +87,14 @@ function coblocks_register_gutter_support( $block_type ) {
87
  }
88
 
89
 
90
- // Register the block support.
91
- WP_Block_Supports::get_instance()->register(
92
- 'gutter',
93
- array(
94
- 'register_attribute' => 'coblocks_register_gutter_support',
95
- )
96
- );
 
 
 
 
49
  function coblocks_register_gutter_support( $block_type ) {
50
  $has_gutter_support = false;
51
 
52
+ if ( isset( $block_type->supports ) && is_array( $block_type->supports ) ) {
53
 
54
+ $has_gutter_support = array_key_exists( 'gutter', $block_type->supports );
55
 
56
  }
57
 
87
  }
88
 
89
 
90
+ // Register the block support. Only since 5.6.0.
91
+ if ( class_exists( 'WP_Block_Supports' ) ) {
92
+
93
+ WP_Block_Supports::get_instance()->register(
94
+ 'gutter',
95
+ array(
96
+ 'register_attribute' => 'coblocks_register_gutter_support',
97
+ )
98
+ );
99
+
100
+ }
src/utils/utils.php DELETED
@@ -1,36 +0,0 @@
1
- <?php
2
- /**
3
- * General utilities.
4
- *
5
- * @package CoBlocks
6
- */
7
-
8
- /**
9
- * This function allows to easily access a part from a php array.
10
- * It is equivalent to want lodash get provides for JavaScript and is useful to have something similar
11
- * in php so functions that do the same thing on the client and sever can have identical code.
12
- *
13
- * Utility is cloned from source:
14
- * https://github.com/WordPress/gutenberg/blob/5f614054e92f5147018f07db601ac1c5eae9d14e/lib/utils.php#L8-L33
15
- *
16
- * @param array $array An array from where we want to retrieve some information from.
17
- * @param array $path An array containing the path we want to retrieve.
18
- * @param array $default The return value if $array or $path is not expected input type.
19
- *
20
- * @return array An array matching the path specified.
21
- */
22
- function coblocks_experimental_get( $array, $path, $default = array() ) {
23
- // Confirm input values are expected type to avoid notice warnings.
24
- if ( ! is_array( $array ) || ! is_array( $path ) ) {
25
- return $default;
26
- }
27
-
28
- $path_length = count( $path );
29
- for ( $i = 0; $i < $path_length; ++$i ) {
30
- if ( ! isset( $array[ $path[ $i ] ] ) ) {
31
- return $default;
32
- }
33
- $array = $array[ $path[ $i ] ];
34
- }
35
- return $array;
36
- }