Skip to content

Commit 1c8dc27

Browse files
committed
Remove "Remove CSS" settings if it is not checked and Remove "Custom Styling" if it is not enabled.
1 parent d4ba088 commit 1c8dc27

File tree

1 file changed

+69
-60
lines changed

1 file changed

+69
-60
lines changed

views/setup_page.php

Lines changed: 69 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -164,67 +164,76 @@ function ( $ele ) {
164164
</table>
165165
<input type="submit" value="<?php esc_attr_e( 'Update Subscribe Form Settings', 'mailchimp' ); ?>" class="button mailchimp-sf-button small mc-submit" /><br/>
166166

167+
<?php
168+
if ( get_option( 'mc_nuke_all_styles' ) === '1' ) {
169+
?>
170+
<table class="widefat mc-widefat mc-nuke-styling">
171+
<tr><th colspan="2"><?php esc_html_e( 'Remove Mailchimp CSS', 'mailchimp' ); ?></th></tr>
172+
<tr><th><label for="mc_nuke_all_styles"><?php esc_html_e( 'Remove CSS' ); ?></label></th><td><span class="mc-pre-input"></span><input type="checkbox" name="mc_nuke_all_styles" id="mc_nuke_all_styles" <?php checked( get_option( 'mc_nuke_all_styles' ), true ); ?> onclick="showMe('mc-custom-styling')"/><?php esc_html_e( 'This will disable all Mailchimp CSS, so it\'s recommended for WordPress experts only.' ); ?></td></tr>
173+
</table>
174+
<?php
175+
}
167176

168-
<table class="widefat mc-widefat mc-nuke-styling">
169-
<tr><th colspan="2"><?php esc_html_e( 'Remove Mailchimp CSS', 'mailchimp' ); ?></th></tr>
170-
<tr><th><label for="mc_nuke_all_styles"><?php esc_html_e( 'Remove CSS' ); ?></label></th><td><span class="mc-pre-input"></span><input type="checkbox" name="mc_nuke_all_styles" id="mc_nuke_all_styles" <?php checked( get_option( 'mc_nuke_all_styles' ), true ); ?> onclick="showMe('mc-custom-styling')"/><?php esc_html_e( 'This will disable all Mailchimp CSS, so it\'s recommended for WordPress experts only.' ); ?></td></tr>
171-
</table>
172-
173-
<table class="widefat mc-widefat mc-custom-styling" id="mc-custom-styling" style="<?php echo esc_attr( ( get_option( 'mc_nuke_all_styles' ) === '1' ? 'display:none;' : '' ) ); ?>">
174-
<tr>
175-
<th colspan="2"><?php esc_html_e( 'Custom Styling', 'mailchimp' ); ?></th>
176-
</tr>
177-
<tr>
178-
<th>
179-
<label for="mc_custom_style"><?php esc_html_e( 'Enabled?', 'mailchimp' ); ?></label>
180-
</th>
181-
<td>
182-
<span class="mc-pre-input"></span>
183-
<input type="checkbox" name="mc_custom_style" id="mc_custom_style"<?php checked( get_option( 'mc_custom_style' ), 'on' ); ?> />
184-
<em><?php esc_html_e( 'Edit the default Mailchimp CSS style.' ); ?></em>
185-
</td>
186-
</tr>
187-
<tr>
188-
<th>
189-
<label for="mc_form_border_width"><?php esc_html_e( 'Border Width (px)', 'mailchimp' ); ?></label>
190-
</th>
191-
<td>
192-
<input type="text" id="mc_form_border_width" name="mc_form_border_width" size="3" maxlength="3" value="<?php echo esc_attr( get_option( 'mc_form_border_width' ) ); ?>"/>
193-
<em><?php esc_html_e( 'Set to 0 for no border, do not enter', 'mailchimp' ); ?> px</em>
194-
</td>
195-
</tr>
196-
<tr>
197-
<th>
198-
<label for="mc_form_border_color"><?php esc_html_e( 'Border Color', 'mailchimp' ); ?></label>
199-
</th>
200-
<td>
201-
<span class="mc-pre-input">#</span>
202-
<input type="text" id="mc_form_border_color" name="mc_form_border_color" size="7" maxlength="6" value="<?php echo esc_attr( get_option( 'mc_form_border_color' ) ); ?>"/>
203-
<em><?php esc_html_e( 'Do not enter initial', 'mailchimp' ); ?> <strong>#</strong></em>
204-
</td>
205-
</tr>
206-
<tr>
207-
<th>
208-
<label for="mc_form_text_color"><?php esc_html_e( 'Text Color', 'mailchimp' ); ?></label>
209-
</th>
210-
<td>
211-
<span class="mc-pre-input">#</span>
212-
<input type="text" id="mc_form_text_color" name="mc_form_text_color" size="7" maxlength="6" value="<?php echo esc_attr( get_option( 'mc_form_text_color' ) ); ?>"/>
213-
<em><?php esc_html_e( 'Do not enter initial', 'mailchimp' ); ?> <strong>#</strong></em>
214-
</td>
215-
</tr>
216-
<tr class="last-row">
217-
<th>
218-
<label for="mc_form_background"><?php esc_html_e( 'Background Color', 'mailchimp' ); ?></label>
219-
</th>
220-
<td>
221-
<span class="mc-pre-input">#</span>
222-
<input type="text" id="mc_form_background" name="mc_form_background" size="7" maxlength="6" value="<?php echo esc_attr( get_option( 'mc_form_background' ) ); ?>"/>
223-
<em><?php esc_html_e( 'Do not enter initial', 'mailchimp' ); ?> <strong>#</strong></em>
224-
</td>
225-
</tr>
226-
</table>
227-
<input type="submit" value="<?php esc_attr_e( 'Update Subscribe Form Settings', 'mailchimp' ); ?>" class="button mailchimp-sf-button small mc-submit" /><br/>
177+
if ( 'on' === get_option( 'mc_custom_style' ) ) {
178+
?>
179+
<table class="widefat mc-widefat mc-custom-styling" id="mc-custom-styling" style="<?php echo esc_attr( ( get_option( 'mc_nuke_all_styles' ) === '1' ? 'display:none;' : '' ) ); ?>">
180+
<tr>
181+
<th colspan="2"><?php esc_html_e( 'Custom Styling', 'mailchimp' ); ?></th>
182+
</tr>
183+
<tr>
184+
<th>
185+
<label for="mc_custom_style"><?php esc_html_e( 'Enabled?', 'mailchimp' ); ?></label>
186+
</th>
187+
<td>
188+
<span class="mc-pre-input"></span>
189+
<input type="checkbox" name="mc_custom_style" id="mc_custom_style"<?php checked( get_option( 'mc_custom_style' ), 'on' ); ?> />
190+
<em><?php esc_html_e( 'Edit the default Mailchimp CSS style.' ); ?></em>
191+
</td>
192+
</tr>
193+
<tr>
194+
<th>
195+
<label for="mc_form_border_width"><?php esc_html_e( 'Border Width (px)', 'mailchimp' ); ?></label>
196+
</th>
197+
<td>
198+
<input type="text" id="mc_form_border_width" name="mc_form_border_width" size="3" maxlength="3" value="<?php echo esc_attr( get_option( 'mc_form_border_width' ) ); ?>"/>
199+
<em><?php esc_html_e( 'Set to 0 for no border, do not enter', 'mailchimp' ); ?> px</em>
200+
</td>
201+
</tr>
202+
<tr>
203+
<th>
204+
<label for="mc_form_border_color"><?php esc_html_e( 'Border Color', 'mailchimp' ); ?></label>
205+
</th>
206+
<td>
207+
<span class="mc-pre-input">#</span>
208+
<input type="text" id="mc_form_border_color" name="mc_form_border_color" size="7" maxlength="6" value="<?php echo esc_attr( get_option( 'mc_form_border_color' ) ); ?>"/>
209+
<em><?php esc_html_e( 'Do not enter initial', 'mailchimp' ); ?> <strong>#</strong></em>
210+
</td>
211+
</tr>
212+
<tr>
213+
<th>
214+
<label for="mc_form_text_color"><?php esc_html_e( 'Text Color', 'mailchimp' ); ?></label>
215+
</th>
216+
<td>
217+
<span class="mc-pre-input">#</span>
218+
<input type="text" id="mc_form_text_color" name="mc_form_text_color" size="7" maxlength="6" value="<?php echo esc_attr( get_option( 'mc_form_text_color' ) ); ?>"/>
219+
<em><?php esc_html_e( 'Do not enter initial', 'mailchimp' ); ?> <strong>#</strong></em>
220+
</td>
221+
</tr>
222+
<tr class="last-row">
223+
<th>
224+
<label for="mc_form_background"><?php esc_html_e( 'Background Color', 'mailchimp' ); ?></label>
225+
</th>
226+
<td>
227+
<span class="mc-pre-input">#</span>
228+
<input type="text" id="mc_form_background" name="mc_form_background" size="7" maxlength="6" value="<?php echo esc_attr( get_option( 'mc_form_background' ) ); ?>"/>
229+
<em><?php esc_html_e( 'Do not enter initial', 'mailchimp' ); ?> <strong>#</strong></em>
230+
</td>
231+
</tr>
232+
</table>
233+
<input type="submit" value="<?php esc_attr_e( 'Update Subscribe Form Settings', 'mailchimp' ); ?>" class="button mailchimp-sf-button small mc-submit" /><br/>
234+
<?php
235+
}
236+
?>
228237

229238
<table class="widefat mc-widefat">
230239
<tr><th colspan="2"><?php esc_html_e( 'List Options', 'mailchimp' ); ?></th></tr>

0 commit comments

Comments
 (0)