Remove the wp enqueue media in avatar default filter #218
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the Change
Fixes conflict with plugins in which wp.media is not loaded or correctly working. Elementor page editor specifically fails to function due to this.
I see that this has been here for a long time, so I'm unsure what might have changed since then, but the Elementor image editor fails to work, doing wp_enqueue_media here appears to be the cause. Although I see that wp_enqueue_media also checks if it has run, so it isn't about enqueuing things twice.
Within the discussions options page the media library works still, I believe the media api is enqueue elsewhere so it will be available here, without having to do it here while the default avatar options are updated.
Closes #217
How to test the Change
Attempting to edit any image prior to this change in Elementor page editor would do nothing.
As well as tell tale console errors about wp.media and the javascript API
After this change testing and media library opens for Elementor image elements.
Further testing the discussions option page, and the default avatar option for local simple avatars is present and working, media library opens up, and assigning an image loads it into the form.
Changelog Entry
Checklist:
I couldn't get the cypress unit tests to run, but it shouldn't require any new tests or affect the tests I see that exist