Brizy – Page Builder - Version 1.0.52

Version Description

  • 2018-12-07 =
  • FIxed: Brizy buttons for Gutemberg
Download this release

Release Info

Developer themefusecom
Plugin Icon 128x128 Brizy – Page Builder
Version 1.0.52
Comparing to
See all releases

Code changes from version 1.0.51 to 1.0.52

README.md CHANGED
@@ -3,7 +3,7 @@ Contributors: themefuse<br>
3
  Requires at least: 4.5<br>
4
  Tested up to: 4.9<br>
5
  Requires PHP: 5.4<br>
6
- Stable tag: 1.0.51<br>
7
  License: GPLv3<br>
8
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -96,6 +96,9 @@ A good bug report includes full details to easily understand the issue you are h
96
 
97
  ## Changelog
98
 
 
 
 
99
  ### 1.0.51 - 2018-12-06 ###
100
  * New: Columns can now be resizes in mobile device mode
101
  * Fixed: Tempate fixes
3
  Requires at least: 4.5<br>
4
  Tested up to: 4.9<br>
5
  Requires PHP: 5.4<br>
6
+ Stable tag: 1.0.52<br>
7
  License: GPLv3<br>
8
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
9
 
96
 
97
  ## Changelog
98
 
99
+ ### 1.0.52 - 2018-12-07 ###
100
+ * FIxed: Brizy buttons for Gutemberg
101
+
102
  ### 1.0.51 - 2018-12-06 ###
103
  * New: Columns can now be resizes in mobile device mode
104
  * Fixed: Tempate fixes
brizy.php CHANGED
@@ -5,7 +5,7 @@
5
  * Plugin URI: https://brizy.io/
6
  * Author: Brizy.io
7
  * Author URI: https://brizy.io/
8
- * Version: 1.0.51
9
  * Text Domain: brizy
10
  * License: GPLv3
11
  * Domain Path: /languages
