classes/PodsAPI.php
public function save_post( $post_data, $post_meta = null, $strict = false, $sanitized = false, $fields = array() ) {

		$conflicted = pods_no_conflict_check( 'post' );

		if ( ! $conflicted ) {
			pods_no_conflict_on( 'post' );
		}

		if ( ! is_array( $post_data ) || empty( $post_data ) ) {
			$post_data = array( 'post_title' => '' );
		}

		if ( ! is_array( $post_meta ) ) {
			$post_meta = array();
		}

		if ( $sanitized ) {
			$post_data = pods_unsanitize( $post_data );
			$post_meta = pods_unsanitize( $post_meta );
		}

		if ( ! isset( $post_data['ID'] ) || empty( $post_data['ID'] ) ) {
			$post_data['ID'] = wp_insert_post( $post_data, true );
		} elseif ( 2 < count( $post_data ) || ! isset( $post_data['post_type'] ) ) {
			$post_data['ID'] = wp_update_post( $post_data, true );
		}

		if ( is_wp_error( $post_data['ID'] ) ) {
			if ( ! $conflicted ) {
				pods_no_conflict_off( 'post' );
			}

			/**
			 * @var $post_error WP_Error
			 */
			$post_error = $post_data['ID'];

			return pods_error( $post_error->get_error_message(), $this );
		}

		$this->save_post_meta( $post_data['ID'], $post_meta, $strict, $fields );

		if ( ! $conflicted ) {
			pods_no_conflict_off( 'post' );
		}

		return $post_data['ID'];
	}
public function save_post( $post_data, $post_meta = null, $strict = false, $sanitized = false, $fields = array() ) {

		$conflicted = pods_no_conflict_check( 'post' );

		if ( ! $conflicted ) {
			pods_no_conflict_on( 'post' );
		}

		if ( ! is_array( $post_data ) || empty( $post_data ) ) {
			$post_data = array( 'post_title' => '' );
		}

		if ( ! is_array( $post_meta ) ) {
			$post_meta = array();
		}

		if ( $sanitized ) {
			$post_data = pods_unsanitize( $post_data );
			$post_meta = pods_unsanitize( $post_meta );
		}

		if ( ! isset( $post_data['ID'] ) || empty( $post_data['ID'] ) ) {
			$post_data['ID'] = wp_insert_post( $post_data, true );
		} elseif ( 2 < count( $post_data ) || ! isset( $post_data['post_type'] ) ) {
			$post_data['ID'] = wp_update_post( $post_data, true );
		}

		if ( is_wp_error( $post_data['ID'] ) ) {
			if ( ! $conflicted ) {
				pods_no_conflict_off( 'post' );
			}

			/**
			 * @var $post_error WP_Error
			 */
			$post_error = $post_data['ID'];

			return pods_error( $post_error->get_error_message(), $this );
		}

		$this->save_post_meta( $post_data['ID'], $post_meta, $strict, $fields );

		if ( ! $conflicted ) {
			pods_no_conflict_off( 'post' );
		}

		return $post_data['ID'];
	}
public function save_post ( $ post_data , $ post_meta = null , $ strict = false , $ sanitized = false , $ fields = array ( ) ) { $ conflicted = pods_no_conflict_check ( 'post' ) ; if ( ! $ conflicted ) { pods_no_conflict_on ( 'post' ) ; } if ( ! is_array ( $ post_data ) || empty ( $ post_data ) ) { $ post_data = array ( 'post_title' => '' ) ; } if ( ! is_array ( $ post_meta ) ) { $ post_meta = array ( ) ; } if ( $ sanitized ) { $ post_data = pods_unsanitize ( $ post_data ) ; $ post_meta = pods_unsanitize ( $ post_meta ) ; } if ( ! isset ( $ post_data [ 'ID' ] ) || empty ( $ post_data [ 'ID' ] ) ) { $ post_data [ 'ID' ] = wp_insert_post ( $ post_data , true ) ; } elseif ( 2 < count ( $ post_data ) || ! isset ( $ post_data [ 'post_type' ] ) ) { $ post_data [ 'ID' ] = wp_update_post ( $ post_data , true ) ; } if ( is_wp_error ( $ post_data [ 'ID' ] ) ) { if ( ! $ conflicted ) { pods_no_conflict_off ( 'post' ) ; } /**
			 * @var $post_error WP_Error
			 */ $ post_error = $ post_data [ 'ID' ] ; return pods_error ( $ post_error -> get_error_message ( ) , $ this ) ; } $ this -> save_post_meta ( $ post_data [ 'ID' ] , $ post_meta , $ strict , $ fields ) ; if ( ! $ conflicted ) { pods_no_conflict_off ( 'post' ) ; } return $ post_data [ 'ID' ] ; }
Save a post and it's meta

@param array $post_data All post data to be saved (using wp_insert_post / wp_update_post)
@param array $post_meta (optional) All meta to be saved (set value to null to delete)
@param bool  $strict    (optional) Whether to delete previously saved meta not in $post_meta
@param bool  $sanitized (optional) Will unsanitize the data, should be passed if the data is sanitized before
sending.
@param array $fields    (optional) The array of fields and their options, for further processing with

@return mixed|void

@since 2.0.0
Save a post and it s meta