Make WordPress Core

Ticket #36706: 36706.patch

File 36706.patch, 800 bytes (added by ocean90, 9 years ago)
  • src/wp-admin/includes/plugin.php

     
    9292        $plugin_data['Network'] = ( 'true' == strtolower( $plugin_data['Network'] ) );
    9393        unset( $plugin_data['_sitewide'] );
    9494
     95        // If no text domain is defined fall back to the plugin slug.
     96        if ( ! $plugin_data['TextDomain'] ) {
     97                $plugin_slug = dirname( plugin_basename( $plugin_file ) );
     98                if ( '.' !== $plugin_slug && false === strpos( '/', $plugin_slug ) ) {
     99                        $plugin_data['TextDomain'] = $plugin_slug;
     100                }
     101        }
     102
    95103        if ( $markup || $translate ) {
    96104                $plugin_data = _get_plugin_data_markup_translate( $plugin_file, $plugin_data, $markup, $translate );
    97105        } else {