Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
DAnn2012 wants to merge 2 commits into Automattic:trunk
base: trunk
Choose a base branch
Loading
from DAnn2012:patch-3

Conversation

@DAnn2012
Copy link
Contributor

@DAnn2012 DAnn2012 commented Dec 18, 2025

Proposed changes:

This PR updates the checkbox input value by replacing the use of esc_attr__() with esc_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.
  • This change ensures proper translation handling and direct output of the "Yes" value within Jetpack Forms.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

Does this pull request change what data or activity we track or use?

Testing instructions:

Copy link
Contributor

github-actions bot commented Dec 18, 2025
edited
Loading

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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 🤖


@github-actions github-actions bot added [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. OSS Citizen This Pull Request was opened by an Open Source contributor. labels Dec 18, 2025
Copy link
Contributor Author

Hello @manzoorwanijk

When you can, could you take a look at this PR of mine?

Thanks.

Copy link
Contributor

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 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__() with esc_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.

Copy link
Member

simison commented Dec 18, 2025

Oh, this looks like it needs to be tested in Classic editor using TinyMCE 🙃

@simison simison added [Status] Needs Review This PR is ready for review. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot Copilot left review comments

Assignees

No one assigned

Labels

[Feature] Contact Form OSS Citizen This Pull Request was opened by an Open Source contributor. [Package] Forms [Status] Needs Review This PR is ready for review.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /