fix: initialize ajax html editor on listing type switch#2854
Merged
Armanul46 merged 2 commits intoMay 17, 2026
Merged
Conversation
Load the WordPress editor runtime on admin add/edit listing screens so AJAX-injected HTML custom fields can initialize even when the initial directory type does not include an editor. Preserve server-rendered wp_editor markup during directory-type swaps and initialize TinyMCE/QuickTags against that markup instead of rebuilding it with wp.editor.initialize(). This keeps the expected Visual toolbar, Code toolbar, Add Media button, and prevents mce_SELRES bookmark markup from leaking into the textarea. Bind the dynamic Visual/Code tabs for Directorist HTML fields and sync editor mode UI after switching.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR Type
What kind of change does this PR introduce?
Description
How to reproduce the issue or how to test the changes
post-new.php?post_type=at_biz_diror edit an existingat_biz_dirlisting.mce_SELRES_*text appears in the textarea.Any linked issues
Fixes #
Checklist