[wp-trac] [WordPress Trac] #32008: Wrapper method for esc_attr

WordPress Trac noreply at wordpress.org
Fri May 1 02:06:23 UTC 2015


#32008: Wrapper method for esc_attr
------------------------------------------------+------------------
 Reporter:  welcher                             |       Owner:
     Type:  enhancement                         |      Status:  new
 Priority:  normal                              |   Milestone:  4.3
Component:  General                             |     Version:  4.2
 Severity:  normal                              |  Resolution:
 Keywords:  has-patch dev-feedback 2nd-opinion  |     Focuses:
------------------------------------------------+------------------

Comment (by dd32):

 Personally I'm leaning away from adding it.
 * `esc_{type}_e()` is shorter than `echo esc_{type}( __() )` which is why
 it exists
 * `echo_esc_{type}()` isn't any shorter than `echo esc_{type}()` and the
 extra brackets from above are not needed
 * `e_esc_{type}()` or `esc_{type}_echo` is too much like `esc_{type}_e()`,
 and seems like it'll cause confusion even further
 * I don't really like dropping the esc prefix in cases like `echo_attr()`,
 as it's less obvious what the function does, and easy to confuse with
 `echo attr()` in code review

 Is auto-complete by an IDE really worth it here? it's the difference
 between `echo_` and `echo esc` having to be typed for triggering the auto
 complete..

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


More information about the wp-trac mailing list