Password protected form: Add wp-element-button class#76627
Password protected form: Add wp-element-button class#76627
Conversation
Use the_password_form filter to add the wp-block-button__link and wp-element-button to the form that shows on password protected content.
|
Flaky tests detected in 2abf3a7. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23437766580
|
Since we're not rendering a core/button block, enqueue the button block style. Also: Use wp_theme_get_element_class_name( 'button' ) instead of hard coding wp-element-button directly. If for any reason, the button style is not registered, then don't try to enqueue it.
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Compared to the login/out block, we can't take advantage of the "wp-submit" class because it is not present on the button. |
|
Where would this be updated in Core? |
What?
Closes #61353
For block themes only, but this is easy to change if we want it for all themes.
Adds the wp-block-button__link and wp-element-button classes to the submit button in the form that shows on password protected content.
Why?
To make the button easier to style. With the class added, the button uses the button styles set in theme.json.
So why did I add both classes? Because the form block uses both. 🤷♀️ I thought they should match.
How?
Use the_password_form filter to add the wp-block-button__link and wp-element-button to the form that shows on password protected content.
Testing Instructions
Use of AI Tools
GitHub Copilot came up with the idea to use the WP_HTML_Tag_Processor.