[wp-trac] [WordPress Trac] #38673: Handle languages as 'DISALLOW_FILE_MODS' is activated

WordPress Trac noreply at wordpress.org
Tue Nov 8 20:00:49 UTC 2016


#38673: Handle languages as 'DISALLOW_FILE_MODS' is activated
-------------------------------------------------+-------------------------
 Reporter:  MaximeCulea                          |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  I18N                                 |  Review
 Severity:  normal                               |     Version:  trunk
 Keywords:  dev-feedback needs-patch 2nd-        |  Resolution:
  opinion                                        |     Focuses:
-------------------------------------------------+-------------------------

Comment (by swissspidy):

 Hey there,

 Thanks for your report!

 There are indeed some valid reasons these functions rely on
 `DISALLOW_FILE_MODS`. But before we add another constant, we should rather
 think about introducing a new `wp_disallow_file_mods()` function that
 checks this function and is filterable. Example:

 {{{#!php
 <?php
 function wp_disallow_file_mods() {
     return apply_filters( 'disallow_file_mods', defined(
 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS );
 }
 }}}

 See #37436 for some patches that partly implemented this already.

 This way, one can easily allow file mods under certain circumstances using
 the filter.

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


More information about the wp-trac mailing list