You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
wp7 Paragraph block migration incorrectly copies color classes into className and corrupts textColor when align attribute is present #78719
When opening a post containing a paragraph block with both align and textColor attributes (saved in the pre-WP7 format), the block migration introduced in #73111 #73578 incorrectly copies color classes into the className attribute and replaces the correct textColor value with base.
Why this is a critical bug
Once corrupted, the block is broken in two ways:
Color cannot be changed , has-accent-1-color is now hardcoded in className. Even if the user picks a new color in the editor, the old class stays stuck in the
tag alongside the new one, because className classes are never replaced only added to.
Step-by-step reproduction instructions
1 . Create a post, switch to Code editor and paste following code. (here accent-1 color is default color from 2025 theme )
Switch to Visual editor, open block settings and change color to any custom color.
Observe the text color not changing.
Expected behavior
The align attribute is moved to style.typography.textAlign, textColor is preserved, no className is added:
<!-- wp:paragraph {"style":{"typography":{"textAlign":"left"}},"textColor":"accent-1"} -->
<p class="has-text-align-left has-accent-1-color has-text-color">test</p>
Actual behavior
Color classes are leaked into block className also they are left in P itself :
Additional edge cases found on our production
After investigating affected sites we found two further broken states that occur when users interact with already-corrupted blocks in the editor. Edge case 1: Double color class after changing text color
When a user opens a corrupted block and picks a new color in the editor, the old leaked class stays stuck in className while the new color class is added by the block renderer. Result: two conflicting color classes on the P tag simultaneously.
Here has-accent-1-color is the leaked class from the bad migration, has-accent-3-color is the newly selected color. Both appear on the P simultaneously. The block renders with unpredictable color depending on CSS specificity. The user cannot fix this through the editor UI because className is never cleaned up by the color picker.
Edge case 2: Stuck color class after clearing text color
When a user clears the text color on an already-corrupted block, textColor is removed from attrs but the leaked className remains. The block now has no textColor attribute but still renders with the old color visually, the user cannot remove it.
The color appears cleared in the editor UI (no color selected in the panel) but the P still renders with has-accent-1-color applied. This is a silent visual discrepancy with no way to resolve it without manually editing the block HTML.
Activity
Mamaduka commentedon May 27, 2026
@t-hamano, this is worth fixing and including in the next minor.
bigdigital commentedon May 27, 2026
Additional edge cases found on our production
After investigating affected sites we found two further broken states that occur when users interact with already-corrupted blocks in the editor.
Edge case 1: Double color class after changing text color
When a user opens a corrupted block and picks a new color in the editor, the old leaked class stays stuck in className while the new color class is added by the block renderer. Result: two conflicting color classes on the P tag simultaneously.
Here has-accent-1-color is the leaked class from the bad migration, has-accent-3-color is the newly selected color. Both appear on the P simultaneously. The block renders with unpredictable color depending on CSS specificity. The user cannot fix this through the editor UI because className is never cleaned up by the color picker.
Edge case 2: Stuck color class after clearing text color
When a user clears the text color on an already-corrupted block, textColor is removed from attrs but the leaked className remains. The block now has no textColor attribute but still renders with the old color visually, the user cannot remove it.
The color appears cleared in the editor UI (no color selected in the panel) but the P still renders with has-accent-1-color applied. This is a silent visual discrepancy with no way to resolve it without manually editing the block HTML.