-
-
Save smarterdigitalltd/42c424299498e80a6e34167b874b0088 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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