Root::version( array $args, array $assoc_args )

Display the version of LifterLMS or the specified LifterLMS add-on.


Description Description

Top ↑

OPTIONS OPTIONS

[] : The slug of the LifterLMS plugin or theme. Default: lifterlms.

Top ↑

EXAMPLES EXAMPLES

# Show the LifterLMS core plugin version
wp llms version

# Show the LifterLMS core plugin version
wp llms version core

# Show an add-on version without the "lifterlms-" prefix.
wp llms version groups

# Show an add-on version with the "lifterlms-" prefix.
wp llms version lifterlms-assignments

Top ↑

Parameters Parameters

$args

(array) (Required) Indexed array of positional command arguments.

$assoc_args

(array) (Required) Associative array of command options.


Top ↑

Return Return

(null)


Top ↑

Source Source

File: libraries/lifterlms-cli/src/Commands/Root.php

	public function version( $args, $assoc_args ) {

		$slug = empty( $args[0] ) ? 'core' : $args[0];
		if ( in_array( $slug, array( 'core', 'lifterlms' ), true ) ) {
			return \WP_CLI::log( llms()->version );
		}

		$addon = $this->get_addon( $slug );
		if ( empty( $addon ) ) {
			return \WP_CLI::error( 'Invalid slug.' );
		}

		if ( $addon->is_installed() ) {
			return \WP_CLI::log( $addon->get_installed_version() );
		}

		return \WP_CLI::error(
			sprintf(
				"The requested add-on is not installed. Run 'wp llms addon install %s.' to install it.",
				$args[0]
			)
		);

	}

Top ↑

Changelog Changelog

Changelog
Version Description
0.0.2 Remove --db option. This will be implemented in a separate command.
0.0.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.