public function path( $args, $assoc_args ) {
		$path = untrailingslashit( WP_PLUGIN_DIR );

		if ( ! empty( $args ) ) {
			$plugin = $this->fetcher->get_check( $args[0] );
			$path  .= '/' . $plugin->file;

			if ( Utils\get_flag_value( $assoc_args, 'dir' ) ) {
				$path = dirname( $path );
			}
		}

		WP_CLI::line( $path );
	}
public function path( $args, $assoc_args ) {
		$path = untrailingslashit( WP_PLUGIN_DIR );

		if ( ! empty( $args ) ) {
			$plugin = $this->fetcher->get_check( $args[0] );
			$path  .= '/' . $plugin->file;

			if ( Utils\get_flag_value( $assoc_args, 'dir' ) ) {
				$path = dirname( $path );
			}
		}

		WP_CLI::line( $path );
	}
public function path ( $ args , $ assoc_args ) { $ path = untrailingslashit ( WP_PLUGIN_DIR ) ; if ( ! empty ( $ args ) ) { $ plugin = $ this -> fetcher -> get_check ( $ args [ 0 ] ) ; $ path .= '/' . $ plugin -> file ; if ( Utils \ get_flag_value ( $ assoc_args , 'dir' ) ) { $ path = dirname ( $ path ) ; } } WP_CLI :: line ( $ path ) ; }
Gets the path to a plugin or to the plugin directory.

## OPTIONS

[<plugin>]
: The plugin to get the path to. If not set, will return the path to the
plugins directory.

[--dir]
: If set, get the path to the closest parent directory, instead of the
plugin file.

## EXAMPLES

$ cd $(wp plugin path) && pwd
/var/www/wordpress/wp-content/plugins
Gets the path to a plugin or to the plugin directory .