Skip to content

Fix: Email Content Editor for 'Delete Inactive Accounts' is not working#408

Open
reygcalantaol wants to merge 1 commit intodevelopfrom
wpum-security-#71-Email-Content-Editor-for-'Delete-Inactive-Accounts'-is-not-working
Open

Fix: Email Content Editor for 'Delete Inactive Accounts' is not working#408
reygcalantaol wants to merge 1 commit intodevelopfrom
wpum-security-#71-Email-Content-Editor-for-'Delete-Inactive-Accounts'-is-not-working

Conversation

@reygcalantaol
Copy link
Collaborator

Resolves https://github.com/WPUserManager/wpum-security/issues/71

Description

The issue affects all email templates and occurs when a theme uses full site editing with the block editor. This happens because block-based themes do not load TinyMCE on admin pages that aren’t part of the site editing experience.

Testing Instructions

  1. Activate 'WPUM Security" plugin
  2. Navigate to Settigns -> Security -> Cleanup and enable "Delete Inactive Accounts"
  3. Navigate to Users > Email > Customize 'Delete Inactive Accounts'.

Pre-review Checklist

  • Issue and pull request titles are properly formatted.
  • Acceptance criteria have been satisfied and marked in the related issue.
  • Unit tests are included (if applicable).
  • Self-review of code changes has been completed.
  • Self-review of UX changes has been completed.
  • Review has been requested from @polevaultweb.

@polevaultweb polevaultweb requested a review from Copilot July 5, 2025 14:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 using wp_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() ) {

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.

1 participant