WP_CLI\Fetchers

Base::get_many()publicWP-CLI 1.0

Get multiple items.

Method of the class: Base{}

No Hooks.

Return

Array. The list of found items.

Usage

$Base = new Base();
$Base->get_many( $args );
$args(array) (required)
The raw CLI arguments.

Base::get_many() code WP-CLI 2.8.0-alpha

public function get_many( $args ) {
	$items = [];

	foreach ( $args as $arg ) {
		$item = $this->get( $arg );

		if ( $item ) {
			$items[] = $item;
		} else {
			WP_CLI::warning( sprintf( $this->msg, $arg ) );
		}
	}

	return $items;
}