Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the wp enqueue media in avatar default filter #218

Merged
merged 1 commit into from
Jun 30, 2023

Conversation

EHLOVader
Copy link
Contributor

@EHLOVader EHLOVader commented Jun 28, 2023

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

Fixed - Address conflicts with other plugins and loading the media API

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.

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

  • I have added tests to cover my change.
  • All new and existing tests pass.

Fixes conflict with plugins in which wp.media is not loaded or correctly working. Elementor page editor specifically fails to function due to this.
@EHLOVader EHLOVader requested a review from faisal-alvi as a code owner June 28, 2023 15:54
@jeffpaul jeffpaul requested review from a team and dkotter and removed request for faisal-alvi and a team June 28, 2023 16:10
@jeffpaul jeffpaul added this to the 2.7.6 milestone Jun 28, 2023
@dkotter
Copy link
Collaborator

dkotter commented Jun 30, 2023

This looks good to me and things test fine without this line of code, so I think we're good to remove this. Thanks!

@dkotter dkotter merged commit 801cc93 into 10up:develop Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WordPress Media API is broken or not initialized while this plugin is active
3 participants