[wp-trac] [WordPress Trac] #44248: Assignment is confusing: _get_plugin_data_markup_translate function

WordPress Trac noreply at wordpress.org
Mon May 28 12:27:06 UTC 2018


#44248: Assignment is confusing: _get_plugin_data_markup_translate function
------------------------------+-----------------------------
 Reporter:  subrataemfluence  |      Owner:  (none)
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  Plugins           |    Version:  trunk
 Severity:  normal            |   Keywords:  dev-feedback
  Focuses:  coding-standards  |
------------------------------+-----------------------------
 In /wp-admin/includes/plugin.php at line number 127, the assignment is
 made like this:

 {{{#!php
 <?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
 <?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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44248>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list