Changeset 37687
- Timestamp:
- 06/11/2016 05:43:17 PM (8 years ago)
- Location:
- trunk/src/wp-admin/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-language-pack-upgrader.php
r37635 r37687 222 222 if ( ! $wp_filesystem->mkdir( $remote_destination, FS_CHMOD_DIR ) ) 223 223 return new WP_Error( 'mkdir_failed_lang_dir', $this->strings['mkdir_failed'], $remote_destination ); 224 225 $language_updates_results = array(); 224 226 225 227 foreach ( $language_updates as $language_update ) { … … 253 255 254 256 // Prevent credentials auth screen from displaying multiple times. 255 if ( false === $result ) 257 if ( false === $result ) { 256 258 break; 257 } 259 } 260 261 $language_updates_results[] = array( 262 'language' => $language_update->language, 263 'type' => $language_update->type, 264 'slug' => isset( $language_update->slug ) ? $language_update->slug : 'default', 265 'version' => $language_update->version, 266 ); 267 } 268 269 // Remove upgrade hooks which are not required for translation updates. 270 remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 ); 271 remove_action( 'upgrader_process_complete', 'wp_version_check' ); 272 remove_action( 'upgrader_process_complete', 'wp_update_plugins' ); 273 remove_action( 'upgrader_process_complete', 'wp_update_themes' ); 274 275 /** This action is documented in wp-admin/includes/class-wp-upgrader.php */ 276 do_action( 'upgrader_process_complete', $this, array( 277 'action' => 'update', 278 'type' => 'translation', 279 'bulk' => true, 280 'translations' => $language_updates_results 281 ) ); 282 283 // Re-add upgrade hooks. 284 add_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 ); 285 add_action( 'upgrader_process_complete', 'wp_version_check' ); 286 add_action( 'upgrader_process_complete', 'wp_update_plugins' ); 287 add_action( 'upgrader_process_complete', 'wp_update_themes' ); 258 288 259 289 $this->skin->bulk_footer(); -
trunk/src/wp-admin/includes/class-wp-upgrader.php
r37558 r37687 763 763 * @since 3.6.0 764 764 * @since 3.7.0 Added to WP_Upgrader::run(). 765 * @since 4.6.0 `$translations` was added as a possible argument to `$hook_extra`. 765 766 * 766 767 * @param WP_Upgrader $this WP_Upgrader instance. In other contexts, $this, might be a 767 * Theme_Upgrader, Plugin_Upgrader or Core_Upgradeinstance.768 * Theme_Upgrader, Plugin_Upgrader, Core_Upgrade, or Language_Pack_Upgrader instance. 768 769 * @param array $hook_extra { 769 770 * Array of bulk item update data. 770 771 * 771 * @type string $action Type of action. Default 'update'. 772 * @type string $type Type of update process. Accepts 'plugin', 'theme', or 'core'. 773 * @type bool $bulk Whether the update process is a bulk update. Default true. 774 * @type array $plugins Array of the basename paths of the plugins' main files. 775 * @type array $themes The theme slugs. 772 * @type string $action Type of action. Default 'update'. 773 * @type string $type Type of update process. Accepts 'plugin', 'theme', 'translation', or 'core'. 774 * @type bool $bulk Whether the update process is a bulk update. Default true. 775 * @type array $plugins Array of the basename paths of the plugins' main files. 776 * @type array $themes The theme slugs. 777 * @type array $translations { 778 * Array of translations update data. 779 * 780 * @type string $language The locale the translation is for. 781 * @type string $type Type of translation. Accepts 'plugin', 'theme', or 'core'. 782 * @type string $slug Text domain the translation is for. The slug of a theme/plugin or 783 * 'default' for core translations. 784 * @type string $version The version of a theme, plugin, or core. 785 * } 776 786 * } 777 787 */
Note: See TracChangeset
for help on using the changeset viewer.