File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -433,7 +433,14 @@ protected function update_many( $args, $assoc_args ) {
433433
434434 // Let the user know the results.
435435 $ num_to_update = count ( $ items_to_update );
436- $ num_updated = count ( array_filter ( $ result ) );
436+ $ num_updated = count (
437+ array_filter (
438+ $ result ,
439+ static function ( $ result ) {
440+ return $ result && ! is_wp_error ( $ result );
441+ }
442+ )
443+ );
437444
438445 if ( $ num_to_update > 0 ) {
439446 if ( ! empty ( $ assoc_args ['format ' ] ) && 'summary ' === $ assoc_args ['format ' ] ) {
@@ -448,9 +455,9 @@ protected function update_many( $args, $assoc_args ) {
448455 'name ' => $ info ['name ' ],
449456 'old_version ' => $ info ['version ' ],
450457 'new_version ' => $ info ['update_version ' ],
451- 'status ' => null !== $ result [ $ info ['update_id ' ] ] ? 'Updated ' : 'Error ' ,
458+ 'status ' => ( null !== $ result [ $ info ['update_id ' ] ] && ! is_wp_error ( $ result [ $ info [ ' update_id ' ] ] ) ) ? 'Updated ' : 'Error ' ,
452459 ];
453- if ( null === $ result [ $ info ['update_id ' ] ] ) {
460+ if ( null === $ result [ $ info ['update_id ' ] ] || is_wp_error ( $ result [ $ info [ ' update_id ' ] ] ) ) {
454461 $ errors ++;
455462 }
456463 }
You can’t perform that action at this time.
0 commit comments