Make WordPress Core

Opened 7 years ago

Closed 2 years ago

#44248 closed enhancement (duplicate)

Assignment is confusing: _get_plugin_data_markup_translate function

Reported by: subrataemfluence's profile subrataemfluence Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Plugins Keywords:
Focuses: coding-standards Cc:

Description

In /wp-admin/includes/plugin.php at line number 127, the assignment is made like this:

<?php
if ( $textdomain = $plugin_data['TextDomain'] ) {
   ...
} elseif ( 'hello.php' == basename( $plugin_file ) ) {
   $textdomain = 'default';
}

I am confused about this line
if ( $textdomain = $plugin_data['TextDomain'] )

I think it can be rewritten in the following way:

<?php
$textdomain = '';
if( isset( $plugin_data['TextDomain'] ) ) {
   $textdomain = $plugin_data['TextDomain'];
   ...
} elseif ( 'hello.php' == basename( $plugin_file ) ) {
   $textdomain = 'default';
}

Please correct me if my understanding is not correct.

Change History (3)

#1 @subrataemfluence
7 years ago

  • Type changed from defect (bug) to enhancement

#2 @pento
6 years ago

  • Version trunk deleted

#3 @SergeyBiryukov
2 years ago

  • Keywords dev-feedback removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi there, thanks for the ticket! Sorry it took so long for someone to get back to you.

This appears to be resolved in [45583] / #47632.

Note: See TracTickets for help on using tickets.