classes/cli/PodsAPI_CLI_Command.php
public function export_pod( $args, $assoc_args ) {

		if ( ! PodsInit::$components->is_component_active( 'migrate-packages' ) ) {
			WP_CLI::error( sprintf( __( 'Migrate Package is not activated. Try activating it: %s', 'pods' ), 'wp pods-api activate-component --component=migrate-packages' ) );
		}

		$params = array(
			'pods' => true,
		);

		if ( PodsInit::$components->is_component_active( 'templates' ) ) {
			$params['templates'] = true;
		}

		if ( PodsInit::$components->is_component_active( 'pages' ) ) {
			$params['pages'] = true;
		}

		$file = $assoc_args['file'];

		unset( $assoc_args['file'] );

		$params = array_merge( $params, $assoc_args );

		$data = false;

		try {
			$data = Pods_Migrate_Packages::export( $params );
		} catch ( Exception $e ) {
			WP_CLI::error( sprintf( __( 'Error exporting Pods Package: %s', 'pods' ), $e->getMessage() ) );
		}

		if ( ! empty( $data ) ) {
			// Load PodsMigrate class file for use.
			pods_migrate();

			// Only JSON format is supported for export.
			if ( false === strpos( $file, '.json' ) ) {
				$file .= '.json';
			}

			$export_file = PodsMigrate::export_data_to_file( $file, $data, true );

			if ( $export_file ) {
				WP_CLI::success( sprintf( __( 'Pods Package exported: %s', 'pods' ), $export_file ) );
			} else {
				WP_CLI::error( __( 'Pods Package not exported.', 'pods' ) );
			}
		} else {
			WP_CLI::error( __( 'No Pods Package data found.', 'pods' ) );
		}

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

		if ( ! PodsInit::$components->is_component_active( 'migrate-packages' ) ) {
			WP_CLI::error( sprintf( __( 'Migrate Package is not activated. Try activating it: %s', 'pods' ), 'wp pods-api activate-component --component=migrate-packages' ) );
		}

		$params = array(
			'pods' => true,
		);

		if ( PodsInit::$components->is_component_active( 'templates' ) ) {
			$params['templates'] = true;
		}

		if ( PodsInit::$components->is_component_active( 'pages' ) ) {
			$params['pages'] = true;
		}

		$file = $assoc_args['file'];

		unset( $assoc_args['file'] );

		$params = array_merge( $params, $assoc_args );

		$data = false;

		try {
			$data = Pods_Migrate_Packages::export( $params );
		} catch ( Exception $e ) {
			WP_CLI::error( sprintf( __( 'Error exporting Pods Package: %s', 'pods' ), $e->getMessage() ) );
		}

		if ( ! empty( $data ) ) {
			// Load PodsMigrate class file for use.
			pods_migrate();

			// Only JSON format is supported for export.
			if ( false === strpos( $file, '.json' ) ) {
				$file .= '.json';
			}

			$export_file = PodsMigrate::export_data_to_file( $file, $data, true );

			if ( $export_file ) {
				WP_CLI::success( sprintf( __( 'Pods Package exported: %s', 'pods' ), $export_file ) );
			} else {
				WP_CLI::error( __( 'Pods Package not exported.', 'pods' ) );
			}
		} else {
			WP_CLI::error( __( 'No Pods Package data found.', 'pods' ) );
		}

	}
public function export_pod ( $ args , $ assoc_args ) { if ( ! PodsInit :: $ components -> is_component_active ( 'migrate-packages' ) ) { WP_CLI :: error ( sprintf ( __ ( 'Migrate Package is not activated. Try activating it: %s' , 'pods' ) , 'wp pods-api activate-component --component=migrate-packages' ) ) ; } $ params = array ( 'pods' => true , ) ; if ( PodsInit :: $ components -> is_component_active ( 'templates' ) ) { $ params [ 'templates' ] = true ; } if ( PodsInit :: $ components -> is_component_active ( 'pages' ) ) { $ params [ 'pages' ] = true ; } $ file = $ assoc_args [ 'file' ] ; unset ( $ assoc_args [ 'file' ] ) ; $ params = array_merge ( $ params , $ assoc_args ) ; $ data = false ; try { $ data = Pods_Migrate_Packages :: export ( $ params ) ; } catch ( Exception $ e ) { WP_CLI :: error ( sprintf ( __ ( 'Error exporting Pods Package: %s' , 'pods' ) , $ e -> getMessage ( ) ) ) ; } if ( ! empty ( $ data ) ) { // Load PodsMigrate class file for use. pods_migrate ( ) ; // Only JSON format is supported for export. if ( false === strpos ( $ file , '.json' ) ) { $ file .= '.json' ; } $ export_file = PodsMigrate :: export_data_to_file ( $ file , $ data , true ) ; if ( $ export_file ) { WP_CLI :: success ( sprintf ( __ ( 'Pods Package exported: %s' , 'pods' ) , $ export_file ) ) ; } else { WP_CLI :: error ( __ ( 'Pods Package not exported.' , 'pods' ) ) ; } } else { WP_CLI :: error ( __ ( 'No Pods Package data found.' , 'pods' ) ) ; } }
Export a Pods Package to a file.

## OPTIONS

--file=<file>
: The file to save to including path (defaults to current path).

[--pods=<pods>]
: A comma-separated list of Pods IDs to export (default is all Pods).

[--templates=<templates>]
: A comma-separated list of Pod Template IDs to export (default is all Templates).

[--pages=<pages>]
: A comma-separated list of Pod Page IDs to export (default is all Pod Pages).

## EXAMPLES

wp pods-api export-pod --file="pods-package.json"
wp pods-api export-pod --file="pods-package.json" --pods="book,genre"
wp pods-api export-pod --file="/path/to/pods-package.json" --pods="book,genre"
wp pods-api export-pod --templates="book-single,book-list" --file="pods-package.json"
wp pods-api export-pod --pod-pages="books,books/*" --file="pods-package.json"
wp pods-api export-pod --pods="book,genre" --templates="book-single,book-list" --pod-pages="books,books/*" --file="pods-package.json"

@subcommand export-pod
Export a Pods Package to a file .