Skip to content

Instantly share code, notes, and snippets.

@mahype
Last active August 26, 2019 16:01
Show Gist options
  • Save mahype/362c0b82dd08c12b54166dccaf1a6b43 to your computer and use it in GitHub Desktop.
Save mahype/362c0b82dd08c12b54166dccaf1a6b43 to your computer and use it in GitHub Desktop.
<?php
/**
* Filters the element wrap classes.
*
* @param array $wrap_classes Array of wrap classes.
* @param Element $element Element object.
*/
function add_element_wrapper_class( $wrapper_classes, $element ) {
// If wanted, selecting a specific element
if( 33 !== $element->id ) {
return $wrapper_classes;
}
$wrapper_classes[] = 'my-css-class';
return $wrapper_classes;
}
add_filter( 'torro_element_wrap_classes', 'add_element_wrapper_class', 10 , 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment