<?php
function custom_remove_container_width( $fields ) {
foreach ( (array) $fields['style'] as $index =>
$rule ) { unset( $fields['style'][$index] );
}
return $fields;
}
add_filter( 'builder_filter_container_outer_wrapper_attributes', 'custom_remove_container_width', 20 );
function custom_remove_module_width( $fields ) {
/* add module specific rules here */
foreach ( (array) $fields['attributes']['style'] as $index =>
$rule ) { unset( $fields['attributes']['style'][$index] );
}
return $fields;
}
add_filter( 'builder_module_filter_outer_wrapper_attributes', 'custom_remove_module_width', 20 );
function custom_add_open_module_wrapper( $fields ) {
$width = apply_filters( 'builder_get_container_width', 0 );
echo "<div class='builder-module-limit-width-wrapper clearfix' style='width:{$width}px;margin:0 auto;'>\n";
}
function custom_add_close_module_wrapper( $fields ) {
}
add_action( 'builder_module_render_contents', 'custom_add_open_module_wrapper', 0 );
add_action( 'builder_module_render_contents', 'custom_add_close_module_wrapper', 20 );
?>