Skip to content

Commit

Permalink
Only add our wrapping container if custom before and after widget fie…
Browse files Browse the repository at this point in the history
…lds don't exist. This prevents an extra layer around a normal widget
  • Loading branch information
dkotter committed Jun 28, 2024
1 parent 44e8fb5 commit 378a4be
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions mailchimp_widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ function mailchimp_sf_signup_form( $args = array() ) {

// See if we have valid Merge Vars
if ( ! is_array( $mv ) ) {
echo '<div class="mc_container">';
echo wp_kses_post( $before_widget );
if ( ! empty( $before_widget ) ) {
echo wp_kses_post( $before_widget );
} else {
echo '<div class="mc_container">';
}
?>
<div class="mc_error_msg">
<?php
Expand All @@ -40,15 +43,18 @@ function mailchimp_sf_signup_form( $args = array() ) {
?>
</div>
<?php
echo wp_kses_post( $after_widget );
echo '</div>';
if ( ! empty( $after_widget ) ) {
echo wp_kses_post( $after_widget );
} else {
echo '</div>';
}
return;
}

echo '<div class="mc_container">';

if ( ! empty( $before_widget ) ) {
echo wp_kses_post( $before_widget );
} else {
echo '<div class="mc_container">';
}

$header = get_option( 'mc_header_content' );
Expand Down Expand Up @@ -278,9 +284,9 @@ function mailchimp_sf_signup_form( $args = array() ) {
<?php
if ( ! empty( $after_widget ) ) {
echo wp_kses_post( $after_widget );
} else {
echo '</div>';
}

echo '</div>';
}

/**
Expand Down

0 comments on commit 378a4be

Please sign in to comment.