Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
/**
* Add a special class to the 2nd row of Caldera Forms grid layout
*/
add_action( 'caldera_forms_grid_row_class', function($rowClass, $row ){
//change to your desired row number here
if( 2 == $row ){
$rowClass .= ' taco';
}
return $rowClass;
}, 10, 2 );
<?php
/**
* Add a special class for all rows of Caldera Forms grid layout, for a specific field
*/
add_action( 'caldera_forms_grid_row_class', function($rowClass, $row, $config ){
//Change your field ID here
if( 'cf12345' == $config[ 'form_id' ] ){
$rowClass .= ' taco';
}
return $rowClass;
}, 10, 3 );
<?php
/**
* Change the formatting of row ID for Caldera Forms grid layout
*/
add_action( 'caldera_forms_grid_row_id', function($rowID, $row ){
$rowID = 'caldera-taco-' . $row;
return $rowID;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.