Example #1
0
 /**
  * Imports the post in your GitHub repo
  * into your WordPress blog
  *
  * ## OPTIONS
  *
  * <user_id>
  * : The user ID you'd like to save the commit as
  *
  * ## EXAMPLES
  *
  *     wp wpghs import 1
  *
  * @synopsis <user_id>
  *
  * @param array $args Command arguments.
  */
 public function import($args)
 {
     list($user_id) = $args;
     if (!is_numeric($user_id)) {
         WP_CLI::error(__('Invalid user ID', 'wordpress-github-sync'));
     }
     update_option('_wpghs_export_user_id', (int) $user_id);
     WP_CLI::line(__('Starting import from GitHub.', 'wordpress-github-sync'));
     $this->app->controller()->import_master();
 }