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

		$pod_name = $assoc_args['pod'];

		unset( $assoc_args['pod'] );

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

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

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

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

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

		$pod_name = $assoc_args['pod'];

		unset( $assoc_args['pod'] );

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

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

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

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

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

## OPTIONS

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

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

## EXAMPLES

wp pods add --pod=my_pod --my_field_name1=Value --my_field_name2="Another Value"

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