Ejemplo n.º 1
0
 protected function status_single($args)
 {
     $theme = $this->fetcher->get_check($args[0]);
     $status = $this->format_status($this->get_status($theme), 'long');
     $version = $theme->get('Version');
     if ($this->has_update($theme->get_stylesheet())) {
         $version .= ' (%gUpdate available%n)';
     }
     echo WP_CLI::colorize(\WP_CLI\Utils\mustache_render('theme-status.mustache', array('slug' => $theme->get_stylesheet(), 'status' => $status, 'version' => $version, 'name' => $theme->get('Name'), 'author' => $theme->get('Author'))));
 }
Ejemplo n.º 2
0
 protected function status_single($args)
 {
     $plugin = $this->fetcher->get_check($args[0]);
     $file = $plugin->file;
     $details = $this->get_details($file);
     $status = $this->format_status($this->get_status($file), 'long');
     $version = $details['Version'];
     if ($this->has_update($file)) {
         $version .= ' (%gUpdate available%n)';
     }
     echo WP_CLI::colorize(\WP_CLI\Utils\mustache_render('plugin-status.mustache', array('slug' => Utils\get_plugin_name($file), 'status' => $status, 'version' => $version, 'name' => $details['Name'], 'author' => $details['Author'], 'description' => $details['Description'])));
 }
Ejemplo n.º 3
0
 /**
  * Display the WordPress version.
  *
  * ## OPTIONS
  *
  * [--extra]
  * : Show extended version information.
  *
  * @when before_wp_load
  */
 public function version($args = array(), $assoc_args = array())
 {
     $versions_path = ABSPATH . 'wp-includes/version.php';
     if (!is_readable($versions_path)) {
         WP_CLI::error("This does not seem to be a WordPress install.\n" . "Pass --path=`path/to/wordpress` or run `wp core download`.");
     }
     include $versions_path;
     // @codingStandardsIgnoreStart
     if (isset($assoc_args['extra'])) {
         if (preg_match('/(\\d)(\\d+)-/', $tinymce_version, $match)) {
             $human_readable_tiny_mce = $match[1] . '.' . $match[2];
         } else {
             $human_readable_tiny_mce = '';
         }
         echo \WP_CLI\Utils\mustache_render('versions.mustache', array('wp-version' => $wp_version, 'db-version' => $wp_db_version, 'mce-version' => $human_readable_tiny_mce ? "{$human_readable_tiny_mce} ({$tinymce_version})" : $tinymce_version));
     } else {
         WP_CLI::line($wp_version);
     }
     // @codingStandardsIgnoreEnd
 }
Ejemplo n.º 4
0
 /**
  * Display the WordPress version.
  *
  * ## OPTIONS
  *
  * [--extra]
  * : Show extended version information.
  *
  * @when before_wp_load
  */
 public function version($args = array(), $assoc_args = array())
 {
     $details = self::get_wp_details();
     // @codingStandardsIgnoreStart
     if (\WP_CLI\Utils\get_flag_value($assoc_args, 'extra')) {
         if (preg_match('/(\\d)(\\d+)-/', $details['tinymce_version'], $match)) {
             $human_readable_tiny_mce = $match[1] . '.' . $match[2];
         } else {
             $human_readable_tiny_mce = '';
         }
         echo \WP_CLI\Utils\mustache_render('versions.mustache', array('wp-version' => $details['wp_version'], 'db-version' => $details['wp_db_version'], 'mce-version' => $human_readable_tiny_mce ? "{$human_readable_tiny_mce} ({$details['tinymce_version']})" : $details['tinymce_version']));
     } else {
         WP_CLI::line($details['wp_version']);
     }
     // @codingStandardsIgnoreEnd
 }