4. MUST-HAVES
A form that would accept user-submitted nominations
and save them as a custom post type
A voting mechanism for each award category that only
allowed a person to vote once per person per category
13. GRAVITY FORMS +
CUSTOM POST TYPES
Find it WP plugin directory:
wordpress.org/plugins/gravity-forms-custom-post-types/
Better yet, get it from Github*:
github.com/bradvin/gravity-forms-custom-post-types
*No PHP error notices with WP DEBUG on.
21. gform_field_value_[your custom param]
Use this filter for text fields or pre-selection of options in a dropdown, etc. See the offcial docs .here
hostedwith ❤by
function my_city_population_function( $value ){
return 'Vancouver';
}
add_filter( 'gform_field_value_my_city', 'my_city_population_function' );
viewrawDynamicallyPopulateGravityFormsTextField GitHub
25. gform_validation_[your form ID]
hostedwith ❤by
function my_custom_validation( $validation_result ) {
$form = $validation_result["form"];
// Sorry, you don't get to live in Vancouver...
if ( $_POST['input_1'] == 'Vancouver' ) {
$validation_result["is_valid"] = false;
foreach ( $form["fields"] as &$field ) {
// NOTE: Replace 1 with the field you would like to validate
if ( $field["id"] == "1" ) {
$field["failed_validation"] = true;
$field["validation_message"] = "Sorry, you can't enter Vancouver here!";
break;
}
}
}
// Assign modified $form object back to the validation result
$validation_result["form"] = $form;
return $validation_result;
}
add_filter( 'gform_validation_[your form ID]', 'my_custom_validation' );
viewrawGravityFormsCustomValidationExample GitHub
See the offcial docs .here
26. RESTRICT UPLOAD SIZE
There's no way to do this out of the box and you may not
want users uploading 32MB files!
There is a plugin for that, but it's buggy. Instead...
Check out this Gist.