-
Notifications
You must be signed in to change notification settings - Fork 843
Replace esc_attr__ with esc_attr_e in checkbox input value #46354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 |
|
Hello @manzoorwanijk When you can, could you take a look at this PR of mine? Thanks. |
There was a problem hiding this 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 fixes a bug in the Jetpack Forms checkbox input by replacing esc_attr__() with esc_attr_e() for the checkbox value attribute. The original code would have resulted in an empty value attribute because esc_attr__() returns the translated string without echoing it.
- Replaced
esc_attr__()withesc_attr_e()to properly output the translated "Yes" value in the checkbox input's value attribute
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| projects/packages/forms/src/contact-form/class-editor-view.php | Fixed the checkbox input value attribute to use esc_attr_e() which echoes the translated string, ensuring the "Yes" value is properly output |
| projects/packages/forms/changelog/replace-escape-function-in-checkbox-input-value | Added changelog entry documenting this patch-level change |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Oh, this looks like it needs to be tested in Classic editor using TinyMCE 🙃 |
Proposed changes:
This PR updates the checkbox input value by replacing the use of
esc_attr__()withesc_attr_e().esc_attr__()returns a translated string but does not output it directly.esc_attr_e()both translates and immediately echoes the string, which is the intended behavior in this context.Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions: