# stockpack/3.7.0/src/class-stockpackcli.php

StockPack – Stock photos and AI images from Unsplash, Adobe Stock, Freepik and more, version 3.7.0. 25 lines.

- Page: https://pluginprobe.com/plugins/stockpack/3.7.0/code/src/class-stockpackcli.php
- Raw: https://pluginprobe.com/plugins/stockpack/3.7.0/raw/src/class-stockpackcli.php
- Modified: 2020-07-06T06:45:22+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/stockpack/3.7.0/code/src/class-stockpackcli.php#L10-L20`.

```php
<?php

/**
 * Class StockpackCli
 *
 * Handle Cli commands for stockpack
 */
class StockpackCLI {
    public function __construct() {

        // example constructor called when plugin loads

    }

    public function update_token( $args, $assoc_args ) {
        global $stockpack;

        list( $token ) = $args;
        $stockpack->admin->set_api_key($token);

        WP_CLI::success( $token.__(' set as token for the StockPack plugin!','stockpack') );

    }
}

```
