Skip to content

Commit

Permalink
Merge pull request #92 from wp-cli/enforce-php74-compat
Browse files Browse the repository at this point in the history
Enforce PHP 7.4 compatibility in Travis CI
  • Loading branch information
schlessera committed Apr 18, 2020
2 parents 11145eb + fd8c338 commit 57af4db
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/WP_CLI/CommandWithTranslation.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,16 @@ protected function get_all_languages( $slug = null ) {
$args['slug'] = $slug;

if ( 'plugins' === $this->obj_type ) {
$plugins = get_plugins( '/' . $slug );
$plugin_data = array_shift( $plugins );
$args['version'] = $plugin_data['Version'];
$plugins = get_plugins( '/' . $slug );
$plugin_data = array_shift( $plugins );
if ( isset( $plugin_data['Version'] ) ) {
$args['version'] = $plugin_data['Version'];
}
} elseif ( 'themes' === $this->obj_type ) {
$theme_data = wp_get_theme( $slug );
$args['version'] = $theme_data['Version'];
$theme_data = wp_get_theme( $slug );
if ( isset( $theme_data['Version'] ) ) {
$args['version'] = $theme_data['Version'];
}
}
}

Expand Down

0 comments on commit 57af4db

Please sign in to comment.