Fix: Email Content Editor for 'Delete Inactive Accounts' is not working#408
Open
reygcalantaol wants to merge 2 commits intodevelopfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR ensures the TinyMCE editor loads in the email customizer when using block-based themes by explicitly firing footer scripts.
- Adds a block-theme detection in
customize_controls() - Calls
admin_print_footer_scripts()to initialize TinyMCE under block themes
Comments suppressed due to low confidence (3)
includes/emails/class-wpum-emails-customizer-scripts.php:86
- Instead of manually calling
admin_print_footer_scripts, consider usingwp_enqueue_editor()to load TinyMCE and its dependencies. This aligns with WordPress core APIs and reduces risk of duplicate script outputs.
// This is a workaround to ensure that the tinymce editor is initialized in a block theme.
includes/emails/class-wpum-emails-customizer-scripts.php:87
- [nitpick] Add a comment referencing the related WordPress core issue or the version when block themes stopped loading TinyMCE by default, so future maintainers understand the need for this workaround.
if ( function_exists( 'wp_is_block_theme' ) && wp_is_block_theme() ) {
includes/emails/class-wpum-emails-customizer-scripts.php:87
- Introduce a test to verify that editor scripts are correctly initialized when
wp_is_block_theme()returns true to prevent regression in block-theme contexts.
if ( function_exists( 'wp_is_block_theme' ) && wp_is_block_theme() ) {
Resolve conflict keeping block theme TinyMCE workaround from this branch. Co-Authored-By: Claude Opus 4.6 <[email protected]>
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.
Resolves https://github.com/WPUserManager/wpum-security/issues/71
Summary
Fixes the email content editor (TinyMCE) not loading when a block theme (Full Site Editing) is active. Block-based themes don't load TinyMCE on admin pages outside the site editor, so the WPUM email customizer's rich text editor was blank.
Fix: Detect block themes via
wp_is_block_theme()and manually fireadmin_print_footer_scriptsto initialize TinyMCE.Note: This is a workaround for a WordPress core limitation. It may need revisiting if WP core changes how block themes handle TinyMCE.
Manual Test Plan
Prerequisites
WP_DEBUGenabled to catch any errors1. Test with a block theme
2. Test all email templates
3. Test with WPUM Security addon
4. Verify classic theme still works (regression)
5. Check for console errors
Test Coverage
No WPUnit tests — this is a browser rendering fix (TinyMCE initialization) that can only be verified via E2E or manual testing.
🤖 Generated with Claude Code