Making WordPress.org


Ignore:
Timestamp:
09/09/2016 02:06:26 PM (10 years ago)
Author:
ocean90
Message:

Translate, Plugin Directory: Use class constant for the master project.

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

    r3955 r4018  
    55use GP;
    66use stdClass;
     7use WordPressdotorg\GlotPress\Plugin_Directory\Plugin;
    78use WP_CLI;
    89use WP_CLI_Command;
    910
    1011class Set_Plugin_Project extends WP_CLI_Command {
    11 
    12         /**
    13          * Holds the path of the master project.
    14          *
    15          * @var string
    16          */
    17         private $master_project_path = 'wp-plugins';
    1812
    1913        /**
     
    4337                $plugin_slug         = $args[0];
    4438                $process_type        = $args[1];
    45                 $plugin_project_path = "{$this->master_project_path}/{$plugin_slug}";
     39                $plugin_project_path = Plugin::GP_MASTER_PROJECT . "/{$plugin_slug}";
    4640
    4741                // Get data for master parent project.
    48                 $master_project = GP::$project->by_path( $this->master_project_path );
     42                $master_project = GP::$project->by_path( Plugin::GP_MASTER_PROJECT );
    4943                if ( ! $master_project ) {
    50                         WP_CLI::error( sprintf( "The master project '%s' couldn't be found.", $this->master_project_path ), 2 );
     44                        WP_CLI::error( sprintf( "The master project '%s' couldn't be found.", Plugin::GP_MASTER_PROJECT ), 2 );
    5145                }
    5246
Note: See TracChangeset for help on using the changeset viewer.