Form_Manager::map_args( array $args )

Maps form arguments to regular post arguments.

Description

See also

Parameters

$args

(array) (Required) Arguments as $property => $value pairs.

Return

(array) Mapped arguments.

Source

File: src/db-objects/forms/form-manager.php

	protected function map_args( $args ) {
		$mapped_args = array();
		foreach ( $args as $property => $value ) {
			switch ( $property ) {
				case 'slug':
					$mapped_args['post_name'] = $value;
					break;
				case 'timestamp':
					$mapped_args['post_date'] = '0000-00-00 00:00:00';
					$mapped_args['post_date_gmt'] = date( 'Y-m-d H:i:s', $value );
					break;
				case 'timestamp_modified':
					$mapped_args['post_modified'] = '0000-00-00 00:00:00';
					$mapped_args['post_modified_gmt'] = date( 'Y-m-d H:i:s', $value );
					break;
				case 'title':
				case 'author':
				case 'status':
					$mapped_args[ 'post_' . $property ] = $value;
			}
		}

		$mapped_args['post_type'] = $this->get_prefix() . 'form';

		return $mapped_args;
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.