Skip to content
Snippets Groups Projects
Commit f2f96d6a authored by Erick Hitter's avatar Erick Hitter
Browse files

Prevent block-editor script from loading on widgets block editor

Loading the block-editor script on the widgets block editor produces a
`_doing_it_wrong()` notice because the `wp-editor` script should not be
loaded for the widgets block editor, but it is a dependency for this plugin's
block-editor script.

Fixes #22
parent 60cd4022
No related branches found
No related tags found
1 merge request!18Prevent block-editor script from loading on widgets block editor
Pipeline #4778 passed
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
**Tags:** revision, revisions, admin **Tags:** revision, revisions, admin
**Requires at least:** 3.6 **Requires at least:** 3.6
**Tested up to:** 6.0 **Tested up to:** 6.0
**Stable tag:** 1.4.1 **Stable tag:** 1.4.2
**License:** GPLv2 or later **License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html **License URI:** http://www.gnu.org/licenses/gpl-2.0.html
...@@ -35,6 +35,9 @@ Navigate to **Settings > Writing** in your WordPress Dashboard, and look for the ...@@ -35,6 +35,9 @@ Navigate to **Settings > Writing** in your WordPress Dashboard, and look for the
## Changelog ## ## Changelog ##
### 1.4.2 ###
* Fix notice appearing on Widgets Block Editor.
### 1.4.1 ### ### 1.4.1 ###
* Update translation text domain to `wp-revisions-control`, conforming to WordPress standards. * Update translation text domain to `wp-revisions-control`, conforming to WordPress standards.
* Add Polish translation thanks to [Maciej Gryniuk](https://github.com/odie2). * Add Polish translation thanks to [Maciej Gryniuk](https://github.com/odie2).
...@@ -58,6 +61,9 @@ Navigate to **Settings > Writing** in your WordPress Dashboard, and look for the ...@@ -58,6 +61,9 @@ Navigate to **Settings > Writing** in your WordPress Dashboard, and look for the
## Upgrade Notice ## ## Upgrade Notice ##
### 1.4.2 ###
Fixes notice appearing on Widgets Block Editor.
### 1.4.1 ### ### 1.4.1 ###
Updates translation text domain to `wp-revisions-control`, conforming to WordPress standards. Updates translation text domain to `wp-revisions-control`, conforming to WordPress standards.
......
...@@ -149,6 +149,12 @@ class Block_Editor { ...@@ -149,6 +149,12 @@ class Block_Editor {
* Register Gutenberg script. * Register Gutenberg script.
*/ */
public function action_enqueue_block_editor_assets() { public function action_enqueue_block_editor_assets() {
global $pagenow;
if ( 'widgets.php' === $pagenow ) {
return;
}
$handle = 'wp-revisions-control-block-editor'; $handle = 'wp-revisions-control-block-editor';
$asset_data = require_once dirname( __DIR__ ) . '/assets/build/gutenberg.asset.php'; $asset_data = require_once dirname( __DIR__ ) . '/assets/build/gutenberg.asset.php';
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
# This file is distributed under the same license as the WP Revisions Control package. # This file is distributed under the same license as the WP Revisions Control package.
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WP Revisions Control 1.4.1\n" "Project-Id-Version: WP Revisions Control 1.4.2\n"
"Report-Msgid-Bugs-To: " "Report-Msgid-Bugs-To: "
"https://wordpress.org/support/plugin/wp-revisions-control\n" "https://wordpress.org/support/plugin/wp-revisions-control\n"
"POT-Creation-Date: 2022-06-06 04:01:11+00:00\n" "POT-Creation-Date: 2022-06-11 19:34:09+00:00\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
......
...@@ -4,7 +4,7 @@ Donate link: https://ethitter.com/donate/ ...@@ -4,7 +4,7 @@ Donate link: https://ethitter.com/donate/
Tags: revision, revisions, admin Tags: revision, revisions, admin
Requires at least: 3.6 Requires at least: 3.6
Tested up to: 6.0 Tested up to: 6.0
Stable tag: 1.4.1 Stable tag: 1.4.2
License: GPLv2 or later License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html License URI: http://www.gnu.org/licenses/gpl-2.0.html
...@@ -35,6 +35,9 @@ Navigate to **Settings > Writing** in your WordPress Dashboard, and look for the ...@@ -35,6 +35,9 @@ Navigate to **Settings > Writing** in your WordPress Dashboard, and look for the
== Changelog == == Changelog ==
= 1.4.2 =
* Fix notice appearing on Widgets Block Editor.
= 1.4.1 = = 1.4.1 =
* Update translation text domain to `wp-revisions-control`, conforming to WordPress standards. * Update translation text domain to `wp-revisions-control`, conforming to WordPress standards.
* Add Polish translation thanks to [Maciej Gryniuk](https://github.com/odie2). * Add Polish translation thanks to [Maciej Gryniuk](https://github.com/odie2).
...@@ -58,6 +61,9 @@ Navigate to **Settings > Writing** in your WordPress Dashboard, and look for the ...@@ -58,6 +61,9 @@ Navigate to **Settings > Writing** in your WordPress Dashboard, and look for the
== Upgrade Notice == == Upgrade Notice ==
= 1.4.2 =
Fixes notice appearing on Widgets Block Editor.
= 1.4.1 = = 1.4.1 =
Updates translation text domain to `wp-revisions-control`, conforming to WordPress standards. Updates translation text domain to `wp-revisions-control`, conforming to WordPress standards.
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* Plugin URI: https://ethitter.com/plugins/wp-revisions-control/ * Plugin URI: https://ethitter.com/plugins/wp-revisions-control/
* Description: Control how many revisions are stored for each post type * Description: Control how many revisions are stored for each post type
* Author: Erick Hitter * Author: Erick Hitter
* Version: 1.4.1 * Version: 1.4.2
* Author URI: https://ethitter.com/ * Author URI: https://ethitter.com/
* Text Domain: wp-revisions-control * Text Domain: wp-revisions-control
* Domain Path: /languages/ * Domain Path: /languages/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment