'attachment', 'post_status' => 'inherit', 'posts_per_page' => $limit, 'fields' => 'ids', ) ); $indexer = new AssetIndexer(); foreach ( $ids as $id ) { $indexer->index_now( (int) $id ); \WP_CLI::log( 'Indexed attachment ' . $id ); } \WP_CLI::success( sprintf( 'Indexed %d attachments.', count( $ids ) ) ); }; \WP_CLI::add_command( 'frkt index', $index ); \WP_CLI::add_command( 'frkt index', $index ); // Legacy alias. $jobs = static function (): void { $data = ( new JobRepository() )->list( 1, 50 ); foreach ( $data['items'] as $job ) { \WP_CLI::log( sprintf( '#%d %s %s', $job['id'], $job['type'], $job['status'] ) ); } }; \WP_CLI::add_command( 'frkt jobs list', $jobs ); \WP_CLI::add_command( 'frkt jobs list', $jobs ); // Legacy alias. } }