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

		$pod_name = $assoc_args['pod'];
		$item     = pods_v( 'item', $assoc_args );

		unset( $assoc_args['pod'] );

		if ( null !== $item ) {
			unset( $assoc_args['item'] );
		}

		$pod = pods( $pod_name, $item, false );

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

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

		if ( ! empty( $assoc_args ) ) {
			$id = 0;

			try {
				$id = $pod->save( $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 saved.', 'pods' ) );
				WP_CLI::line( sprintf( __( 'ID: %s', 'pods' ), $id ) );
			} else {
				WP_CLI::error( __( 'Pod item not saved.', 'pods' ) );
			}
		} else {
			WP_CLI::error( __( 'No data sent for saving.', 'pods' ) );
		}

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

		$pod_name = $assoc_args['pod'];
		$item     = pods_v( 'item', $assoc_args );

		unset( $assoc_args['pod'] );

		if ( null !== $item ) {
			unset( $assoc_args['item'] );
		}

		$pod = pods( $pod_name, $item, false );

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

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

		if ( ! empty( $assoc_args ) ) {
			$id = 0;

			try {
				$id = $pod->save( $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 saved.', 'pods' ) );
				WP_CLI::line( sprintf( __( 'ID: %s', 'pods' ), $id ) );
			} else {
				WP_CLI::error( __( 'Pod item not saved.', 'pods' ) );
			}
		} else {
			WP_CLI::error( __( 'No data sent for saving.', 'pods' ) );
		}

	}
public function save ( $ args , $ assoc_args ) { $ pod_name = $ assoc_args [ 'pod' ] ; $ item = pods_v ( 'item' , $ assoc_args ) ; unset ( $ assoc_args [ 'pod' ] ) ; if ( null !== $ item ) { unset ( $ assoc_args [ 'item' ] ) ; } $ pod = pods ( $ pod_name , $ item , false ) ; if ( ! $ pod -> valid ( ) ) { WP_CLI :: error ( sprintf ( __ ( 'Pod "%s" does not exist.' , 'pods' ) , $ assoc_args [ 'pod' ] ) ) ; } if ( null !== $ item && ! $ pod -> exists ( ) ) { WP_CLI :: error ( sprintf ( __ ( 'Pod "%1$s" item "%2$s" does not exist.' , 'pods' ) , $ assoc_args [ 'pod' ] , $ assoc_args [ 'item' ] ) ) ; } if ( ! empty ( $ assoc_args ) ) { $ id = 0 ; try { $ id = $ pod -> save ( $ 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 saved.' , 'pods' ) ) ; WP_CLI :: line ( sprintf ( __ ( 'ID: %s' , 'pods' ) , $ id ) ) ; } else { WP_CLI :: error ( __ ( 'Pod item not saved.' , 'pods' ) ) ; } } else { WP_CLI :: error ( __ ( 'No data sent for saving.' , 'pods' ) ) ; } }
Save a pod item.

## OPTIONS

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

[--item=<item>]
: The item to save for, it is not used for a settings pod.

--<field>=<value>
: The field => value pair(s) to save.

## EXAMPLES

wp pods save --pod=my_pod --item=123 --my_field_name1=Value2 --my_field_name2="Another Value2"
wp pods save --pod=my_settings_pod --my_option_field_name1=Value --my_option_field_name2="Another Value2"

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