[wp-trac] [WordPress Trac] #62244: Just-in-time translation loading for plugins/themes not in the directory

WordPress Trac noreply at wordpress.org
Wed Dec 4 04:10:30 UTC 2024


#62244: Just-in-time translation loading for plugins/themes not in the directory
--------------------------------------+-------------------------
 Reporter:  swissspidy                |       Owner:  swissspidy
     Type:  enhancement               |      Status:  reopened
 Priority:  normal                    |   Milestone:  6.8
Component:  I18N                      |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch needs-dev-note  |     Focuses:
--------------------------------------+-------------------------

Comment (by dd32):

 Replying to [comment:27 peterwilsoncc]:
 > @swissspidy [59479] is causing fatal errors for some plugins

 Without looking at the code, I'm guessing this is the exact same issue as
 above, but for a different function. Probably conditionally looking for
 `is_plugin_active()` and then assuming `get_plugins()` is loaded too.

 It looks like that's indeed the case:
 {{{#!php
                 // Load plugin.php if it's not already loaded.
                 if ( ! function_exists( 'is_plugin_active' ) ) {
                         require_once ABSPATH . 'wp-
 admin/includes/plugin.php';
                 }

                 // Loop through all active plugins and check if
 WooCommerce is active.
                 foreach ( get_plugins() as $plugin_slug => $plugin_data )
 {
 }}}

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


More information about the wp-trac mailing list