Skip to content

Instantly share code, notes, and snippets.

View Cozmoz's full-sized avatar

Costa Gauci Cozmoz

View GitHub Profile
@eolant
eolant / filters.php
Last active March 24, 2021 10:46
Contact form 7 Bootstrap 4 custom radio and checkbox buttons filter to remove spans and change HTML structure
/**
* Adjust contact form 7 radios and checkboxes to match bootstrap 4 custom radio structure.
*/
add_filter('wpcf7_form_elements', function ($content) {
$content = preg_replace('/<label><input type="(checkbox|radio)" name="(.*?)" value="(.*?)" \/><span class="wpcf7-list-item-label">/i', '<label class="custom-control custom-\1"><input type="\1" name="\2" value="\3" class="custom-control-input"><span class="wpcf7-list-item-label custom-control-label">', $content);
return $content;
});
@ayamflow
ayamflow / gist:b602ab436ac9f05660d9c15190f4fd7b
Created May 9, 2016 19:10
Safari border-radius + overflow: hidden + CSS transform fix
// Add on element with overflow
-webkit-mask-image: -webkit-radial-gradient(white, black);