Skip to content

Fix invalid inline <style> usage in TOTP provider by moving CSS to user-edit.css#806

Merged
masteradhoc merged 4 commits intoWordPress:masterfrom
masteradhoc:style-totp-file
Feb 24, 2026
Merged

Fix invalid inline <style> usage in TOTP provider by moving CSS to user-edit.css#806
masteradhoc merged 4 commits intoWordPress:masterfrom
masteradhoc:style-totp-file

Conversation

@masteradhoc
Copy link
Collaborator

@masteradhoc masteradhoc commented Feb 22, 2026

Step to achieve #63

What?

This PR removes an inline <style> block from providers/class-two-factor-totp.php and moves the CSS into the user-edit.css stylesheet.

Why?

Inline <style> tags were being output inside a

, which is invalid HTML and triggered validation errors (e.g. "Element <style> not allowed as child of element
" as shown in the screenshot).
Moving the CSS into the existing stylesheet fixes the markup issue and aligns with WordPress best practices for separating presentation from logic.

How?

  • Removed the <style> element from class-two-factor-totp.php.
  • Added the same CSS rules to user-edit.css, which is already enqueued for the appropriate admin screens.

Testing Instructions

  1. Go to Users → Profile or Users → Edit User.
  2. Confirm that the TOTP UI displays correctly.
  3. Validate the HTML to ensure no errors related to <style> tags appear.
  4. Confirm that the styling matches the previous appearance.

Screenshots or screencast

image

Changelog Entry

Fixed – Removed inline <style> from TOTP provider and moved styles to user-edit.css to correct invalid HTML structure.

@github-actions
Copy link

github-actions bot commented Feb 22, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: masteradhoc <masteradhoc@git.wordpress.org>
Co-authored-by: georgestephanis <georgestephanis@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@masteradhoc masteradhoc added this to the 0.16.0 milestone Feb 22, 2026
@masteradhoc masteradhoc self-assigned this Feb 22, 2026
@masteradhoc masteradhoc merged commit fe10ce0 into WordPress:master Feb 24, 2026
28 checks passed
@masteradhoc masteradhoc deleted the style-totp-file branch February 24, 2026 12:01
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.

2 participants