WPCF7_Submission::get_posted_string()
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() WPCF7 Submission::get posted string CF7 5.7.5.1
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 ) ); }