@@ -20,7 +20,7 @@ if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && stripos( $_SERVER['HTTP_X_FO
20
 
21
  define( 'BRIZY_DEVELOPMENT', false );
22
  define( 'BRIZY_LOG', false );
23
- define( 'BRIZY_VERSION', '1.0.51' );
24
  define( 'BRIZY_EDITOR_VERSION', '1.0.77' );
25
  define( 'BRIZY_FILE', __FILE__ );
26
  define( 'BRIZY_PLUGIN_BASE', plugin_basename( BRIZY_FILE ) );
5
  * Plugin URI: https://brizy.io/
6
  * Author: Brizy.io
7
  * Author URI: https://brizy.io/
8
+ * Version: 1.0.52
9
  * Text Domain: brizy
10
  * License: GPLv3
11
  * Domain Path: /languages
20
 
21
  define( 'BRIZY_DEVELOPMENT', false );
22
  define( 'BRIZY_LOG', false );
23
+ define( 'BRIZY_VERSION', '1.0.52' );
24
  define( 'BRIZY_EDITOR_VERSION', '1.0.77' );
25
  define( 'BRIZY_FILE', __FILE__ );
26
  define( 'BRIZY_PLUGIN_BASE', plugin_basename( BRIZY_FILE ) );
compatibilities/gutenberg.php CHANGED
@@ -1,29 +1,33 @@
1
  <?php
2
 
3
- class Brizy_Compatibilities_Gutenberg {
4
-
5
- public function __construct() {
6
- add_filter( 'the_content', array( $this, 'filter_the_content' ), 5 );
7
- add_action( 'admin_print_scripts-edit.php', array( $this, 'add_edit_button_to_gutenberg' ), 12 );
8
- add_action( 'admin_init', array( $this, 'action_disable_gutenberg' ) );
9
- add_action( 'admin_footer', array( $this, 'print_admin_footer_tpls' ) );
10
- }
11
-
12
- public function filter_the_content( $content ) {
13
- remove_filter( 'the_content', 'gutenberg_wpautop', 6 );
14
-
15
- return $content;
16
- }
17
-
18
- public function add_edit_button_to_gutenberg() {
19
- global $typenow;
20
-
21
- $new_post_url = add_query_arg( array(
22
- 'action' => 'brizy_new_post',
23
- 'post_type' => $typenow,
24
- ), set_url_scheme( admin_url( 'edit.php' ) ) );
25
-
26
- ?>
 
 
 
 
27
  <script type="text/javascript">
28
  document.addEventListener('DOMContentLoaded', function () {
29
  var dropdown = document.querySelector('#split-page-title-action .dropdown');
@@ -32,74 +36,87 @@ class Brizy_Compatibilities_Gutenberg {
32
  return;
33
  }
34
 
35
- var url = '<?php echo esc_attr( $new_post_url ); ?>';
36
 
37
  dropdown.insertAdjacentHTML('afterbegin', '<a href="' + url + '">Brizy</a>');
38
  });
39
  </script>
40
- <?php
41
- }
42
 
43
- public function action_disable_gutenberg() {
 
44
 
45
- global $pagenow;
46
 
47
- if ( ! in_array( $pagenow, array( 'post-new.php', 'post.php' ) ) || ! isset( $_GET['post'] ) ) {
48
- return;
49
- }
50
 
51
- if ( ! in_array( get_post_type( $_GET['post'] ), Brizy_Editor::get()->supported_post_types() ) ) {
52
- return;
53
- }
54
 
55
- try {
56
- if ( Brizy_Editor_Post::get( $_GET['post'] )->uses_editor() ) {
57
- add_filter( 'gutenberg_can_edit_post_type', '__return_false' );
58
- }
59
- } catch ( Exception $e ) {
60
- return;
61
- }
62
- }
 
 
 
63
 
64
- public function print_admin_footer_tpls() {
65
 
66
- global $pagenow;
 
 
67
 
68
- if ( ! in_array( $pagenow, array( 'post-new.php', 'post.php' ) ) ) {
69
- return;
70
- }
71
 
72
- if ( ! in_array( get_post_type(), Brizy_Editor::get()->supported_post_types() ) ) {
73
- return;
74
- }
 
75
 
76
  $log_dir = BRIZY_PLUGIN_URL . '/admin/static/img/';
77
 
78
  try {
79
- $post = Brizy_Editor_Post::get( get_the_ID() );
80
-
81
- if ( $post->uses_editor() ) {
82
- $edit_url = esc_url( admin_url( 'admin-post.php?action=_brizy_admin_editor_disable&post=' . get_the_ID() ) );
83
- echo
84
- '<script id="brizy-gutenberg-btn-switch-mode" type="text/html">
85
- <div class="brizy-buttons" style="margin-top:15px;">
86
- <a class="brizy-button brizy-button--primary enable-brizy-editor" type="button" href="' . $edit_url . '" style="padding:5px 27px 5px;">' .
87
- '<img src="' . plugins_url( '../admin/static/img/arrow.png', __FILE__ ) . '" class="brizy-button--arrow"/> ' . __( 'Back to WordPress Editor', 'brizy' ) . '</a></div>
88
- </script>';
89
- } else {
90
- $edit_url = esc_url( admin_url( 'admin-post.php?action=_brizy_admin_editor_enable&post=' . get_the_ID() ) );
91
- echo
92
- '<script id="brizy-gutenberg-btn-switch-mode" type="text/html">
 
 
 
 
 
 
93
  <div class="brizy-buttons" style="margin-top:15px;">
94
  <a class="brizy-button brizy-button--primary enable-brizy-editor" type="button" href="' . $edit_url . '" style="padding:5px 27px 5px;">' .
95
- esc_html__( 'Edit with', 'brizy' ) .
96
- '<img src="' . $log_dir . 'brizy.png" srcset="' . $log_dir . 'brizy.png' . ' 1x, ' . $log_dir . 'brizy-2x.png 2x" class="brizy-logo">
97
  </a>
98
  </div>
99
  </script>';
100
- }
101
- } catch ( Exception $e ) {
102
 
103
- }
104
  }
105
  }
1
  <?php
2
 
3
+ class Brizy_Compatibilities_Gutenberg
4
+ {
5
+
6
+ public function __construct()
7
+ {
8
+ add_filter('the_content', array($this, 'filter_the_content'), 5);
9
+ add_action('admin_print_scripts-edit.php', array($this, 'add_edit_button_to_gutenberg'), 12);
10
+ add_action('admin_init', array($this, 'action_disable_gutenberg'));
11
+ add_action('admin_footer', array($this, 'print_admin_footer_tpls'));
12
+ }
13
+
14
+ public function filter_the_content($content)
15
+ {
16
+ remove_filter('the_content', 'gutenberg_wpautop', 6);
17
+
18
+ return $content;
19
+ }
20
+
21
+ public function add_edit_button_to_gutenberg()
22
+ {
23
+ global $typenow;
24
+
25
+ $new_post_url = add_query_arg(array(
26
+ 'action' => 'brizy_new_post',
27
+ 'post_type' => $typenow,
28
+ ), set_url_scheme(admin_url('edit.php')));
29
+
30
+ ?>
31
  <script type="text/javascript">
32
  document.addEventListener('DOMContentLoaded', function () {
33
  var dropdown = document.querySelector('#split-page-title-action .dropdown');
36
  return;
37
  }
38
 
39
+ var url = '<?php echo esc_attr($new_post_url); ?>';
40
 
41
  dropdown.insertAdjacentHTML('afterbegin', '<a href="' + url + '">Brizy</a>');
42
  });
43
  </script>
44
+ <?php
45
+ }
46
 
47
+ public function action_disable_gutenberg()
48
+ {
49
 
50
+ global $pagenow;
51
 
52
+ if (!in_array($pagenow, array('post-new.php', 'post.php')) || !isset($_GET['post'])) {
53
+ return;
54
+ }
55
 
56
+ if (!in_array(get_post_type($_GET['post']), Brizy_Editor::get()->supported_post_types())) {
57
+ return;
58
+ }
59
 
60
+ try {
61
+ if (Brizy_Editor_Post::get($_GET['post'])->uses_editor()) {
62
+ add_filter('gutenberg_can_edit_post_type', '__return_false');
63
+ }
64
+ } catch (Exception $e) {
65
+ return;
66
+ }
67
+ }
68
+
69
+ public function print_admin_footer_tpls()
70
+ {
71
 
72
+ global $pagenow;
73
 
74
+ if (!in_array($pagenow, array('post-new.php', 'post.php'))) {
75
+ return;
76
+ }
77
 
78
+ if (!in_array(get_post_type(), Brizy_Editor::get()->supported_post_types())) {
79
+ return;
80
+ }
81
 
82
+ $continueUrl = add_query_arg(
83
+ array(Brizy_Editor_Constants::EDIT_KEY => ''),
84
+ get_permalink(get_the_ID())
85
+ );
86
 
87
  $log_dir = BRIZY_PLUGIN_URL . '/admin/static/img/';
88
 
89
  try {
90
+ $post = Brizy_Editor_Post::get(get_the_ID());
91
+
92
+ if ($post->uses_editor()) {
93
+ $edit_url = esc_url(admin_url('admin-post.php?action=_brizy_admin_editor_disable&post=' . get_the_ID()));
94
+ echo
95
+ '<script id="brizy-gutenberg-btn-switch-mode" type="text/html">
96
+ <div class="brizy-buttons" style="margin-top:15px;">
97
+ <a class="brizy-button brizy-button--primary enable-brizy-editor" type="button" href="' . $edit_url . '" style="padding:5px 27px 5px;">' .
98
+ '<img src="' . plugins_url('../admin/static/img/arrow.png', __FILE__) . '" class="brizy-button--arrow"/> ' . __('Back to WordPress Editor', 'brizy') . '
99
+ </a>
100
+ <a class="brizy-button brizy-button--primary " type="button" href="' . $continueUrl . '" style="padding:5px 27px 5px;">'
101
+ .__('Continue to edit with ', 'brizy') . '&nbsp;
102
+ <img src="' . plugins_url('../admin/static/img/brizy.png', __FILE__) . '" class="brizy-button--arrow"/>
103
+ </a>
104
+ </div>
105
+ </script>';
106
+ } else {
107
+ $edit_url = esc_url(admin_url('admin-post.php?action=_brizy_admin_editor_enable&post=' . get_the_ID()));
108
+ echo
109
+ '<script id="brizy-gutenberg-btn-switch-mode" type="text/html">
110
  <div class="brizy-buttons" style="margin-top:15px;">
111
  <a class="brizy-button brizy-button--primary enable-brizy-editor" type="button" href="' . $edit_url . '" style="padding:5px 27px 5px;">' .
112
+ esc_html__('Edit with', 'brizy') .
113
+ '<img src="' . $log_dir . 'brizy.png" srcset="' . $log_dir . 'brizy.png' . ' 1x, ' . $log_dir . 'brizy-2x.png 2x" class="brizy-logo">
114
  </a>
115
  </div>
116
  </script>';
117
+ }
118
+ } catch (Exception $e) {
119
 
120
+ }
121
  }
122
  }
editor.php CHANGED
@@ -130,7 +130,8 @@ class Brizy_Editor {
130
  new Brizy_Compatibilities_Wtc();
131
  }
132
 
133
- if ( function_exists( 'gutenberg_init' ) || version_compare( $wp_version, '5.0' ) < 0 ) {
 
134
  new Brizy_Compatibilities_Gutenberg();
135
  }
136
 
130
  new Brizy_Compatibilities_Wtc();
131
  }
