Changeset 10222 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/cli/class-export.php
- Timestamp:
- 08/30/2020 02:05:57 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/cli/class-export.php
r10097 r10222 138 138 139 139 // Find all unique sources this translation originates from. 140 $sources = array_map( function ( $reference ) { 141 $parts = explode( ':', $reference ); 142 $file = $parts[0]; 143 144 if ( substr( $file, -7 ) === '.min.js' ) { 145 return substr( $file, 0, -7 ) . '.js'; 146 } 147 148 if ( substr( $file, -3 ) === '.js' ) { 149 return $file; 150 } 151 152 return 'po'; 153 }, $entry->references ); 154 155 $sources = array_unique( $sources ); 140 if ( ! empty( $entry->references ) ) { 141 $sources = array_map( 142 function ( $reference ) { 143 $parts = explode( ':', $reference ); 144 $file = $parts[0]; 145 146 if ( substr( $file, -7 ) === '.min.js' ) { 147 return substr( $file, 0, -7 ) . '.js'; 148 } 149 150 if ( substr( $file, -3 ) === '.js' ) { 151 return $file; 152 } 153 return 'po'; 154 }, 155 $entry->references 156 ); 157 158 $sources = array_unique( $sources ); 159 } else { 160 $sources = [ 'po' ]; 161 } 156 162 157 163 foreach ( $sources as $source ) {
Note: See TracChangeset
for help on using the changeset viewer.