WPCF7_SWV_MinDateRule::validate()
Метод класса: WPCF7_SWV_MinDateRule{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
$WPCF7_SWV_MinDateRule = new WPCF7_SWV_MinDateRule(); $WPCF7_SWV_MinDateRule->validate( $context );
- $context (обязательный)
- -
Код WPCF7_SWV_MinDateRule::validate() WPCF7 SWV MinDateRule::validate CF7 5.7.5.1
public function validate( $context ) { $field = $this->get_property( 'field' ); $input = isset( $_POST[$field] ) ? $_POST[$field] : ''; $input = wpcf7_array_flatten( $input ); $input = wpcf7_exclude_blank( $input ); $threshold = $this->get_property( 'threshold' ); if ( ! wpcf7_is_date( $threshold ) ) { return true; } foreach ( $input as $i ) { if ( wpcf7_is_date( $i ) and $i < $threshold ) { return new WP_Error( 'wpcf7_invalid_mindate', $this->get_property( 'error' ) ); } } return true; }