Skip to content

Instantly share code, notes, and snippets.

@smarterdigitalltd
Last active October 12, 2017 11:51
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 smarterdigitalltd/42c424299498e80a6e34167b874b0088 to your computer and use it in GitHub Desktop.
Save smarterdigitalltd/42c424299498e80a6e34167b874b0088 to your computer and use it in GitHub Desktop.
<?php
/**
* The code below can be copied into your theme's functions.php file
*/
add_action( 'wp_enqueue_scripts', function() {
wp_enqueue_script( 'jquery-match-height', '//cdnjs.cloudflare.com/ajax/libs/jquery.matchHeight/0.7.2/jquery.matchHeight-min.js', [ 'jquery' ], null, true );
} );
add_filter( 'fl_builder_register_settings_form', function( $form, $slug ) {
if ( 'module_advanced' === $slug ) {
$form[ 'sections' ][ 'css_selectors' ][ 'fields' ][ 'match_height_group' ] = [
'type' => 'text',
'label' => __( 'Match height group', 'wpd' )
];
}
return $form;
}, 10, 2 );
add_filter( 'fl_builder_module_attributes', function( $attrs, $module ) {
if ( isset( $module->settings->match_height_group ) && ! empty( $module->settings->match_height_group ) ) {
$attrs[ 'data-mh' ] = $module->settings->match_height_group;
}
return $attrs;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment