items = $items; foreach ( $items as $item ) { $this->push( $item ); } } /** * Runs a callback function on all the collection items and returns the results. * * This is just a wrapper around the `array_map` method. * * @since 4.9.5 * * @param callable $callback The callback to run on each collection item. * * @return array An array of results returned by running the callback on all * collection items. */ public function map( $callback ) { return array_map( $callback, $this->items ); } }