Form::get_elements( array $args = array() )

Returns all elements that belong to the form.

Description

See also

Parameters

$args

(array) (Optional) Additional query arguments.

Default value: array()

Return

(awsmug\Torro_Forms\DB_Objects\Containers\Element_Collection) List of elements.

Source

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

	public function get_elements( $args = array() ) {
		if ( empty( $this->original->ID ) ) {
			return $this->manager->get_child_manager( 'containers' )->get_child_manager( 'elements' )->get_collection( array(), 0, 'objects' );
		}

		$args = wp_parse_args( $args, array(
			'number'  => -1,
			'form_id' => $this->original->ID,
		) );

		return $this->manager->get_child_manager( 'containers' )->get_child_manager( 'elements' )->query( $args );
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.