[wp-trac] [WordPress Trac] #44541: Text length should be localizable

WordPress Trac noreply at wordpress.org
Tue Jun 11 08:30:18 UTC 2019


#44541: Text length should be localizable
--------------------------------------+--------------------------
 Reporter:  miyauchi                  |       Owner:  johnbillion
     Type:  enhancement               |      Status:  closed
 Priority:  normal                    |   Milestone:  5.3
Component:  I18N                      |     Version:
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+--------------------------

Comment (by johnbillion):

 It's quite difficult to ensure that the default for any filterable value
 is accurate even when it's hard-coded. For example the previously hard-
 coded default of 55 is only the default as long as there isn't also a
 plugin on the site that's filtering that value. In that case, the
 Customizer option could be showing an incorrect default if it's hard-coded
 to 55.

 The best option is to manually call `_x( '55', 'excerpt_length' )` in your
 theme (with an appropriate PHPCS exclusion above it if necessary) and use
 that as the default, but remember that even then your default may be
 incorrect if another plugin is also unconditionally filtering the value.

 In addition, I would question whether the user needs to be aware of the
 default value if the theme provides an option to change this. Presumably
 the option is shown so the user can have fine grained control over excerpt
 lengths according to their layout, in which case a default value is of
 little concern. Off the top of my head I don't recall any setting in
 WordPress that shows the user the "default" for a configurable value.

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


More information about the wp-trac mailing list