WPCF7_FormTag::get_first_match_option()
Retrieves the value of the first option matches the given regular expression pattern.
Метод класса: WPCF7_FormTag{}
Хуков нет.
Возвращает
Массив|true|false
. Option value as an array of matched strings. False if there is no option matches the pattern.
Использование
$WPCF7_FormTag = new WPCF7_FormTag(); $WPCF7_FormTag->get_first_match_option( $pattern );
- $pattern(строка) (обязательный)
- Regular expression pattern.
Код WPCF7_FormTag::get_first_match_option() WPCF7 FormTag::get first match option CF7 5.8
public function get_first_match_option( $pattern ) { foreach( (array) $this->options as $option ) { if ( preg_match( $pattern, $option, $matches ) ) { return $matches; } } return false; }