Changeset 6535
- Timestamp:
- 02/04/2018 03:01:50 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/cli/class-set-plugin-project.php
r6533 r6535 49 49 // Get plugin details from the API. 50 50 $plugin_details = $this->get_plugin_details( $plugin_slug ); 51 51 52 if ( ! $plugin_details ) { 52 53 WP_CLI::warning( "The plugin API couldn't be reached." ); … … 64 65 // Fill details with old data in case the API is down. 65 66 $plugin_details = new stdClass(); 66 $plugin_details->name = $plugin_project->name ;67 $plugin_details->short_description = $plugin_project->description;67 $plugin_details->name = $plugin_project->name ?: $plugin_slug; 68 $plugin_details->short_description = str_replace( "<br><br><a href='https://wordpress.org/plugins/{$plugin_slug}'>WordPress.org Plugin Page</a>", '', $plugin_project->description ); 68 69 $plugin_details->stable_tag = 'trunk'; 69 70 } … … 283 284 $details = $json && '{' == $json[0] ? json_decode( $json ) : null; 284 285 286 if ( isset( $details->error ) ) { 287 return null; 288 } 289 285 290 return $details; 286 291 }
Note: See TracChangeset
for help on using the changeset viewer.