Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#24212 closed defect (bug) (fixed)

Add missing inline docs for esc_attr_x() and esc_html_x()

Reported by: ocean90's profile ocean90 Owned by: nacin's profile nacin
Milestone: 3.7 Priority: normal
Severity: normal Version: 2.8
Component: Inline Docs Keywords: has-patch
Focuses: Cc:

Attachments (5)

24212.diff (1.6 KB) - added by fjarrett 12 years ago.
24212.2.diff (1.6 KB) - added by fjarrett 12 years ago.
24212.3.patch (918 bytes) - added by dimadin 12 years ago.
24212.4.diff (12.5 KB) - added by ericlewis 12 years ago.
24212.5.diff (1.4 KB) - added by ericlewis 12 years ago.

Download all attachments as: .zip

Change History (18)

@fjarrett
12 years ago

#1 @fjarrett
12 years ago

  • Cc fjarrett@… added
  • Keywords has-patch added; needs-patch easy-fix removed

OK I've added inline docs to both functions.

I also spotted an inconsistency with the first argument being named $single which does not match what is used in similar functions nor does it even match what is in the Codex.

http://codex.wordpress.org/Function_Reference/esc_attr_x
http://codex.wordpress.org/Function_Reference/esc_html_x

So in this patch, I've updated the first argument in both functions to correctly use the var name $text.

#2 @ocean90
12 years ago

  • Milestone changed from Awaiting Review to 3.7

#3 @ocean90
12 years ago

Thanks fjarett.

The @since tag should reference 2.8.0 for esc_attr_x ([11103]/[11204]) and 2.9.0 for esc_html_x ([12231]).

@fjarrett
12 years ago

#4 @fjarrett
12 years ago

Good catch, thanks! Updated @since.

#5 @ocean90
12 years ago

  • Keywords commit added

#6 @nacin
12 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 24825:

Inline documentation for esc_attr_x() and esc_html_x(). props fjarrett, fixes #24212.

@dimadin
12 years ago

#7 follow-up: @dimadin
12 years ago

There is a mistake in this documentation since it states that these functions display string while they just return it.

I've changed first sentence based on existing documentation of i18n escaping functions.

#8 in reply to: ↑ 7 @helen
12 years ago

  • Keywords commit removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

@ericlewis
12 years ago

#9 follow-up: @ericlewis
12 years ago

In attachment:24212.4.diff:

  • Changed the description for any text domain variable passed around functions from "Unique identifier for retrieving translated strings." to just "Text domain." as well as all mentions of "domain" to "text domain".
  • Simplified @dimadin's short descriptions of esc_attr_x and esc_html_x - we don't need to know the string won't be translated if there is no translation or a domain is not supplied, that's implied behavior and not documented as such in the rest of the translation functions.

#10 in reply to: ↑ 9 ; follow-up: @DrewAPicture
12 years ago

Replying to ericlewis:

In attachment:24212.4.diff:

  • Changed the description for any text domain variable passed around functions from "Unique identifier for retrieving translated strings." to just "Text domain." as well as all mentions of "domain" to "text domain".
  • Simplified @dimadin's short descriptions of esc_attr_x and esc_html_x - we don't need to know the string won't be translated if there is no translation or a domain is not supplied, that's implied behavior and not documented as such in the rest of the translation functions.

This ticket is specifically about esc_attr_x() and esc_html_x(). I'd suggest submitting your other changes to the l10n.php ticket closed yesterday: #16750

#11 in reply to: ↑ 10 @ericlewis
12 years ago

Replying to DrewAPicture:

This ticket is specifically about esc_attr_x() and esc_html_x(). I'd suggest submitting your other changes to the l10n.php ticket closed yesterday: #16750

Sure, pardon me.

@ericlewis
12 years ago

#12 @ericlewis
12 years ago

attachment:24212.5.diff removes surplus documentation editing that will be moved to #16750

#13 @DrewAPicture
12 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 25493:

Clarify phpdoc descriptions for esc_attr_x() and esc_html_x().

props ericlewis. Fixes #24212.

Note: See TracTickets for help on using tickets.