Meta_Submodule_Trait::get_form_options( int $form_id )

Retrieves the values for all submodule form options.

Description

Parameters

$form_id

(int) (Required) Form ID.

Return

(array) Associative array of <code>$key => $value</code> pairs for every form option that is set.

Source

File: src/modules/meta-submodule-trait.php

	public function get_form_options( $form_id ) {
		$metadata = $this->module->get_form_options( $form_id );

		$prefix = $this->get_meta_identifier() . '__';

		$options = array();
		foreach ( $metadata as $key => $value ) {
			if ( 0 !== strpos( $key, $prefix ) ) {
				continue;
			}

			$key = substr( $key, strlen( $prefix ) );
			$options[ $key ] = $value;
		}

		return $options;
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.