Skip to content

Instantly share code, notes, and snippets.

@pro-beaver
Created June 13, 2017 05:27
Show Gist options
  • Save pro-beaver/46c2d56fa5efc2d4e10184b5434eb1a2 to your computer and use it in GitHub Desktop.
Save pro-beaver/46c2d56fa5efc2d4e10184b5434eb1a2 to your computer and use it in GitHub Desktop.
/**
* Disable and Hide Animations in Beaver Builder modules
*
* @author Chinmoy K Paul
* @link http://probeaver.com/?p=1697
*
*/
//* Remove Animation option from Beaver Modules
add_filter( 'fl_builder_register_settings_form', function ( $form, $slug ) {
if( $slug == 'module_advanced' ) {
unset($form['sections']['animation']);
}
return $form;
}, 1099, 2);
//* Removing existing animation of Beaver Modules
add_filter( 'fl_builder_module_attributes', function ( $attrs, $module ) {
if ( ! empty( $module->settings->animation ) ) {
$class = join( ' ', $attrs['class'] );
$class = str_replace('fl-animation', '', $class );
$attrs['class'] = explode(' ', $class );
}
unset( $attrs['data-animation-delay'] );
return $attrs;
}, 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment