Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.