Making WordPress.org

Changeset 3052


Ignore:
Timestamp:
04/30/2016 09:43:47 AM (10 years ago)
Author:
ocean90
Message:

Translate, Plugin Directory: Create plugin projects on an initial plugin commit.

To fill the details of a new plugin project the plugin API gets used. But the API doesn't return any data until the first commit.
Instead of blocking the further import make this case a warning and provide a mockup which contains the necessary plugin details.

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

    r2881 r3052  
    5252                }
    5353
    54                 // Get plugin details like title and description.
     54                // Get plugin details from the API.
    5555                $plugin_details = $this->get_plugin_details( $plugin_slug );
    5656                if ( ! $plugin_details ) {
    57                         WP_CLI::line( "The plugin API couldn't be reached." );
    58                         exit( 3 );
     57                        WP_CLI::warning( "The plugin API couldn't be reached." );
     58
     59                        /*
     60                         * That's usally the case for the initial commit.
     61                         * Provide a mockup which contains the necessary plugin details.
     62                         */
     63                        $plugin_details = new stdClass();
     64                        $plugin_details->name = $plugin_slug;
     65                        $plugin_details->short_description = '';
     66                        $plugin_details->stable_tag = 'trunk';
    5967                }
    6068
Note: See TracChangeset for help on using the changeset viewer.