# jetformbuilder/3.6.5.3/modules/cli/cli-tools.php

JetFormBuilder — Dynamic Blocks Form Builder, version 3.6.5.3. 32 lines.

- Page: https://pluginprobe.com/plugins/jetformbuilder/3.6.5.3/code/modules/cli/cli-tools.php
- Raw: https://pluginprobe.com/plugins/jetformbuilder/3.6.5.3/raw/modules/cli/cli-tools.php
- Modified: 2023-11-20T11:46:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/jetformbuilder/3.6.5.3/code/modules/cli/cli-tools.php#L10-L20`.

```php
<?php


namespace JFB_Modules\Cli;

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
	die;
}

class Cli_Tools {

	public static function resolve_form( $assoc_args ): \WP_Post {
		$form_id = absint( $assoc_args['form'] ?? 0 );
		$form    = get_post( $form_id );

		if ( $form instanceof \WP_Post ) {
			return $form;
		}

		list( $form ) = get_posts(
			array(
				'numberposts' => 1,
				'post_type'   => jet_form_builder()->post_type->slug(),
			)
		);

		return $form;
	}

}

```
