Ticket #28571: 28571.2.patch
| File 28571.2.patch, 2.1 KB (added by , 12 years ago) |
|---|
-
src/wp-admin/includes/class-wp-upgrader.php
1196 1196 1197 1197 public static function async_upgrade( $upgrader = false ) { 1198 1198 // Avoid recursion. 1199 if ( $upgrader && $upgrader instanceof Language_Pack_Upgrader ) 1199 if ( $upgrader && $upgrader instanceof Language_Pack_Upgrader ) { 1200 1200 return; 1201 } 1201 1202 1203 $disabled = false; // Maybe a constant for translators? 1204 1205 /** 1206 * Filter whether to entirely disable asynchronous translation updates. 1207 * 1208 * There are more fine-grained filters and controls for selective disabling. 1209 * 1210 * @since 4.0.0 1211 * 1212 * @param bool $disabled Whether the async updater should be disabled. 1213 */ 1214 if ( apply_filters( 'async_update_translation_disabled', $disabled ) ) { 1215 return; 1216 } 1217 1202 1218 // Nothing to do? 1203 1219 $language_updates = wp_get_translation_updates(); 1204 if ( ! $language_updates ) 1220 if ( ! $language_updates ) { 1205 1221 return; 1222 } 1206 1223 1224 foreach ( $language_updates as $key => $language_update ) { 1225 $type = $language_update->type; 1226 $update = ! empty( $language_update->autoupdate ); 1227 1228 /** 1229 * Filter whether to asynchronously update translation for core, a plugin, or a theme. 1230 * 1231 * The dynamic portion of the hook name, $type, refers to the type of update 1232 * being checked. Can be 'core', 'theme', or 'plugin'. 1233 * 1234 * @since 4.0.0 1235 * 1236 * @param bool $update Whether to update. 1237 * @param object $language_update The update offer. 1238 */ 1239 $update = apply_filters( 'async_update_translation_for_' . $type, $update, $language_update ); 1240 1241 if ( ! $update ) { 1242 unset( $language_updates[ $key ] ); 1243 } 1244 } 1245 1246 if ( empty( $language_updates ) ) { 1247 return; 1248 } 1249 1207 1250 $skin = new Language_Pack_Upgrader_Skin( array( 1208 1251 'skip_header_footer' => true, 1209 1252 ) ); 1210 1253 1211 1254 $lp_upgrader = new Language_Pack_Upgrader( $skin ); 1212 $lp_upgrader-> upgrade();1255 $lp_upgrader->bulk_upgrade( $language_updates ); 1213 1256 } 1214 1257 1215 1258 public function upgrade_strings() {
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)