WordPress.org

Make WordPress Core

Changeset 36282


Ignore:
Timestamp:
01/13/2016 01:03:21 PM (6 years ago)
Author:
ocean90
Message:

Plugins: In _get_plugin_data_markup_translate() don't reload translations if they're already loaded.

Props jrf.
Fixes #35439.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin.php

    r36124 r36282  
    118118    if ( $translate ) {
    119119        if ( $textdomain = $plugin_data['TextDomain'] ) {
    120             if ( $plugin_data['DomainPath'] )
    121                 load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) . $plugin_data['DomainPath'] );
    122             else
    123                 load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) );
     120            if ( ! is_textdomain_loaded( $textdomain ) ) {
     121                if ( $plugin_data['DomainPath'] ) {
     122                    load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) . $plugin_data['DomainPath'] );
     123                } else {
     124                    load_plugin_textdomain( $textdomain, false, dirname( $plugin_file ) );
     125                }
     126            }
    124127        } elseif ( in_array( basename( $plugin_file ), array( 'hello.php', 'akismet.php' ) ) ) {
    125128            $textdomain = 'default';
Note: See TracChangeset for help on using the changeset viewer.