Making WordPress.org


Ignore:
Timestamp:
01/18/2016 10:54:10 AM (9 years ago)
Author:
ocean90
Message:

Translate, Plugin Directory: Open source CLI command for importing plugin translations.

See #1352.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-plugin-directory/wporg-gp-plugin-directory.php

    r2275 r2307  
    1818        add_action( 'translation_created', array( $this, 'translation_created' ) );
    1919        add_action( 'translation_saved', array( $this, 'translation_saved' ) );
     20
     21        if ( defined( 'WP_CLI' ) && WP_CLI ) {
     22            $this->register_cli_commands();
     23        }
     24    }
     25
     26    /**
     27     * Registers CLI commands if WP-CLI is loaded.
     28     */
     29    function register_cli_commands() {
     30        require_once __DIR__ . '/cli/import-plugin-translations.php';
     31    #   require_once __DIR__ . '/cli/add-plugin-project.php';
     32
     33        WP_CLI::add_command( 'wporg-translate import-plugin-translations', 'WPorg_GP_CLI_Import_Plugin_Translations' );
     34    #   WP_CLI::add_command( 'wporg-translate add-plugin-project', 'WPorg_GP_CLI_Set_Plugin_Project' );
    2035    }
    2136
Note: See TracChangeset for help on using the changeset viewer.