classes/cli/Pods_CLI_Command.php
public function duplicate( $args, $assoc_args ) {

		$pod = pods( $assoc_args['pod'], $assoc_args['item'], false );

		if ( ! $pod->valid() ) {
			WP_CLI::error( sprintf( __( 'Pod "%s" does not exist.', 'pods' ), $assoc_args['pod'] ) );
		}

		if ( ! $pod->exists() ) {
			WP_CLI::error( sprintf( __( 'Pod "%1$s" item "%2$s" does not exist.', 'pods' ), $assoc_args['pod'], $assoc_args['item'] ) );
		}

		$id = 0;

		try {
			$id = $pod->duplicate( $assoc_args );
		} catch ( Exception $e ) {
			WP_CLI::error( sprintf( __( 'Error saving pod item: %s', 'pods' ), $e->getMessage() ) );
		}

		if ( 0 < $id ) {
			WP_CLI::success( __( 'Pod item duplicated.', 'pods' ) );
			WP_CLI::line( sprintf( __( 'New ID: %s', 'pods' ), $id ) );
		} else {
			WP_CLI::error( __( 'Pod item not duplicated.', 'pods' ) );
		}

	}
public function duplicate( $args, $assoc_args ) {

		$pod = pods( $assoc_args['pod'], $assoc_args['item'], false );

		if ( ! $pod->valid() ) {
			WP_CLI::error( sprintf( __( 'Pod "%s" does not exist.', 'pods' ), $assoc_args['pod'] ) );
		}

		if ( ! $pod->exists() ) {
			WP_CLI::error( sprintf( __( 'Pod "%1$s" item "%2$s" does not exist.', 'pods' ), $assoc_args['pod'], $assoc_args['item'] ) );
		}

		$id = 0;

		try {
			$id = $pod->duplicate( $assoc_args );
		} catch ( Exception $e ) {
			WP_CLI::error( sprintf( __( 'Error saving pod item: %s', 'pods' ), $e->getMessage() ) );
		}

		if ( 0 < $id ) {
			WP_CLI::success( __( 'Pod item duplicated.', 'pods' ) );
			WP_CLI::line( sprintf( __( 'New ID: %s', 'pods' ), $id ) );
		} else {
			WP_CLI::error( __( 'Pod item not duplicated.', 'pods' ) );
		}

	}
public function duplicate ( $ args , $ assoc_args ) { $ pod = pods ( $ assoc_args [ 'pod' ] , $ assoc_args [ 'item' ] , false ) ; if ( ! $ pod -> valid ( ) ) { WP_CLI :: error ( sprintf ( __ ( 'Pod "%s" does not exist.' , 'pods' ) , $ assoc_args [ 'pod' ] ) ) ; } if ( ! $ pod -> exists ( ) ) { WP_CLI :: error ( sprintf ( __ ( 'Pod "%1$s" item "%2$s" does not exist.' , 'pods' ) , $ assoc_args [ 'pod' ] , $ assoc_args [ 'item' ] ) ) ; } $ id = 0 ; try { $ id = $ pod -> duplicate ( $ assoc_args ) ; } catch ( Exception $ e ) { WP_CLI :: error ( sprintf ( __ ( 'Error saving pod item: %s' , 'pods' ) , $ e -> getMessage ( ) ) ) ; } if ( 0 < $ id ) { WP_CLI :: success ( __ ( 'Pod item duplicated.' , 'pods' ) ) ; WP_CLI :: line ( sprintf ( __ ( 'New ID: %s' , 'pods' ) , $ id ) ) ; } else { WP_CLI :: error ( __ ( 'Pod item not duplicated.' , 'pods' ) ) ; } }
Duplicate a pod item.

## OPTIONS

--pod=<pod>
: The pod name.

--item=<item>
: The pod item to delete.

## EXAMPLES

wp pods duplicate --pod=my_pod --item=123

@param $args
@param $assoc_args
Duplicate a pod item .