Skip to content

Instantly share code, notes, and snippets.

View primedime's full-sized avatar

Roy Jossfolk primedime

View GitHub Profile
@zackkatz
zackkatz / gf-number-field-integers.php
Created June 20, 2019 17:27
Only allow integers (whole numbers, including negative values) in Gravity Forms Number field
<?php
/**
* Force number fields to increment by 1
*/
add_filter( 'gform_field_content', function ( $field_content, $field ) {
if ( 'number' !== $field->type ) {
return $field_content;
}