Skip to content

Fixed Function in 3 files#562

Merged
akirk merged 4 commits into
akirk:mainfrom
DAnn2012:patch-1
Mar 4, 2026
Merged

Fixed Function in 3 files#562
akirk merged 4 commits into
akirk:mainfrom
DAnn2012:patch-1

Conversation

@DAnn2012

@DAnn2012 DAnn2012 commented Sep 22, 2025

Copy link
Copy Markdown
Contributor

Fixed Function in 3 files

@DAnn2012 DAnn2012 changed the title Fixed Function in two files Fixed Function in 3 files Sep 22, 2025
@akirk akirk requested a review from Copilot November 9, 2025 17:04
@akirk

akirk commented Nov 9, 2025

Copy link
Copy Markdown
Owner

Thank you!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 corrects the misuse of WordPress translation functions by removing unnecessary echo statements. The translation functions esc_html_e() and esc_attr_e() already echo their output, so using echo with them causes the text to be output twice or in the wrong location.

Key changes:

  • Removed echo before esc_html_e() calls for HTML content (option text, link text)
  • Attempted to remove echo before esc_attr_e() calls for attributes, but introduced bugs by using the wrong function variant
  • Updated multiple template and widget files to use proper WordPress escaping/translation patterns

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
widgets/class-widget-friend-request.php Removed echo from translation functions, but incorrectly used esc_attr_e() where esc_attr__() and esc_html_e() should be used
templates/admin/edit-rules.php Correctly removed echo from esc_html_e() calls in option elements
includes/class-admin.php Correctly removed echo from esc_html_e() calls in link text content

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread widgets/class-widget-friend-request.php
Comment thread widgets/class-widget-friend-request.php Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@DAnn2012

Copy link
Copy Markdown
Contributor Author

Hello @akirk

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

Thanks.

1 similar comment
@DAnn2012

DAnn2012 commented Mar 1, 2026

Copy link
Copy Markdown
Contributor Author

Hello @akirk

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

Thanks.

@akirk akirk merged commit ed186eb into akirk:main Mar 4, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants