Skip to content

Remove all scripts hooked into after_wp_tiny_mce#5686

Merged
KingYes merged 1 commit intoelementor:release/2.2.2from
jeherve:fix/conflict-tinymce-hooks
Sep 12, 2018
Merged

Remove all scripts hooked into after_wp_tiny_mce#5686
KingYes merged 1 commit intoelementor:release/2.2.2from
jeherve:fix/conflict-tinymce-hooks

Conversation

@jeherve
Copy link
Copy Markdown
Contributor

@jeherve jeherve commented Sep 6, 2018

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Summary

This PR can be summarized in the following changelog entry:

  • Remove all scripts hooked after the Tiny MCE editor.

Description

Some plugins add their own scripts that depend on Tiny MCE by hooking into the after_wp_tiny_mce hook:
https://developer.wordpress.org/reference/hooks/after_wp_tiny_mce/

This causes some issues when the scripts rely on JavaScript for example.
Since Elementor removed all other enqueues that come on that page, it causes errors. Removing those scripts solves the issue.

Here is an example of such an error:
Automattic/jetpack#9989

Test instructions

This PR can be tested by following these steps:

  1. Use plugin Elementor and Jetpack.
  2. Activate Markdown support in Jetpack (under Jetpack > Settings, search for "Markdown" and activate)
  3. Edit page with Elementor
  4. You should not see any JavaScript errors on the page.

Quality assurance

  • I have tested this code to the best of my abilities
  • I have added unittests to verify the code works as intended
  • Docs have been added / updated (for bug fixes / features)

Some plugins add their own scripts that depend on Tiny MCE by hooking into the `after_wp_tiny_mce` hook:
https://developer.wordpress.org/reference/hooks/after_wp_tiny_mce/

This causes some issues when the scripts rely on JavaScript for example.
Since Elementor removed all other enqueues that come on that page, it causes errors. Removing those scripts solves the issue.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Sep 6, 2018

CLA assistant check
All committers have signed the CLA.

@KingYes KingYes changed the base branch from master to release/2.2.2 September 12, 2018 10:39
@KingYes KingYes merged commit c56477b into elementor:release/2.2.2 Sep 12, 2018
@KingYes
Copy link
Copy Markdown
Member

KingYes commented Sep 12, 2018

Thanks

@jeherve jeherve deleted the fix/conflict-tinymce-hooks branch September 12, 2018 12:44
@jeherve jeherve restored the fix/conflict-tinymce-hooks branch September 12, 2018 12:44
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.

3 participants