[wp-trac] [WordPress Trac] #34114: Remove the requirement to call load_plugin_textdomain() or load_theme_textdomain()

WordPress Trac noreply at wordpress.org
Sun Jan 3 09:02:44 UTC 2016


#34114: Remove the requirement to call load_plugin_textdomain() or
load_theme_textdomain()
-------------------------------------------------+-------------------------
 Reporter:  johnbillion                          |       Owner:
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Future
Component:  I18N                                 |  Release
 Severity:  normal                               |     Version:
 Keywords:  dev-feedback has-patch has-unit-     |  Resolution:
  tests                                          |     Focuses:
-------------------------------------------------+-------------------------

Comment (by dd32):

 > The main problem here is we'll double the number of file_exists()
 checks, as at the time of call, we don't know whether to look in plugins
 or themes. I think there's a decent way out of this one.

 My thoughts here is that we should pre-cache the files which we know about
 for plugins:
  - Plugins: `glob()` `languages/plugins/` to find out which files exist
 once per pageload, never `file_exists()` just load directly
  - Themes: Can only be one of two, if the textdomain matches
 STYLESHEET/TEMPLATE then just perform the needed `file_exists()` checks
 it's not really worth optimizing this. It could be optimized to not
 performing `file_exists()` and just attempting to read the file (which
 should fail just as fast).

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


More information about the wp-trac mailing list