Changeset 33302
- Timestamp:
- 07/17/2015 03:58:23 AM (9 years ago)
- Location:
- branches/4.2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.2
- Property svn:mergeinfo changed
/trunk merged: 32571,32778
- Property svn:mergeinfo changed
-
branches/4.2/src/wp-admin/includes/ajax-actions.php
r33301 r33302 2884 2884 */ 2885 2885 function wp_ajax_update_plugin() { 2886 global $wp_filesystem; 2887 2886 2888 $plugin = urldecode( $_POST['plugin'] ); 2887 2889 … … 2910 2912 wp_update_plugins(); 2911 2913 2912 $upgrader = new Plugin_Upgrader( new Automatic_Upgrader_Skin() ); 2914 $skin = new Automatic_Upgrader_Skin(); 2915 $upgrader = new Plugin_Upgrader( $skin ); 2913 2916 $result = $upgrader->bulk_upgrade( array( $plugin ) ); 2914 2917 2915 if ( is_array( $result ) ) { 2918 if ( is_array( $result ) && empty( $result[$plugin] ) && is_wp_error( $skin->result ) ) { 2919 $result = $skin->result; 2920 } 2921 2922 if ( is_array( $result ) && !empty( $result[ $plugin ] ) ) { 2916 2923 $plugin_update_data = current( $result ); 2917 2924 … … 2939 2946 $status['error'] = $result->get_error_message(); 2940 2947 wp_send_json_error( $status ); 2941 } else if ( is_bool( $result ) && ! $result ) { 2948 2949 } else if ( is_bool( $result ) && ! $result ) { 2942 2950 $status['errorCode'] = 'unable_to_connect_to_filesystem'; 2943 2951 $status['error'] = __( 'Unable to connect to the filesystem. Please confirm your credentials.' ); 2952 2953 // Pass through the error from WP_Filesystem if one was raised 2954 if ( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->get_error_code() ) { 2955 $status['error'] = $wp_filesystem->errors->get_error_message(); 2956 } 2957 2944 2958 wp_send_json_error( $status ); 2959 2945 2960 } 2946 2961 }
Note: See TracChangeset
for help on using the changeset viewer.