[wp-trac] [WordPress Trac] #37057: Creation of an esc_html functions for _n(), _nx(), _ex(), and number_format_i18n()

WordPress Trac noreply at wordpress.org
Thu Jun 9 01:19:48 UTC 2016


#37057: Creation of an esc_html functions for _n(), _nx(), _ex(), and
number_format_i18n()
-----------------------------+------------------------------
 Reporter:  zakkath          |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  General          |     Version:  4.5.2
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:  template
-----------------------------+------------------------------
Description changed by dd32:

Old description:

> Using a lot of the translation functions generates an error using the
> WordPress Coding Standards under PHPCS such as:
>
>  Expected next thing to be an escaping function (see Codex for 'Data
> Validation'), not '_nx'
>
> Certain functions like _x(), _e(), __() all have equivalent esc_html
> functions. But there are no esc_html equivalent for these other
> functions.
>
> Granted one could simply wrap the statements in esc_html(), for the sake
> of consistency and standardization for theme developers, I feel that
> esc_html versions of these functions should be created.

New description:

 Using a lot of the translation functions generates an error using the
 WordPress Coding Standards under PHPCS such as:

  Expected next thing to be an escaping function (see Codex for 'Data
 Validation'), not '_nx'

 Certain functions like `_x()`, `_e()`, `__()` all have equivalent esc_html
 functions. But there are no esc_html equivalent for these other functions.

 Granted one could simply wrap the statements in `esc_html()`, for the sake
 of consistency and standardization for theme developers, I feel that
 esc_html versions of these functions should be created.

--

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37057#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list