Skip to content

Commit ffdaf58

Browse files
committed
Try fix for WP 4.9
1 parent 6dd2924 commit ffdaf58

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/WP_CLI/CommandWithUpgrade.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,9 +853,12 @@ protected function _search( $args, $assoc_args ) {
853853
$items = $api->$plural;
854854

855855
// Add `url` for plugin or theme on wordpress.org.
856+
// In older WP versions these used to be objects.
856857
foreach ( $items as $index => $item_object ) {
857858
if ( is_array( $item_object ) ) {
858859
$items[ $index ]['url'] = "https://wordpress.org/{$plural}/{$item_object['slug']}/";
860+
} elseif ( $item_object instanceof \stdClass ) {
861+
$item_object->url = "https://wordpress.org/{$plural}/{$item_object->slug}/";
859862
}
860863
}
861864

0 commit comments

Comments
 (0)