Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Last active June 14, 2019 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shelob9/3a8cf70d69dca4a0e673efd69a8832f3 to your computer and use it in GitHub Desktop.
Save Shelob9/3a8cf70d69dca4a0e673efd69a8832f3 to your computer and use it in GitHub Desktop.
<?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