File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 10
10
11
11
// If we have an API Key, see if we need to change the lists and its options
12
12
mailchimp_sf_change_list_if_necessary ();
13
+
14
+ $ is_list_selected = false ;
13
15
?>
14
16
<div class="wrap">
15
17
<hr class="wp-header-end" />
76
78
</div>
77
79
<?php
78
80
} else {
79
- $ lists = $ lists ['lists ' ];
81
+ $ lists = $ lists ['lists ' ];
82
+ $ option = get_option ( 'mc_list_id ' );
83
+ $ list_ids = array_map (
84
+ function ( $ list ) {
85
+ return $ list ['id ' ];
86
+ },
87
+ $ lists
88
+ );
89
+ $ is_list_selected = in_array ( $ option , $ list_ids , true );
80
90
?>
81
91
<table class="mc-list-select" cellspacing="0">
82
92
<tr class="mc-list-row">
86
96
<option value=""> — <?php esc_html_e ( 'Select A List ' , 'mailchimp ' ); ?> — </option>
87
97
<?php
88
98
foreach ( $ lists as $ list ) {
89
- $ option = get_option ( 'mc_list_id ' );
90
99
?>
91
100
<option value="<?php echo esc_attr ( $ list ['id ' ] ); ?> "<?php selected ( $ list ['id ' ], $ option ); ?> ><?php echo esc_html ( $ list ['name ' ] ); ?> </option>
92
101
<?php
110
119
111
120
<?php
112
121
// Just get out if nothing else matters...
113
- if ( get_option ( ' mc_list_id ' ) === '' ) {
122
+ if ( ! $ is_list_selected ) {
114
123
return ;
115
124
}
116
125
You can’t perform that action at this time.
0 commit comments