[glotpress-updates] [GlotPress] #374: Rewrite gp_title() to reduce similar strings

GlotPress noreply at wordpress.org
Mon Nov 24 16:59:17 UTC 2014


#374: Rewrite gp_title() to reduce similar strings
-------------------------+-------------------------------------------------
  Reporter:  ramiy       |      Owner:  joostdevalk
      Type:              |     Status:  assigned
  enhancement            |  Milestone:  Awaiting Review
  Priority:  normal      |    Version:
 Component:  General     |   Keywords:  dev-feedback has-patch needs-
Resolution:              |  testing
-------------------------+-------------------------------------------------

Comment (by joostdevalk):

 So the reason I replaced < with < is that it's weird to me why a
 variable setter would encode entities. If you echo them that's what you
 want, but what if you'd use the title in for instance the API?

 If we decide we do want to do that, we should be consistent about it, so
 in these files, the variables thrown into `sprintf()` should be run
 through `esc_html()`:

 * gp-templates/project-branch.php
 * gp-templates/project-edit.php
 * gp-templates/project-mass-create-sets.php
 * gp-templates/project-permissions.php
 * gp-templates/translation-set-edit.php
 * gp-templates/translations.php

 Personally that looks like a LOT of code repetition to me, so I wouldn't
 want that it for that reason either...

 The reason I didn't put `<` in the filter was that in several files the
 `<` is already coded into the title. That's in these files:

 * gp-templates/project-import.php
 * gp-templates/project-mass-create-sets.php
 * gp-templates/project-permissions.php
 * gp-templates/translation-set-edit.php
 * gp-templates/translations.php

 My personal preference would be to replace all of these instances with a
 separator variable, something like `%%sep%%`, that we replace in another
 filter, so people could choose their own separator. That might be a bit
 overkill though, we could also just replace them with `|` or `-` as that
 would be direction independent.

--
Ticket URL: <https://glotpress.trac.wordpress.org/ticket/374#comment:12>
GlotPress <https://glotpress.trac.wordpress.org>
Easy comin', easy goin'


More information about the glotpress-updates mailing list