- This topic has 2 replies, 2 voices, and was last updated 7 years, 5 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › function to insert classes into submit button
Tagged: css classes, V3
Is there, by any chance, a function to add classes to css buttons similar to the one below?
add_filter( 'gform_submit_button', 'add_custom_css_classes', 10, 2 );
function add_custom_css_classes( $button, $form ) {
$dom = new DOMDocument();
$dom->loadHTML( $button );
$input = $dom->getElementsByTagName( 'input' )->item(0);
$classes = $input->getAttribute( 'class' );
$classes .= " edgtf-btn edgtf-btn-huge edgtf-btn-solid";
$input->setAttribute( 'class', $classes );
return $dom->saveHtml( $input );
}
I’m using several other plugins, I’ll be duplicating the same blocks of code several times when I can just use the same existing css classes. My stylesheet will get really bloated. 🙂