Skip to content

Instantly share code, notes, and snippets.

View pkostadinov-2create's full-sized avatar

Plamen Kostadinov pkostadinov-2create

  • 2create
  • Varna, Bulgaria
View GitHub Profile
@pkostadinov-2create
pkostadinov-2create / gist:66b101636c6cc19e6a9c
Created October 2, 2014 14:17
Gravity Forms Validation Fix
/**
* Custom Gravity Forms validation - make sure the form isn't submitted with the default values
* Useful for when your Gravity Form is displaying default values instead of the field labels.
*
* In order to apply the function to a specif form, please append _1 ( _2 .. ) to the 'gform_validation' hook.
* Example (gform_validation_1)
*
* @return validation results
*/
add_filter( 'gform_validation', 'crb_validate_gravity_default_values' );
<?php
$a = array('rund' => '2', 'group' => '3', 'kupon' => 'utre', 'tralala' => 'shtur_kupon');
$b = array('grund' => '2', 'group' => 'ww', 'soup' => '1', 'tralala' => 'fd');
function two_arrays_merge_all_values(array $a, array $b) {
foreach ($b as $b_key => $b_value) {
$last_index_a = count($a)-1;
$current_index = 0;
foreach ($a as $a_key => $a_value) {
<?php
$a = array('rund' => '2', 'group' => '3', 'kupon' => 'utre', 'tralala' => 'shtur_kupon');
$b = array('grund' => '2', 'group' => 'ww', 'soup' => '1', 'tralala' => 'fd');
function two_arrays_merge_all_values(array $a, array $b) {
foreach ($b as $b_key => $b_value) {
$last_index_a = count($a)-1;
$current_index = 0;
foreach ($a as $a_key => $a_value) {
<?php
add_action('gform_field_content', 'crb_gform_second_column', 10, 5);
function crb_gform_second_column($field_content, $field, $value, $zero, $form_id) {
# The condition might be different depending on the choosen method
if($field->cssClass == 'column_end' || $field->type=='section') {
$field_content .= "</ul><ul id='gform_fields_$form_id' class='gform_fields right'>";
}
return $field_content;