Changeset 48445 for trunk/src/wp-admin/includes/ajax-actions.php
- Timestamp:
- 07/12/2020 01:14:01 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r48375 r48445 4463 4463 wp_send_json_error( $status ); 4464 4464 } elseif ( is_array( $result ) && ! empty( $result[ $plugin ] ) ) { 4465 $plugin_update_data = current( $result );4466 4465 4467 4466 /* 4468 * If the `update_plugins` site transient is empty (e.g. when you update 4469 * two plugins in quick succession before the transient repopulates), 4470 * this may be the return. 4467 * Plugin is already at the latest version. 4468 * 4469 * This may also be the return value If the `update_plugins` site transient is empty, 4470 * e.g. when you update two plugins in quick succession before the transient repopulates. 4471 4471 * 4472 4472 * Preferably something can be done to ensure `update_plugins` isn't empty. 4473 4473 * For now, surface some sort of error here. 4474 4474 */ 4475 if ( true === $ plugin_update_data) {4476 $status['errorMessage'] = __( 'Plugin update failed.' );4475 if ( true === $result[ $plugin ] ) { 4476 $status['errorMessage'] = $upgrader->strings['up_to_date']; 4477 4477 wp_send_json_error( $status ); 4478 4478 } … … 4485 4485 $status['newVersion'] = sprintf( __( 'Version %s' ), $plugin_data['Version'] ); 4486 4486 } 4487 4487 4488 wp_send_json_success( $status ); 4488 4489 } elseif ( false === $result ) {
Note: See TracChangeset
for help on using the changeset viewer.