As described in #182, when using the optimizer feature and running in the Classic Editor, there's a chance for JS errors that can cause conflicts with other features (in this case Yoast SEO).
The problem is we call the method isSavingPost which doesn't natively exist in the Classic Editor. This PR fixes this by adding wp-editor as a dependency to our optimizer script.
Closes #182
How to test the Change
In a clean environment, install the Classic Editor plugin, Yoast SEO and Safe SVG
Add the following code to turn on the optimizer feature: add_filter( 'safe_svg_optimizer_enabled', '__return_true' );
Create a new classic post and you should see a JS error in the console. In addition, the Yoast SEO panel won't load properly
Checkout this PR and ensure that error goes away
If desired, deactivate the Classic Editor plugin and test that things still work properly in the Block Editor
Changelog Entry
Fixed - Ensure we don't throw JS errors in the Classic Editor when the optimizer feature is turned on.
Description of the Change
As described in #182, when using the optimizer feature and running in the Classic Editor, there's a chance for JS errors that can cause conflicts with other features (in this case Yoast SEO).
The problem is we call the method
isSavingPost
which doesn't natively exist in the Classic Editor. This PR fixes this by addingwp-editor
as a dependency to our optimizer script.Closes #182
How to test the Change
add_filter( 'safe_svg_optimizer_enabled', '__return_true' );
Changelog Entry
Credits
Props @dkotter, @turtlepod
Checklist: