Skip to content

Conversation

@DAnn2012
Copy link
Contributor

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:

@github-actions
Copy link
Contributor

github-actions bot commented Dec 18, 2025

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
@DAnn2012
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.

@simison
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

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

Development

Successfully merging this pull request may close these issues.

2 participants