$margin_key = "{$label}_custom_margin";
$padding_key = "{$label}_custom_padding";
$multi_view = et_pb_multi_view_options( $module );
$has_margin = '' !== $utils->array_get( $all_values, $margin_key, '' );
$has_padding = '' !== $utils->array_get( $all_values, $padding_key, '' );
$has_margin_hover = $multi_view->hover_is_enabled( $margin_key );
$has_padding_hover = $multi_view->hover_is_enabled( $padding_key );
if ( $has_margin || $has_padding || $has_margin_hover || $has_padding_hover ) {
$settings = $utils->array_get( $form_field, 'margin_padding', array() );
// Ensure main selector exists.
$form_field_margin_padding_css = $utils->array_get( $settings, 'css.main', '' );
if ( empty( $form_field_margin_padding_css ) ) {
$utils->array_set( $settings, 'css.main', $utils->array_get( $form_field, 'css.main', '' ) );
$this->update_styles( $module, $label, $settings, $function_name, $advanced_field );
return new ET_Builder_Module_Field_MarginPadding();