WPCF7_Submission::get_posted_string()publicCF7 1.0

Retrieves a user input string value through the specified field.

Метод класса: WPCF7_Submission{}

Хуков нет.

Возвращает

Строку. The user input. If the input is an array, the first item in the array.

Использование

$WPCF7_Submission = new WPCF7_Submission();
$WPCF7_Submission->get_posted_string( $name );
$name(строка) (обязательный)
Field name.

Код WPCF7_Submission::get_posted_string() CF7 5.9.3

public function get_posted_string( $name ) {
	$data = $this->get_posted_data( $name );
	$data = wpcf7_array_flatten( $data );

	if ( empty( $data ) ) {
		return '';
	}

	// Returns the first array item.
	return trim( reset( $data ) );
}