Disable Gutenberg - Version 1.9

Version Description

To upgrade this plugin, remove the old version and replace with the new version. Or just click "Update" from the Plugins screen and let WordPress do it for you automatically.

Note: uninstalling the plugin from the WP Plugins screen results in the removal of all settings and data from the WP database.

Download this release

Release Info

Developer specialk
Plugin Icon 128x128 Disable Gutenberg
Version 1.9
Comparing to
See all releases

Code changes from version 1.8.1 to 1.9

css/font-icons.css CHANGED
@@ -1,4 +1,4 @@
1
- /* Font Awesome 4.7 @ http://fontawesome.io/cheatsheet/ */
2
  @font-face {
3
  font-family: 'FontAwesome';
4
  src: url('../fonts/awesome/fontawesome-webfont.eot?v=4.7.0');
1
+ /* Font Awesome 4.7 @ https://fontawesome.io/cheatsheet/ */
2
  @font-face {
3
  font-family: 'FontAwesome';
4
  src: url('../fonts/awesome/fontawesome-webfont.eot?v=4.7.0');
disable-gutenberg.php CHANGED
@@ -10,8 +10,8 @@
10
  Contributors: specialk
11
  Requires at least: 4.9
12
  Tested up to: 5.2
13
- Stable tag: 1.8.1
14
- Version: 1.8.1
15
  Requires PHP: 5.6.20
16
  Text Domain: disable-gutenberg
17
  Domain Path: /languages
@@ -69,7 +69,7 @@ if (!class_exists('DisableGutenberg')) {
69
 
70
  function constants() {
71
 
72
- if (!defined('DISABLE_GUTENBERG_VERSION')) define('DISABLE_GUTENBERG_VERSION', '1.8.1');
73
  if (!defined('DISABLE_GUTENBERG_REQUIRE')) define('DISABLE_GUTENBERG_REQUIRE', '4.9');
74
  if (!defined('DISABLE_GUTENBERG_AUTHOR')) define('DISABLE_GUTENBERG_AUTHOR', 'Jeff Starr');
75
  if (!defined('DISABLE_GUTENBERG_NAME')) define('DISABLE_GUTENBERG_NAME', __('Disable Gutenberg', 'disable-gutenberg'));
10
  Contributors: specialk
11
  Requires at least: 4.9
12
  Tested up to: 5.2
13
+ Stable tag: 1.9
14
+ Version: 1.9
15
  Requires PHP: 5.6.20
16
  Text Domain: disable-gutenberg
17
  Domain Path: /languages
69
 
70
  function constants() {
71
 
72
+ if (!defined('DISABLE_GUTENBERG_VERSION')) define('DISABLE_GUTENBERG_VERSION', '1.9');
73
  if (!defined('DISABLE_GUTENBERG_REQUIRE')) define('DISABLE_GUTENBERG_REQUIRE', '4.9');
74
  if (!defined('DISABLE_GUTENBERG_AUTHOR')) define('DISABLE_GUTENBERG_AUTHOR', 'Jeff Starr');
75
  if (!defined('DISABLE_GUTENBERG_NAME')) define('DISABLE_GUTENBERG_NAME', __('Disable Gutenberg', 'disable-gutenberg'));
fonts/awesome/fontawesome-webfont.svg CHANGED
@@ -1,5 +1,5 @@
1
  <?xml version="1.0" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
  <svg>
4
  <metadata>
5
  Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016
1
  <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "https://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
  <svg>
4
  <metadata>
5
  Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016
inc/classic-editor.php CHANGED
@@ -4,21 +4,17 @@ if (!defined('ABSPATH')) exit;
4
 
5
  function disable_gutenberg_remove() {
6
 
7
- $gutenberg = function_exists('gutenberg_can_edit_post_type');
8
 
9
  $block_editor = has_action('enqueue_block_assets');
10
 
11
  if (!$gutenberg && $block_editor === false) return;
12
 
13
- if ($block_editor) {
14
-
15
- add_filter('use_block_editor_for_post_type', '__return_false', 100, 2);
16
-
17
- }
18
 
19
  if ($gutenberg) {
20
 
21
- add_filter('gutenberg_can_edit_post_type', '__return_false', 100, 2);
22
 
23
  disable_gutenberg_hooks();
24
 
@@ -28,21 +24,42 @@ function disable_gutenberg_remove() {
28
 
29
  function disable_gutenberg_hooks() {
30
 
31
- // synced w/ Classic Editor plugin
32
 
33
  remove_action('admin_menu', 'gutenberg_menu');
34
  remove_action('admin_init', 'gutenberg_redirect_demo');
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  remove_filter('wp_refresh_nonces', 'gutenberg_add_rest_nonce_to_heartbeat_response_headers');
37
  remove_filter('get_edit_post_link', 'gutenberg_revisions_link_to_editor');
38
  remove_filter('wp_prepare_revision_for_js', 'gutenberg_revisions_restore');
39
 
40
  remove_action('rest_api_init', 'gutenberg_register_rest_routes');
41
  remove_action('rest_api_init', 'gutenberg_add_taxonomy_visibility_field');
42
- remove_filter('rest_request_after_callbacks', 'gutenberg_filter_oembed_result');
43
  remove_filter('registered_post_type', 'gutenberg_register_post_prepare_functions');
44
 
45
- remove_action('do_meta_boxes', 'gutenberg_meta_box_save', 1000);
46
  remove_action('submitpost_box', 'gutenberg_intercept_meta_box_render');
47
  remove_action('submitpage_box', 'gutenberg_intercept_meta_box_render');
48
  remove_action('edit_page_form', 'gutenberg_intercept_meta_box_render');
@@ -50,13 +67,12 @@ function disable_gutenberg_hooks() {
50
  remove_filter('redirect_post_location', 'gutenberg_meta_box_save_redirect');
51
  remove_filter('filter_gutenberg_meta_boxes', 'gutenberg_filter_meta_boxes');
52
 
53
- remove_action('admin_notices', 'gutenberg_build_files_notice');
54
  remove_filter('body_class', 'gutenberg_add_responsive_body_class');
55
  remove_filter('admin_url', 'gutenberg_modify_add_new_button_url'); // old
56
  remove_action('admin_enqueue_scripts', 'gutenberg_check_if_classic_needs_warning_about_blocks');
57
  remove_filter('register_post_type_args', 'gutenberg_filter_post_type_labels');
58
 
59
- //
60
 
61
  remove_action('admin_init', 'gutenberg_add_edit_link_filters');
62
  remove_action('admin_print_scripts-edit.php', 'gutenberg_replace_default_add_new_button');
@@ -77,4 +93,4 @@ function disable_gutenberg_hooks() {
77
  // remove_filter('wp_editor_settings', 'gutenberg_disable_editor_settings_wpautop');
78
  // remove_filter('the_content', 'gutenberg_wpautop', 8);
79
 
80
- }
4
 
5
  function disable_gutenberg_remove() {
6
 
7
+ $gutenberg = function_exists('gutenberg_register_scripts_and_styles');
8
 
9
  $block_editor = has_action('enqueue_block_assets');
10
 
11
  if (!$gutenberg && $block_editor === false) return;
12
 
13
+ add_filter('use_block_editor_for_post_type', '__return_false', 100);
 
 
 
 
14
 
15
  if ($gutenberg) {
16
 
17
+ add_filter('gutenberg_can_edit_post_type', '__return_false', 100);
18
 
19
  disable_gutenberg_hooks();
20
 
24
 
25
  function disable_gutenberg_hooks() {
26
 
27
+ // Synced w/ Classic Editor plugin
28
 
29
  remove_action('admin_menu', 'gutenberg_menu');
30
  remove_action('admin_init', 'gutenberg_redirect_demo');
31
 
32
+ // Gutenberg 5.3+
33
+
34
+ remove_action('wp_enqueue_scripts', 'gutenberg_register_scripts_and_styles');
35
+ remove_action('admin_enqueue_scripts', 'gutenberg_register_scripts_and_styles');
36
+ remove_action('admin_notices', 'gutenberg_wordpress_version_notice');
37
+ remove_action('rest_api_init', 'gutenberg_register_rest_widget_updater_routes');
38
+ remove_action('admin_print_styles', 'gutenberg_block_editor_admin_print_styles');
39
+ remove_action('admin_print_scripts', 'gutenberg_block_editor_admin_print_scripts');
40
+ remove_action('admin_print_footer_scripts', 'gutenberg_block_editor_admin_print_footer_scripts');
41
+ remove_action('admin_footer', 'gutenberg_block_editor_admin_footer');
42
+ remove_action('admin_enqueue_scripts', 'gutenberg_widgets_init');
43
+ remove_action('admin_notices', 'gutenberg_build_files_notice');
44
+
45
+ remove_filter('load_script_translation_file', 'gutenberg_override_translation_file');
46
+ remove_filter('block_editor_settings', 'gutenberg_extend_block_editor_styles');
47
+ remove_filter('default_content', 'gutenberg_default_demo_content');
48
+ remove_filter('default_title', 'gutenberg_default_demo_title');
49
+ remove_filter('block_editor_settings', 'gutenberg_legacy_widget_settings');
50
+ remove_filter('rest_request_after_callbacks', 'gutenberg_filter_oembed_result');
51
+
52
+ // Previously used, compat for older Gutenberg versions
53
+
54
  remove_filter('wp_refresh_nonces', 'gutenberg_add_rest_nonce_to_heartbeat_response_headers');
55
  remove_filter('get_edit_post_link', 'gutenberg_revisions_link_to_editor');
56
  remove_filter('wp_prepare_revision_for_js', 'gutenberg_revisions_restore');
57
 
58
  remove_action('rest_api_init', 'gutenberg_register_rest_routes');
59
  remove_action('rest_api_init', 'gutenberg_add_taxonomy_visibility_field');
 
60
  remove_filter('registered_post_type', 'gutenberg_register_post_prepare_functions');
61
 
62
+ remove_action('do_meta_boxes', 'gutenberg_meta_box_save');
63
  remove_action('submitpost_box', 'gutenberg_intercept_meta_box_render');
64
  remove_action('submitpage_box', 'gutenberg_intercept_meta_box_render');
65
  remove_action('edit_page_form', 'gutenberg_intercept_meta_box_render');
67
  remove_filter('redirect_post_location', 'gutenberg_meta_box_save_redirect');
68
  remove_filter('filter_gutenberg_meta_boxes', 'gutenberg_filter_meta_boxes');
69
 
 
70
  remove_filter('body_class', 'gutenberg_add_responsive_body_class');
71
  remove_filter('admin_url', 'gutenberg_modify_add_new_button_url'); // old
72
  remove_action('admin_enqueue_scripts', 'gutenberg_check_if_classic_needs_warning_about_blocks');
73
  remove_filter('register_post_type_args', 'gutenberg_filter_post_type_labels');
74
 
75
+ // Not used in Gutenberg 5.3+
76
 
77
  remove_action('admin_init', 'gutenberg_add_edit_link_filters');
78
  remove_action('admin_print_scripts-edit.php', 'gutenberg_replace_default_add_new_button');
93
  // remove_filter('wp_editor_settings', 'gutenberg_disable_editor_settings_wpautop');
94
  // remove_filter('the_content', 'gutenberg_wpautop', 8);
95
 
96
+ }
inc/plugin-core.php CHANGED
@@ -416,4 +416,4 @@ function disable_gutenberg_get_post_id($post_id = false) {
416
 
417
  return $post_id;
418
 
419
- }
416
 
417
  return $post_id;
418
 
419
+ }
readme.txt CHANGED
@@ -10,8 +10,8 @@ Donate link: https://monzillamedia.com/donate.html
10
  Contributors: specialk
11
  Requires at least: 4.9
12
  Tested up to: 5.2
13
- Stable tag: 1.8.1
14
- Version: 1.8.1
15
  Requires PHP: 5.6.20
16
  Text Domain: disable-gutenberg
17
  Domain Path: /languages
@@ -112,7 +112,7 @@ __If you like this plugin, please give it a [5-star rating](https://wordpress.or
112
  2. Configure the plugin settings as desired
113
  3. Enable theme switcher via settings or shortcode
114
 
115
- [More info on installing WP plugins](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins)
116
 
117
 
118
  **Settings**
@@ -290,6 +290,14 @@ Thank you to everyone for using Disable Gutenberg and for all the [awesome 5-sta
290
  Version 1.5 brings some great new features and improvements. Note that better Multisite support is being developed for a future release. If you have any feedback or suggestions to make this plugin the absolute best it can be, and/or would like to help with development, please reach me via my [contact form](https://perishablepress.com/contact/) at Perishable Press.
291
 
292
 
 
 
 
 
 
 
 
 
293
  **1.8.1 (2019/04/29)**
294
 
295
  * Fixes PHP Notice: "Trying to get property ID of non-object"
10
  Contributors: specialk
11
  Requires at least: 4.9
12
  Tested up to: 5.2
13
+ Stable tag: 1.9
14
+ Version: 1.9
15
  Requires PHP: 5.6.20
16
  Text Domain: disable-gutenberg
17
  Domain Path: /languages
112
  2. Configure the plugin settings as desired
113
  3. Enable theme switcher via settings or shortcode
114
 
115
+ [More info on installing WP plugins](https://codex.wordpress.org/Managing_Plugins#Installing_Plugins)
116
 
117
 
118
  **Settings**
290
  Version 1.5 brings some great new features and improvements. Note that better Multisite support is being developed for a future release. If you have any feedback or suggestions to make this plugin the absolute best it can be, and/or would like to help with development, please reach me via my [contact form](https://perishablepress.com/contact/) at Perishable Press.
291
 
292
 
293
+ **1.9 (2019/09/02)**
294
+
295
+ * Updates check for existing Gutenberg plugin
296
+ * Improves logic of `disable_gutenberg_remove()`
297
+ * Updates hooks in `disable_gutenberg_hooks()`
298
+ * Updates some links to https
299
+ * Tests on WordPress 5.3 (alpha)
300
+
301
  **1.8.1 (2019/04/29)**
302
 
303
  * Fixes PHP Notice: "Trying to get property ID of non-object"