field['msg'] = $this->field['msg'] ?? esc_html__( 'This field must be a valid date.', 'redux-framework' ); $string = str_replace( '/', '', $this->value ); if ( ! is_numeric( $string ) ) { $this->value = ( isset( $this->current ) ) ? $this->current : ''; $this->field['current'] = $this->value; $this->error = $this->field; return; } if ( '/' !== $this->value[2] ) { $this->value = ( isset( $this->current ) ) ? $this->current : ''; $this->field['current'] = $this->value; $this->error = $this->field; return; } if ( '/' !== $this->value[5] ) { $this->value = ( isset( $this->current ) ) ? $this->current : ''; $this->field['current'] = $this->value; $this->error = $this->field; } } } }