WordPress.org

Make WordPress Core

Opened 17 months ago

Last modified 9 months ago

#44248 new enhancement

Assignment is confusing: _get_plugin_data_markup_translate function

Reported by: subrataemfluence Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Plugins Keywords: dev-feedback
Focuses: coding-standards Cc:
PR Number:

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 (2)

#1 @subrataemfluence
17 months ago

  • Type changed from defect (bug) to enhancement

#2 @pento
9 months ago

  • Version trunk deleted
Note: See TracTickets for help on using tickets.