Protector::wrap_form_name( string $name_attr )

Wraps a non-prefixed form input name attribute so that it will be properly included the submission POST data.

Description

See also

Parameters

$name_attr

(string) (Required) Form input name.

Return

(string) Wrapped form input name ready to print on an input element.

Source

File: src/modules/protectors/protector.php

	protected function wrap_form_name( $name_attr ) {
		if ( false === strpos( $name_attr, '[' ) ) {
			return 'torro_submission[' . $name_attr . ']';
		}

		$parts = explode( '[', str_replace( ']', '', $name_attr ) );
		return 'torro_submission[' . implode( '][', $parts ) . ']';
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.