132
 
133
+ $version_compare = version_compare($wp_version, '5.0');
134
+ if ( function_exists( 'gutenberg_init' ) || $version_compare <= 0 ) {
135
  new Brizy_Compatibilities_Gutenberg();
136
  }
137
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: brizy, page builder, editor, visual editor, unyson, wysiwyg, landing page,
4
  Requires at least: 4.5
5
  Tested up to: 4.9
6
  Requires PHP: 5.4
7
- Stable tag: 1.0.51
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -139,6 +139,9 @@ The progress you're making while building your page is always backed up in the c
139
 
140
  == Changelog ==
141
 
 
 
 
142
  = 1.0.51 - 2018-12-06 =
143
  * New: Columns can now be resizes in mobile device mode
144
  * Fixed: Tempate fixes
4
  Requires at least: 4.5
5
  Tested up to: 4.9
6
  Requires PHP: 5.4
7
+ Stable tag: 1.0.52
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
139
 
140
  == Changelog ==
141
 
142
+ = 1.0.52 - 2018-12-07 =
143
+ * FIxed: Brizy buttons for Gutemberg
144
+
145
  = 1.0.51 - 2018-12-06 =
146
  * New: Columns can now be resizes in mobile device mode
147
  * Fixed: Tempate fixes
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit14047a28779c46e2233dc1d0b0ce0947::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitb91fcbffcc11d085d1bf8a10110506f2::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit14047a28779c46e2233dc1d0b0ce0947
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit14047a28779c46e2233dc1d0b0ce0947
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit14047a28779c46e2233dc1d0b0ce0947', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit14047a28779c46e2233dc1d0b0ce0947', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit14047a28779c46e2233dc1d0b0ce0947::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitb91fcbffcc11d085d1bf8a10110506f2
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitb91fcbffcc11d085d1bf8a10110506f2', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitb91fcbffcc11d085d1bf8a10110506f2', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInitb91fcbffcc11d085d1bf8a10110506f2::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit14047a28779c46e2233dc1d0b0ce0947
8
  {
9
  public static $prefixesPsr0 = array (
10
  'T' =>
@@ -19,7 +19,7 @@ class ComposerStaticInit14047a28779c46e2233dc1d0b0ce0947
19
  public static function getInitializer(ClassLoader $loader)
20
  {
21
  return \Closure::bind(function () use ($loader) {
22
- $loader->prefixesPsr0 = ComposerStaticInit14047a28779c46e2233dc1d0b0ce0947::$prefixesPsr0;
23
 
24
  }, null, ClassLoader::class);
25
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitb91fcbffcc11d085d1bf8a10110506f2
8
  {
9
  public static $prefixesPsr0 = array (
10
  'T' =>
19
  public static function getInitializer(ClassLoader $loader)
20
  {
21
  return \Closure::bind(function () use ($loader) {
22
+ $loader->prefixesPsr0 = ComposerStaticInitb91fcbffcc11d085d1bf8a10110506f2::$prefixesPsr0;
23
 
24
  }, null, ClassLoader::class);
25
  }