Changeset 6533 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/inc/cli/class-set-plugin-project.php
- Timestamp:
- 02/04/2018 11:26:05 AM (9 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
r5384 r6533 45 45 } 46 46 47 $plugin_project = GP::$project->by_path( $plugin_project_path ); 48 47 49 // Get plugin details from the API. 48 50 $plugin_details = $this->get_plugin_details( $plugin_slug ); … … 50 52 WP_CLI::warning( "The plugin API couldn't be reached." ); 51 53 52 /* 53 * That's usally the case for the initial commit. 54 * Provide a mockup which contains the necessary plugin details. 55 */ 56 $plugin_details = new stdClass(); 57 $plugin_details->name = $plugin_slug; 58 $plugin_details->short_description = ''; 59 $plugin_details->stable_tag = 'trunk'; 54 if ( ! $plugin_project ) { 55 /* 56 * That's usally the case for the initial commit. 57 * Provide a mockup which contains the necessary plugin details. 58 */ 59 $plugin_details = new stdClass(); 60 $plugin_details->name = $plugin_slug; 61 $plugin_details->short_description = ''; 62 $plugin_details->stable_tag = 'trunk'; 63 } else { 64 // Fill details with old data in case the API is down. 65 $plugin_details = new stdClass(); 66 $plugin_details->name = $plugin_project->name; 67 $plugin_details->short_description = $plugin_project->description; 68 $plugin_details->stable_tag = 'trunk'; 69 } 60 70 } 61 71 … … 68 78 'active' => 1, 69 79 ); 70 71 $plugin_project = GP::$project->by_path( $plugin_project_path );72 80 73 81 // Is this a new or an existing project?
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)