Changeset 49242
- Timestamp:
- 10/20/2020 05:38:59 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-automatic-updater.php
r49166 r49242 349 349 $theme = wp_get_theme( $upgrader_item ); 350 350 $item_name = $theme->Get( 'Name' ); 351 // Add the current version so that it can be reported in the notification email. 352 $item->current_version = $theme->get( 'Version' ); 353 if ( empty( $item->current_version ) ) { 354 $item->current_version = false; 355 } 351 356 /* translators: %s: Theme name. */ 352 357 $skin->feedback( __( 'Updating theme: %s' ), $item_name ); … … 356 361 $plugin_data = get_plugin_data( $context . '/' . $upgrader_item ); 357 362 $item_name = $plugin_data['Name']; 363 // Add the current version so that it can be reported in the notification email. 364 $item->current_version = $plugin_data['Version']; 365 if ( empty( $item->current_version ) ) { 366 $item->current_version = false; 367 } 358 368 /* translators: %s: Plugin name. */ 359 369 $skin->feedback( __( 'Updating plugin: %s' ), $item_name ); … … 1071 1081 1072 1082 foreach ( $failed_updates['plugin'] as $item ) { 1073 $body[] = sprintf( 1074 /* translators: 1: Plugin name, 2: Version number. */ 1075 __( '- %1$s version %2$s' ), 1076 $item->name, 1077 $item->item->new_version 1078 ); 1083 if ( $item->item->current_version ) { 1084 $body[] = sprintf( 1085 /* translators: 1: Plugin name, 2: Current version number, 3: New version number. */ 1086 __( '- %1$s (from version %2$s to %3$s)' ), 1087 $item->name, 1088 $item->item->current_version, 1089 $item->item->new_version 1090 ); 1091 } else { 1092 $body[] = sprintf( 1093 /* translators: 1: Plugin name, 2: Version number. */ 1094 __( '- %1$s version %2$s' ), 1095 $item->name, 1096 $item->item->new_version 1097 ); 1098 } 1079 1099 1080 1100 $past_failure_emails[ $item->item->plugin ] = $item->item->new_version; … … 1089 1109 1090 1110 foreach ( $failed_updates['theme'] as $item ) { 1091 $body[] = sprintf( 1092 /* translators: 1: Theme name, 2: Version number. */ 1093 __( '- %1$s version %2$s' ), 1094 $item->name, 1095 $item->item->new_version 1096 ); 1111 if ( $item->item->current_version ) { 1112 $body[] = sprintf( 1113 /* translators: 1: Theme name, 2: Current version number, 3: New version number. */ 1114 __( '- %1$s (from version %2$s to %3$s)' ), 1115 $item->name, 1116 $item->item->current_version, 1117 $item->item->new_version 1118 ); 1119 } else { 1120 $body[] = sprintf( 1121 /* translators: 1: Theme name, 2: Version number. */ 1122 __( '- %1$s version %2$s' ), 1123 $item->name, 1124 $item->item->new_version 1125 ); 1126 } 1097 1127 1098 1128 $past_failure_emails[ $item->item->theme ] = $item->item->new_version; … … 1112 1142 1113 1143 foreach ( $successful_updates['plugin'] as $item ) { 1114 $body[] = sprintf( 1115 /* translators: 1: Plugin name, 2: Version number. */ 1116 __( '- %1$s version %2$s' ), 1117 $item->name, 1118 $item->item->new_version 1119 ); 1144 if ( $item->item->current_version ) { 1145 $body[] = sprintf( 1146 /* translators: 1: Plugin name, 2: Current version number, 3: New version number. */ 1147 __( '- %1$s (from version %2$s to %3$s)' ), 1148 $item->name, 1149 $item->item->current_version, 1150 $item->item->new_version 1151 ); 1152 } else { 1153 $body[] = sprintf( 1154 /* translators: 1: Plugin name, 2: Version number. */ 1155 __( '- %1$s version %2$s' ), 1156 $item->name, 1157 $item->item->new_version 1158 ); 1159 } 1120 1160 1121 1161 unset( $past_failure_emails[ $item->item->plugin ] ); … … 1130 1170 1131 1171 foreach ( $successful_updates['theme'] as $item ) { 1132 $body[] = sprintf( 1133 /* translators: 1: Theme name, 2: Version number. */ 1134 __( '- %1$s version %2$s' ), 1135 $item->name, 1136 $item->item->new_version 1137 ); 1172 if ( $item->item->current_version ) { 1173 $body[] = sprintf( 1174 /* translators: 1: Theme name, 2: Current version number, 3: New version number. */ 1175 __( '- %1$s (from version %2$s to %3$s)' ), 1176 $item->name, 1177 $item->item->current_version, 1178 $item->item->new_version 1179 ); 1180 } else { 1181 $body[] = sprintf( 1182 /* translators: 1: Theme name, 2: Version number. */ 1183 __( '- %1$s version %2$s' ), 1184 $item->name, 1185 $item->item->new_version 1186 ); 1187 } 1138 1188 1139 1189 unset( $past_failure_emails[ $item->item->theme ] );
Note: See TracChangeset
for help on using the changeset viewer.