请尝试以下代码:
add_filter( \'gform_field_validation\', \'custom_validation\', 10, 4 );
function custom_validation( $result, $value, $form, $field ) {
$arrWhitelist = array(\'XH6D\', \'8U2A\', \'L9D3\');
if ( $result[\'is_valid\'] && !in_array( $value, $arrWhitelist )) {
$result[\'is_valid\'] = false;
$result[\'message\'] = \'Please enter a value less than 10\';
}
return $result;
}
此外,您还可以从
this url地址