@@ -210,6 +210,10 @@ |
||
210 | 210 | * before continuing |
211 | 211 | * @since 6.0.0 |
212 | 212 | */ |
213 | + |
|
214 | + /** |
|
215 | + * @param string $type |
|
216 | + */ |
|
213 | 217 | public function was_checkbox_checked( $type ) { |
214 | 218 | // was sign-up checkbox checked - return the value |
215 | 219 | return ( isset( $_POST[ 'yikes_mailchimp_checkbox_'.$type ] ) && $_POST[ 'yikes_mailchimp_checkbox_'.$type ] == 1 ); |
@@ -94,10 +94,10 @@ discard block |
||
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
97 | - * Get the checkbox for the given integration and render it on the front end |
|
98 | - * @return string |
|
99 | - * @since 6.0.0 |
|
100 | - */ |
|
97 | + * Get the checkbox for the given integration and render it on the front end |
|
98 | + * @return string |
|
99 | + * @since 6.0.0 |
|
100 | + */ |
|
101 | 101 | public function yikes_get_checkbox() { |
102 | 102 | // enqueue our checkbox styles whenever the checkbox is displayed |
103 | 103 | wp_enqueue_style( 'yikes-easy-mailchimp-checkbox-integration-styles', plugin_dir_url( __FILE__ ) . '../css/yikes-inc-easy-mailchimp-checkbox-integration.min.css' ); |
@@ -175,9 +175,9 @@ discard block |
||
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
178 | - * Build merge varaibles array |
|
179 | - * @since 6.0.0 |
|
180 | - */ |
|
178 | + * Build merge varaibles array |
|
179 | + * @since 6.0.0 |
|
180 | + */ |
|
181 | 181 | public function user_merge_vars( WP_User $user ) { |
182 | 182 | // start with user_login as name, since that's always known |
183 | 183 | $merge_vars = array( |
@@ -217,10 +217,10 @@ discard block |
||
217 | 217 | |
218 | 218 | |
219 | 219 | /** |
220 | - * Alter the registraton complete message |
|
221 | - * if the registration form checkbox integration is toggled on |
|
222 | - * @since 6.0.0 |
|
223 | - **/ |
|
220 | + * Alter the registraton complete message |
|
221 | + * if the registration form checkbox integration is toggled on |
|
222 | + * @since 6.0.0 |
|
223 | + **/ |
|
224 | 224 | public function yikes_reg_complete_msg( $errors, $redirect_to ) { |
225 | 225 | if( isset( $errors->errors['registered'] ) ) { |
226 | 226 | $email_error = get_option( 'yikes_register_subscription_error' , '' ); |
@@ -239,8 +239,8 @@ discard block |
||
239 | 239 | unset( $tmp ); |
240 | 240 | delete_option( 'yikes_register_subscription_error' ); |
241 | 241 | } |
242 | - } |
|
243 | - return $errors; |
|
242 | + } |
|
243 | + return $errors; |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | } |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | */ |
6 | 6 | |
7 | 7 | // Prevent direct access to the file |
8 | - defined('ABSPATH') or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!" , 'yikes-inc-easy-mailchimp-extender' ) ); |
|
8 | + defined( 'ABSPATH' ) or die( __( "Whoops, you shouldn't be accessing this file directly. Abort!", 'yikes-inc-easy-mailchimp-extender' ) ); |
|
9 | 9 | |
10 | 10 | class Yikes_Easy_MC_Checkbox_Integration_Class { |
11 | 11 | |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | if ( empty( $checkbox_options ) ) { |
49 | 49 | return false; |
50 | 50 | } |
51 | - if ( ! isset( $checkbox_options[ $type ] ) || ! isset( $checkbox_options[ $type ]['associated-list'] ) ) { |
|
51 | + if ( ! isset( $checkbox_options[ $type ] ) || ! isset( $checkbox_options[ $type ][ 'associated-list' ] ) ) { |
|
52 | 52 | return false; |
53 | 53 | } |
54 | 54 | |
55 | - return $this->is_user_subscribed( $email, $checkbox_options[ $type ]['associated-list'] ); |
|
55 | + return $this->is_user_subscribed( $email, $checkbox_options[ $type ][ 'associated-list' ] ); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $data = $response->get_error_data(); |
75 | 75 | |
76 | 76 | // If the error response is a 404, they are not subscribed. |
77 | - if ( isset( $data['status'] ) && 404 == $data['status'] ) { |
|
77 | + if ( isset( $data[ 'status' ] ) && 404 == $data[ 'status' ] ) { |
|
78 | 78 | return false; |
79 | 79 | } else { |
80 | 80 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | } |
91 | 91 | |
92 | 92 | // Look at the status from the API |
93 | - return 'subscribed' == $response['status']; |
|
93 | + return 'subscribed' == $response[ 'status' ]; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
@@ -102,17 +102,17 @@ discard block |
||
102 | 102 | // enqueue our checkbox styles whenever the checkbox is displayed |
103 | 103 | wp_enqueue_style( 'yikes-easy-mailchimp-checkbox-integration-styles', plugin_dir_url( __FILE__ ) . '../css/yikes-inc-easy-mailchimp-checkbox-integration.min.css' ); |
104 | 104 | // store our options |
105 | - $checkbox_options = get_option( 'optin-checkbox-init' , '' ); |
|
106 | - if( isset( $checkbox_options[$this->type]['associated-list'] ) && $checkbox_options[$this->type]['associated-list'] != '-' ) { |
|
107 | - $checked = ( $checkbox_options[$this->type]['precheck'] == 'true' ) ? 'checked' : ''; |
|
105 | + $checkbox_options = get_option( 'optin-checkbox-init', '' ); |
|
106 | + if ( isset( $checkbox_options[ $this->type ][ 'associated-list' ] ) && $checkbox_options[ $this->type ][ 'associated-list' ] != '-' ) { |
|
107 | + $checked = ( $checkbox_options[ $this->type ][ 'precheck' ] == 'true' ) ? 'checked' : ''; |
|
108 | 108 | // before checkbox HTML (comment, ...) |
109 | 109 | $before = '<!-- Easy Forms for MailChimp by YIKES, Inc. - https://www.yikesinc.com/ -->'; |
110 | 110 | $before .= apply_filters( 'yikes-mailchimp-before-checkbox-html', '' ); |
111 | 111 | // checkbox |
112 | 112 | $content = '<p id="yikes-easy-mailchimp-' . $this->type . '-checkbox" class="yikes-easy-mailchimp-' . $this->type . '-checkbox">'; |
113 | 113 | $content .= '<label>'; |
114 | - $content .= '<input type="checkbox" name="yikes_mailchimp_checkbox_' . $this->type . '" value="1" '. $checked . ' /> '; |
|
115 | - $content .= ( isset( $checkbox_options[$this->type]['label'] ) && trim( $checkbox_options[$this->type]['label'] ) != '' ) ? trim( $checkbox_options[$this->type]['label'] ) : __( 'Sign me up for your mailing list.', 'yikes-inc-easy-mailchimp-extender' ); |
|
114 | + $content .= '<input type="checkbox" name="yikes_mailchimp_checkbox_' . $this->type . '" value="1" ' . $checked . ' /> '; |
|
115 | + $content .= ( isset( $checkbox_options[ $this->type ][ 'label' ] ) && trim( $checkbox_options[ $this->type ][ 'label' ] ) != '' ) ? trim( $checkbox_options[ $this->type ][ 'label' ] ) : __( 'Sign me up for your mailing list.', 'yikes-inc-easy-mailchimp-extender' ); |
|
116 | 116 | $content .= '</label>'; |
117 | 117 | $content .= '</p>'; |
118 | 118 | // after checkbox HTML (..., honeypot, closing comment) |
@@ -136,20 +136,20 @@ discard block |
||
136 | 136 | $options = get_option( 'optin-checkbox-init', '' ); |
137 | 137 | |
138 | 138 | // Make sure we have a list ID. |
139 | - if ( ! isset( $options[ $type ] ) || ! isset( $options[ $type ]['associated-list'] ) ) { |
|
139 | + if ( ! isset( $options[ $type ] ) || ! isset( $options[ $type ][ 'associated-list' ] ) ) { |
|
140 | 140 | // @todo: Throw some kind of error? |
141 | 141 | return; |
142 | 142 | } |
143 | 143 | |
144 | 144 | // Check for an IP address. |
145 | - $user_ip = sanitize_text_field( $_SERVER['REMOTE_ADDR'] ); |
|
146 | - if ( isset( $merge_vars['OPTIN_IP'] ) ) { |
|
147 | - $user_ip = sanitize_text_field( $merge_vars['OPTIN_IP'] ); |
|
145 | + $user_ip = sanitize_text_field( $_SERVER[ 'REMOTE_ADDR' ] ); |
|
146 | + if ( isset( $merge_vars[ 'OPTIN_IP' ] ) ) { |
|
147 | + $user_ip = sanitize_text_field( $merge_vars[ 'OPTIN_IP' ] ); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | // Build our data |
151 | - $list_id = $options[ $type ]['associated-list']; |
|
152 | - $interests = isset( $options[ $type ]['interest-groups'] ) ? $options[ $type ]['interest-groups'] : array(); |
|
151 | + $list_id = $options[ $type ][ 'associated-list' ]; |
|
152 | + $interests = isset( $options[ $type ][ 'interest-groups' ] ) ? $options[ $type ][ 'interest-groups' ] : array(); |
|
153 | 153 | $id = md5( $email ); |
154 | 154 | $data = array( |
155 | 155 | 'email_address' => sanitize_email( $email ), |
@@ -183,15 +183,15 @@ discard block |
||
183 | 183 | $merge_vars = array( |
184 | 184 | 'NAME' => $user->user_login, |
185 | 185 | ); |
186 | - if( '' !== $user->first_name ) { |
|
187 | - $merge_vars['NAME'] = $user->first_name; |
|
188 | - $merge_vars['FNAME'] = $user->first_name; |
|
186 | + if ( '' !== $user->first_name ) { |
|
187 | + $merge_vars[ 'NAME' ] = $user->first_name; |
|
188 | + $merge_vars[ 'FNAME' ] = $user->first_name; |
|
189 | 189 | } |
190 | - if( '' !== $user->last_name ) { |
|
191 | - $merge_vars['LNAME'] = $user->last_name; |
|
190 | + if ( '' !== $user->last_name ) { |
|
191 | + $merge_vars[ 'LNAME' ] = $user->last_name; |
|
192 | 192 | } |
193 | - if( '' !== $user->first_name && '' !== $user->last_name ) { |
|
194 | - $merge_vars['NAME'] = sprintf( '%s %s', $user->first_name, $user->last_name ); |
|
193 | + if ( '' !== $user->first_name && '' !== $user->last_name ) { |
|
194 | + $merge_vars[ 'NAME' ] = sprintf( '%s %s', $user->first_name, $user->last_name ); |
|
195 | 195 | } |
196 | 196 | /** |
197 | 197 | * @filter `yikes-mailchimp-user-merge-vars` |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | */ |
213 | 213 | public function was_checkbox_checked( $type ) { |
214 | 214 | // was sign-up checkbox checked - return the value |
215 | - return ( isset( $_POST[ 'yikes_mailchimp_checkbox_'.$type ] ) && $_POST[ 'yikes_mailchimp_checkbox_'.$type ] == 1 ); |
|
215 | + return ( isset( $_POST[ 'yikes_mailchimp_checkbox_' . $type ] ) && $_POST[ 'yikes_mailchimp_checkbox_' . $type ] == 1 ); |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | |
@@ -222,15 +222,15 @@ discard block |
||
222 | 222 | * @since 6.0.0 |
223 | 223 | **/ |
224 | 224 | public function yikes_reg_complete_msg( $errors, $redirect_to ) { |
225 | - if( isset( $errors->errors['registered'] ) ) { |
|
226 | - $email_error = get_option( 'yikes_register_subscription_error' , '' ); |
|
227 | - if( isset( $email_error ) && $email_error != '' ) { |
|
225 | + if ( isset( $errors->errors[ 'registered' ] ) ) { |
|
226 | + $email_error = get_option( 'yikes_register_subscription_error', '' ); |
|
227 | + if ( isset( $email_error ) && $email_error != '' ) { |
|
228 | 228 | // Use the magic __get method to retrieve the errors array: |
229 | 229 | $tmp = $errors->errors; |
230 | 230 | $old = 'Registration complete. Please check your e-mail.'; |
231 | - foreach( $tmp['registered'] as $index => $msg ) { |
|
232 | - if( $msg === $old ) { |
|
233 | - $tmp['registered'][$index] = $old . ' <p class="message"><strong>' . __( 'Note' , 'yikes-inc-easy-mailchimp-extender' ) . '</strong>: ' . $email_error . '</p>'; |
|
231 | + foreach ( $tmp[ 'registered' ] as $index => $msg ) { |
|
232 | + if ( $msg === $old ) { |
|
233 | + $tmp[ 'registered' ][ $index ] = $old . ' <p class="message"><strong>' . __( 'Note', 'yikes-inc-easy-mailchimp-extender' ) . '</strong>: ' . $email_error . '</p>'; |
|
234 | 234 | } |
235 | 235 | } |
236 | 236 | // Use the magic __set method to override the errors property: |
@@ -1,14 +1,14 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | $form_data = array( |
3 | - 'field_name' => $_POST['field_name'], |
|
4 | - 'group_id' => $_POST['group_id'], |
|
5 | - 'field_type' => $_POST['field_type'], |
|
6 | - 'list_id' => $_POST['list_id'], |
|
3 | + 'field_name' => $_POST[ 'field_name' ], |
|
4 | + 'group_id' => $_POST[ 'group_id' ], |
|
5 | + 'field_type' => $_POST[ 'field_type' ], |
|
6 | + 'list_id' => $_POST[ 'list_id' ], |
|
7 | 7 | ); |
8 | 8 | |
9 | 9 | $list_helper = yikes_get_mc_api_manager()->get_list_handler(); |
10 | 10 | |
11 | -$interest_groupings = $list_helper->get_interest_categories( $form_data['list_id'] ); |
|
11 | +$interest_groupings = $list_helper->get_interest_categories( $form_data[ 'list_id' ] ); |
|
12 | 12 | if ( is_wp_error( $interest_groupings ) ) { |
13 | 13 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
14 | 14 | $error_logging->maybe_write_to_log( |
@@ -28,17 +28,17 @@ discard block |
||
28 | 28 | |
29 | 29 | |
30 | 30 | // find and return the location of this merge field in the array |
31 | -$index = $this->findMCListIndex( $form_data['group_id'], $interest_groupings, 'id' ); |
|
31 | +$index = $this->findMCListIndex( $form_data[ 'group_id' ], $interest_groupings, 'id' ); |
|
32 | 32 | $field_data = $interest_groupings[ $index ]; |
33 | -$groups = wp_list_pluck( $field_data['items'], 'name' ); |
|
33 | +$groups = wp_list_pluck( $field_data[ 'items' ], 'name' ); |
|
34 | 34 | |
35 | 35 | |
36 | 36 | ?> |
37 | -<section class="draggable" id="<?php echo $form_data['group_id']; ?>"> |
|
37 | +<section class="draggable" id="<?php echo $form_data[ 'group_id' ]; ?>"> |
|
38 | 38 | <!-- top --> |
39 | 39 | <a href="#" class="expansion-section-title settings-sidebar"> |
40 | - <span class="dashicons dashicons-plus" title="<?php _e( 'Expand Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>"></span><?php echo stripslashes( $form_data['field_name'] ); ?> |
|
41 | - <span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $form_data['field_type']; ?></small></span> |
|
40 | + <span class="dashicons dashicons-plus" title="<?php _e( 'Expand Field', 'yikes-inc-easy-mailchimp-extender' ); ?>"></span><?php echo stripslashes( $form_data[ 'field_name' ] ); ?> |
|
41 | + <span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $form_data[ 'field_type' ]; ?></small></span> |
|
42 | 42 | </a> |
43 | 43 | <!-- expansion section --> |
44 | 44 | <div class="yikes-mc-settings-expansion-section"> |
@@ -46,16 +46,16 @@ discard block |
||
46 | 46 | <!-- Single or Double Opt-in --> |
47 | 47 | <p class="type-container"><!-- necessary to prevent skipping on slideToggle(); --> |
48 | 48 | <!-- store the label --> |
49 | - <input type="hidden" name="field[<?php echo $form_data['group_id']; ?>][label]" value="<?php echo $form_data['field_name']; ?>" /> |
|
50 | - <input type="hidden" name="field[<?php echo $form_data['group_id']; ?>][type]" value="<?php echo $form_data['field_type']; ?>" /> |
|
51 | - <input type="hidden" name="field[<?php echo $form_data['group_id']; ?>][group_id]" value="<?php echo $form_data['group_id']; ?>" /> |
|
52 | - <input type="hidden" name="field[<?php echo $form_data['group_id']; ?>][groups]" value='<?php echo str_replace( '\'' , '~' , json_encode( $groups ) ); ?>' /> |
|
49 | + <input type="hidden" name="field[<?php echo $form_data[ 'group_id' ]; ?>][label]" value="<?php echo $form_data[ 'field_name' ]; ?>" /> |
|
50 | + <input type="hidden" name="field[<?php echo $form_data[ 'group_id' ]; ?>][type]" value="<?php echo $form_data[ 'field_type' ]; ?>" /> |
|
51 | + <input type="hidden" name="field[<?php echo $form_data[ 'group_id' ]; ?>][group_id]" value="<?php echo $form_data[ 'group_id' ]; ?>" /> |
|
52 | + <input type="hidden" name="field[<?php echo $form_data[ 'group_id' ]; ?>][groups]" value='<?php echo str_replace( '\'', '~', json_encode( $groups ) ); ?>' /> |
|
53 | 53 | |
54 | 54 | |
55 | 55 | <table class="form-table form-field-container"> |
56 | 56 | |
57 | 57 | <!-- Default Value --> |
58 | - <?php switch( $form_data['field_type'] ) { |
|
58 | + <?php switch ( $form_data[ 'field_type' ] ) { |
|
59 | 59 | |
60 | 60 | default: |
61 | 61 | case 'radio': |
@@ -63,20 +63,20 @@ discard block |
||
63 | 63 | <tr valign="top"> |
64 | 64 | <td scope="row"> |
65 | 65 | <label for="placeholder"> |
66 | - <?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
66 | + <?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
67 | 67 | </label> |
68 | 68 | </td> |
69 | 69 | <td> |
70 | 70 | <?php |
71 | - foreach ( $field_data['items'] as $id => $interest_group ) { |
|
72 | - $pre_selected = ! empty( $field_data['default_choice'] ) ? $field_data['default_choice'] : '0'; |
|
71 | + foreach ( $field_data[ 'items' ] as $id => $interest_group ) { |
|
72 | + $pre_selected = ! empty( $field_data[ 'default_choice' ] ) ? $field_data[ 'default_choice' ] : '0'; |
|
73 | 73 | ?> |
74 | - <input type="radio" name="field[<?php echo $form_data['group_id']; ?>][default_choice][]" value="<?php echo esc_attr( $id ); ?>" <?php checked( $pre_selected, $id ); ?>><?php echo stripslashes( $interest_group['name'] ); ?> |
|
74 | + <input type="radio" name="field[<?php echo $form_data[ 'group_id' ]; ?>][default_choice][]" value="<?php echo esc_attr( $id ); ?>" <?php checked( $pre_selected, $id ); ?>><?php echo stripslashes( $interest_group[ 'name' ] ); ?> |
|
75 | 75 | <?php |
76 | 76 | |
77 | 77 | } |
78 | 78 | ?> |
79 | - <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
79 | + <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
80 | 80 | </td> |
81 | 81 | </tr> |
82 | 82 | |
@@ -88,19 +88,19 @@ discard block |
||
88 | 88 | <tr valign="top"> |
89 | 89 | <td scope="row"> |
90 | 90 | <label for="placeholder"> |
91 | - <?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
91 | + <?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
92 | 92 | </label> |
93 | 93 | </td> |
94 | 94 | <td> |
95 | 95 | <?php |
96 | - foreach ( $field_data['items'] as $id => $interest_group ) { |
|
97 | - $pre_selected = ! empty( $field_data['default_choice'] ) ? $field_data['default_choice'] : '0'; |
|
96 | + foreach ( $field_data[ 'items' ] as $id => $interest_group ) { |
|
97 | + $pre_selected = ! empty( $field_data[ 'default_choice' ] ) ? $field_data[ 'default_choice' ] : '0'; |
|
98 | 98 | ?> |
99 | - <input type="checkbox" name="field[<?php echo $form_data['group_id']; ?>][default_choice][]" value="<?php echo $id; ?>" <?php checked( $pre_selected, $id ); ?>><?php echo stripslashes( $interest_group['name'] ); ?> |
|
99 | + <input type="checkbox" name="field[<?php echo $form_data[ 'group_id' ]; ?>][default_choice][]" value="<?php echo $id; ?>" <?php checked( $pre_selected, $id ); ?>><?php echo stripslashes( $interest_group[ 'name' ] ); ?> |
|
100 | 100 | <?php |
101 | 101 | } |
102 | 102 | ?> |
103 | - <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
103 | + <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
104 | 104 | </td> |
105 | 105 | </tr> |
106 | 106 | |
@@ -112,20 +112,20 @@ discard block |
||
112 | 112 | <tr valign="top"> |
113 | 113 | <td scope="row"> |
114 | 114 | <label for="placeholder"> |
115 | - <?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
115 | + <?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
116 | 116 | </label> |
117 | 117 | </td> |
118 | 118 | <td> |
119 | - <select type="default" name="field[<?php echo $form_data['group_id']; ?>][default_choice]"> |
|
119 | + <select type="default" name="field[<?php echo $form_data[ 'group_id' ]; ?>][default_choice]"> |
|
120 | 120 | <?php |
121 | - foreach ( $field_data['items'] as $id => $interest_group ) { |
|
122 | - $pre_selected = ! empty( $field_data['default_choice'] ) ? $field_data['default_choice'] : '0'; |
|
121 | + foreach ( $field_data[ 'items' ] as $id => $interest_group ) { |
|
122 | + $pre_selected = ! empty( $field_data[ 'default_choice' ] ) ? $field_data[ 'default_choice' ] : '0'; |
|
123 | 123 | ?> |
124 | - <option value="<?php echo $id; ?>" <?php selected( $pre_selected, $id ); ?>><?php echo $interest_group['name']; ?></option> |
|
124 | + <option value="<?php echo $id; ?>" <?php selected( $pre_selected, $id ); ?>><?php echo $interest_group[ 'name' ]; ?></option> |
|
125 | 125 | <?php |
126 | 126 | } ?> |
127 | 127 | </select> |
128 | - <p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
128 | + <p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
129 | 129 | </td> |
130 | 130 | </tr> |
131 | 131 | |
@@ -137,12 +137,12 @@ discard block |
||
137 | 137 | <tr valign="top"> |
138 | 138 | <td scope="row"> |
139 | 139 | <label for="placeholder"> |
140 | - <?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
140 | + <?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
141 | 141 | </label> |
142 | 142 | </td> |
143 | 143 | <td> |
144 | - <textarea class="widefat field-description-input" name="field[<?php echo $form_data['group_id']; ?>][description]"></textarea> |
|
145 | - <p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
144 | + <textarea class="widefat field-description-input" name="field[<?php echo $form_data[ 'group_id' ]; ?>][description]"></textarea> |
|
145 | + <p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
146 | 146 | </td> |
147 | 147 | </tr> |
148 | 148 | |
@@ -150,48 +150,48 @@ discard block |
||
150 | 150 | <tr valign="top"> |
151 | 151 | <td scope="row"> |
152 | 152 | <label for="placeholder"> |
153 | - <?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
153 | + <?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
154 | 154 | </label> |
155 | 155 | </td> |
156 | 156 | <td> |
157 | - <input type="text" class="widefat" name="field[<?php echo $form_data['group_id']; ?>][additional-classes]" value="<?php echo isset( $form_data['classes'] ) ? stripslashes( wp_strip_all_tags( $form_data['classes'] ) ) : '' ; ?>" /> |
|
158 | - <p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' );?></small></p> |
|
157 | + <input type="text" class="widefat" name="field[<?php echo $form_data[ 'group_id' ]; ?>][additional-classes]" value="<?php echo isset( $form_data[ 'classes' ] ) ? stripslashes( wp_strip_all_tags( $form_data[ 'classes' ] ) ) : ''; ?>" /> |
|
158 | + <p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ); ?></small></p> |
|
159 | 159 | </td> |
160 | 160 | </tr> |
161 | 161 | <!-- Required Toggle --> |
162 | 162 | <tr valign="top"> |
163 | 163 | <td scope="row"> |
164 | 164 | <label for="field-required"> |
165 | - <?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
165 | + <?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
166 | 166 | </label> |
167 | 167 | </td> |
168 | 168 | <td> |
169 | - <input type="checkbox" class="widefat" value="1" name="field[<?php echo $form_data['group_id']; ?>][require]"> |
|
170 | - <p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
169 | + <input type="checkbox" class="widefat" value="1" name="field[<?php echo $form_data[ 'group_id' ]; ?>][require]"> |
|
170 | + <p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
171 | 171 | </td> |
172 | 172 | </tr> |
173 | 173 | <!-- Visible Toggle --> |
174 | 174 | <tr valign="top"> |
175 | 175 | <td scope="row"> |
176 | 176 | <label for="hide-field"> |
177 | - <?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
177 | + <?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
178 | 178 | </label> |
179 | 179 | </td> |
180 | 180 | <td> |
181 | - <input type="checkbox" class="widefat" value="1" name="field[<?php echo $form_data['group_id']; ?>][hide]"> |
|
182 | - <p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
181 | + <input type="checkbox" class="widefat" value="1" name="field[<?php echo $form_data[ 'group_id' ]; ?>][hide]"> |
|
182 | + <p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
183 | 183 | </td> |
184 | 184 | </tr> |
185 | 185 | <!-- Toggle Field Label Visibility --> |
186 | 186 | <tr valign="top"> |
187 | 187 | <td scope="row"> |
188 | 188 | <label for="placeholder"> |
189 | - <?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
189 | + <?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
190 | 190 | </label> |
191 | 191 | </td> |
192 | 192 | <td> |
193 | - <input type="checkbox" name="field[<?php echo $form_data['group_id']; ?>][hide-label]" value="1" /> |
|
194 | - <p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
193 | + <input type="checkbox" name="field[<?php echo $form_data[ 'group_id' ]; ?>][hide-label]" value="1" /> |
|
194 | + <p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
195 | 195 | </td> |
196 | 196 | </tr> |
197 | 197 | <!-- Toggle Buttons --> |
@@ -201,8 +201,8 @@ discard block |
||
201 | 201 | </td> |
202 | 202 | <td> |
203 | 203 | <span class="toggle-container"> |
204 | - <a href="#" class="hide-field"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> | |
|
205 | - <a href="#" class="remove-field" alt="<?php echo $form_data['group_id']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
204 | + <a href="#" class="hide-field"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> | |
|
205 | + <a href="#" class="remove-field" alt="<?php echo $form_data[ 'group_id' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
206 | 206 | </span> |
207 | 207 | </td> |
208 | 208 | </tr> |
@@ -1,15 +1,15 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | $form_data = array( |
3 | - 'field_name' => $_POST['field_name'], |
|
4 | - 'merge_tag' => $_POST['merge_tag'], |
|
5 | - 'field_type' => $_POST['field_type'], |
|
6 | - 'list_id' => $_POST['list_id'], |
|
3 | + 'field_name' => $_POST[ 'field_name' ], |
|
4 | + 'merge_tag' => $_POST[ 'merge_tag' ], |
|
5 | + 'field_type' => $_POST[ 'field_type' ], |
|
6 | + 'list_id' => $_POST[ 'list_id' ], |
|
7 | 7 | ); |
8 | 8 | |
9 | 9 | // Grab our list handler. |
10 | 10 | $list_handler = yikes_get_mc_api_manager()->get_list_handler(); |
11 | 11 | |
12 | -$available_merge_variables = $list_handler->get_merge_fields( $form_data['list_id'] ); |
|
12 | +$available_merge_variables = $list_handler->get_merge_fields( $form_data[ 'list_id' ] ); |
|
13 | 13 | if ( is_wp_error( $available_merge_variables ) ) { |
14 | 14 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
15 | 15 | $error_logging->maybe_write_to_log( |
@@ -28,16 +28,16 @@ discard block |
||
28 | 28 | } |
29 | 29 | |
30 | 30 | // find and return the location of this merge field in the array |
31 | -$index = $this->findMCListIndex( $form_data['merge_tag'], $available_merge_variables['merge_fields'], 'tag' ); |
|
31 | +$index = $this->findMCListIndex( $form_data[ 'merge_tag' ], $available_merge_variables[ 'merge_fields' ], 'tag' ); |
|
32 | 32 | |
33 | 33 | // store it and use it to pre-populate field data (only on initial add to form) |
34 | -$merge_field_data = $available_merge_variables['merge_fields'][ $index ]; |
|
34 | +$merge_field_data = $available_merge_variables[ 'merge_fields' ][ $index ]; |
|
35 | 35 | ?> |
36 | -<section class="draggable" id="<?php echo $form_data['field_name']; ?>"> |
|
36 | +<section class="draggable" id="<?php echo $form_data[ 'field_name' ]; ?>"> |
|
37 | 37 | <!-- top --> |
38 | 38 | <a href="#" class="expansion-section-title settings-sidebar"> |
39 | - <span class="dashicons dashicons-plus" title="<?php _e( 'Expand Field' , 'yikes-inc-easy-mailchimp-extender' ); ?>"></span><?php echo stripslashes( $form_data['field_name'] ); ?> |
|
40 | - <span class="field-type-text"><small><?php echo __( 'type' , 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $form_data['field_type']; ?></small></span> |
|
39 | + <span class="dashicons dashicons-plus" title="<?php _e( 'Expand Field', 'yikes-inc-easy-mailchimp-extender' ); ?>"></span><?php echo stripslashes( $form_data[ 'field_name' ] ); ?> |
|
40 | + <span class="field-type-text"><small><?php echo __( 'type', 'yikes-inc-easy-mailchimp-extender' ) . ' : ' . $form_data[ 'field_type' ]; ?></small></span> |
|
41 | 41 | </a> |
42 | 42 | <!-- expansion section --> |
43 | 43 | <div class="yikes-mc-settings-expansion-section"> |
@@ -45,14 +45,14 @@ discard block |
||
45 | 45 | <!-- Single or Double Opt-in --> |
46 | 46 | <p class="type-container form-field-container"><!-- necessary to prevent skipping on slideToggle(); --> |
47 | 47 | <!-- store the label --> |
48 | - <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][label]" value="<?php echo $form_data['field_name']; ?>" /> |
|
49 | - <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][type]" value="<?php echo $form_data['field_type']; ?>" /> |
|
50 | - <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][merge]" value="<?php echo $merge_field_data['tag']; ?>" /> |
|
51 | - <input type="hidden" class="field-<?php echo $merge_field_data['tag']; ?>-position position-input" name="field[<?php echo $merge_field_data['tag']; ?>][position]" value="" /> |
|
48 | + <input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][label]" value="<?php echo $form_data[ 'field_name' ]; ?>" /> |
|
49 | + <input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][type]" value="<?php echo $form_data[ 'field_type' ]; ?>" /> |
|
50 | + <input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][merge]" value="<?php echo $merge_field_data[ 'tag' ]; ?>" /> |
|
51 | + <input type="hidden" class="field-<?php echo $merge_field_data[ 'tag' ]; ?>-position position-input" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][position]" value="" /> |
|
52 | 52 | |
53 | - <?php if ( $form_data['field_type'] == 'radio' || $form_data['field_type'] == 'dropdown' ) { ?> |
|
54 | - <?php $choices = ( isset( $merge_field_data['options']['choices'] ) ) ? esc_attr( json_encode( $merge_field_data['options']['choices'] ) ) : ''; ?> |
|
55 | - <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][choices]" value='<?php echo $choices; ?>' /> |
|
53 | + <?php if ( $form_data[ 'field_type' ] == 'radio' || $form_data[ 'field_type' ] == 'dropdown' ) { ?> |
|
54 | + <?php $choices = ( isset( $merge_field_data[ 'options' ][ 'choices' ] ) ) ? esc_attr( json_encode( $merge_field_data[ 'options' ][ 'choices' ] ) ) : ''; ?> |
|
55 | + <input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][choices]" value='<?php echo $choices; ?>' /> |
|
56 | 56 | <?php } ?> |
57 | 57 | |
58 | 58 | <table class="form-table form-field-container"> |
@@ -61,15 +61,15 @@ discard block |
||
61 | 61 | <tr valign="top"> |
62 | 62 | <td scope="row"> |
63 | 63 | <label for="merge-tag"> |
64 | - <?php _e( 'Merge Tag' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
64 | + <?php _e( 'Merge Tag', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
65 | 65 | </label> |
66 | 66 | </td> |
67 | 67 | <td> |
68 | - <input class="widefat merge-tag-text" type="text" readonly value="<?php echo $merge_field_data['tag']; ?>"> |
|
68 | + <input class="widefat merge-tag-text" type="text" readonly value="<?php echo $merge_field_data[ 'tag' ]; ?>"> |
|
69 | 69 | </td> |
70 | 70 | </tr> |
71 | 71 | |
72 | - <?php switch( $form_data['field_type'] ) { |
|
72 | + <?php switch ( $form_data[ 'field_type' ] ) { |
|
73 | 73 | |
74 | 74 | default: |
75 | 75 | break; |
@@ -87,12 +87,12 @@ discard block |
||
87 | 87 | <tr valign="top"> |
88 | 88 | <td scope="row"> |
89 | 89 | <label for="placeholder"> |
90 | - <?php _e( 'Placeholder' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
90 | + <?php _e( 'Placeholder', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
91 | 91 | </label> |
92 | 92 | </td> |
93 | 93 | <td> |
94 | - <input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][placeholder]" value="<?php echo isset( $merge_field_data['placeholder'] ) ? stripslashes( wp_strip_all_tags( $merge_field_data['placeholder'] ) ): '' ; ?>" /> |
|
95 | - <p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
94 | + <input type="text" class="widefat" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][placeholder]" value="<?php echo isset( $merge_field_data[ 'placeholder' ] ) ? stripslashes( wp_strip_all_tags( $merge_field_data[ 'placeholder' ] ) ) : ''; ?>" /> |
|
95 | + <p class="description"><small><?php _e( "Assign a placeholder value to this field.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
96 | 96 | </td> |
97 | 97 | </tr> |
98 | 98 | |
@@ -101,27 +101,27 @@ discard block |
||
101 | 101 | * Loop over field types and store necessary formats |
102 | 102 | * ( date, birthday - dateformat ; phone - phoneformat ) |
103 | 103 | */ |
104 | - switch( $form_data['field_type'] ) { |
|
104 | + switch ( $form_data[ 'field_type' ] ) { |
|
105 | 105 | |
106 | 106 | /* Store the date format, for properly rendering dates on the front end */ |
107 | 107 | case 'date': |
108 | - $date_format = isset( $merge_field_data['options']['dateformat'] ) ? $merge_field_data['options']['dateformat'] : 'MM/DD/YYYY'; |
|
108 | + $date_format = isset( $merge_field_data[ 'options' ][ 'dateformat' ] ) ? $merge_field_data[ 'options' ][ 'dateformat' ] : 'MM/DD/YYYY'; |
|
109 | 109 | ?> |
110 | - <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][date_format]" value="<?php echo strtolower( $date_format ); ?>" /> |
|
110 | + <input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][date_format]" value="<?php echo strtolower( $date_format ); ?>" /> |
|
111 | 111 | <?php |
112 | 112 | break; |
113 | 113 | |
114 | 114 | case 'birthday': |
115 | - $date_format = isset( $merge_field_data['options']['dateformat'] ) ? $merge_field_data['options']['dateformat'] : 'MM/DD'; |
|
115 | + $date_format = isset( $merge_field_data[ 'options' ][ 'dateformat' ] ) ? $merge_field_data[ 'options' ][ 'dateformat' ] : 'MM/DD'; |
|
116 | 116 | ?> |
117 | - <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][date_format]" value="<?php echo strtolower( $date_format ); ?>" /> |
|
117 | + <input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][date_format]" value="<?php echo strtolower( $date_format ); ?>" /> |
|
118 | 118 | <?php |
119 | 119 | break; |
120 | 120 | |
121 | 121 | /* Store the phone format, for properly regex pattern */ |
122 | 122 | case 'phone': |
123 | 123 | ?> |
124 | - <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][phone_format]" value="<?php echo $merge_field_data['options']['phone_format']; ?>" /> |
|
124 | + <input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][phone_format]" value="<?php echo $merge_field_data[ 'options' ][ 'phone_format' ]; ?>" /> |
|
125 | 125 | <?php |
126 | 126 | break; |
127 | 127 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | ?> |
133 | 133 | |
134 | 134 | <!-- Default Value --> |
135 | - <?php switch( $form_data['field_type'] ) { |
|
135 | + <?php switch ( $form_data[ 'field_type' ] ) { |
|
136 | 136 | |
137 | 137 | default: |
138 | 138 | case 'text': |
@@ -140,17 +140,17 @@ discard block |
||
140 | 140 | <tr valign="top"> |
141 | 141 | <td scope="row"> |
142 | 142 | <label for="placeholder"> |
143 | - <?php _e( 'Default Value' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
143 | + <?php _e( 'Default Value', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
144 | 144 | </label> |
145 | 145 | </td> |
146 | 146 | <td> |
147 | - <input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][default]" <?php if( $form_data['field_type'] != 'url' ) { ?> value="<?php echo isset( $merge_field_data['default_value'] ) ? stripslashes( wp_strip_all_tags( $merge_field_data['default_value'] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $merge_field_data['default_value'] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $merge_field_data['default_value'] ) ) ) : ''; } ?>" /> |
|
148 | - <p class="description"><small><?php _e( "Assign a default value to populate this field with on initial page load.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
147 | + <input type="text" class="widefat" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][default]" <?php if ( $form_data[ 'field_type' ] != 'url' ) { ?> value="<?php echo isset( $merge_field_data[ 'default_value' ] ) ? stripslashes( wp_strip_all_tags( $merge_field_data[ 'default_value' ] ) ) : ''; ?>" <?php } else { ?> value="<?php echo isset( $merge_field_data[ 'default_value' ] ) ? stripslashes( wp_strip_all_tags( esc_url_raw( $merge_field_data[ 'default_value' ] ) ) ) : ''; } ?>" /> |
|
148 | + <p class="description"><small><?php _e( "Assign a default value to populate this field with on initial page load.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
149 | 149 | <?php |
150 | - switch ( $form_data['field_type'] ) { |
|
150 | + switch ( $form_data[ 'field_type' ] ) { |
|
151 | 151 | case 'text': |
152 | 152 | ?> |
153 | - <p><small class="pre-defined-tag-link"><a href="#TB_inline?width=600&height=550&inlineId=pre-defined-tag-container" class="thickbox" onclick="storeGlobalClicked( jQuery( this ) );"><?php _e( 'View Pre-Defined Tags' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></p> |
|
153 | + <p><small class="pre-defined-tag-link"><a href="#TB_inline?width=600&height=550&inlineId=pre-defined-tag-container" class="thickbox" onclick="storeGlobalClicked( jQuery( this ) );"><?php _e( 'View Pre-Defined Tags', 'yikes-inc-easy-mailchimp-extender' ); ?></a></small></p> |
|
154 | 154 | <?php |
155 | 155 | break; |
156 | 156 | } ?> |
@@ -164,21 +164,21 @@ discard block |
||
164 | 164 | <tr valign="top"> |
165 | 165 | <td scope="row"> |
166 | 166 | <label for="placeholder"> |
167 | - <?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
167 | + <?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
168 | 168 | </label> |
169 | 169 | </td> |
170 | 170 | <td> |
171 | 171 | <?php |
172 | 172 | $x = 0; |
173 | - foreach ( $merge_field_data['options']['choices'] as $choice => $value ) { |
|
174 | - $pre_selected = ! empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0'; |
|
173 | + foreach ( $merge_field_data[ 'options' ][ 'choices' ] as $choice => $value ) { |
|
174 | + $pre_selected = ! empty( $merge_field_data[ 'default_choice' ] ) ? $merge_field_data[ 'default_choice' ] : '0'; |
|
175 | 175 | ?> |
176 | 176 | <label> |
177 | - <input type="radio" name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]" value="<?php echo $x; ?>" <?php checked( $pre_selected, $choice ); ?>><?php echo $value; ?> |
|
177 | + <input type="radio" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][default_choice]" value="<?php echo $x; ?>" <?php checked( $pre_selected, $choice ); ?>><?php echo $value; ?> |
|
178 | 178 | </label> |
179 | - <?php $x ++; |
|
179 | + <?php $x++; |
|
180 | 180 | } ?> |
181 | - <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
181 | + <p class="description"><small><?php _e( "Select the option that should be selected by default.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
182 | 182 | </td> |
183 | 183 | </tr> |
184 | 184 | |
@@ -190,18 +190,18 @@ discard block |
||
190 | 190 | <tr valign="top"> |
191 | 191 | <td scope="row"> |
192 | 192 | <label for="placeholder"> |
193 | - <?php _e( 'Default Selection' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
193 | + <?php _e( 'Default Selection', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
194 | 194 | </label> |
195 | 195 | </td> |
196 | 196 | <td> |
197 | - <select type="default" name="field[<?php echo $merge_field_data['tag']; ?>][default_choice]"> |
|
198 | - <?php foreach ( $merge_field_data['choices'] as $choice => $value ) { |
|
199 | - $pre_selected = ! empty( $merge_field_data['default_choice'] ) ? $merge_field_data['default_choice'] : '0'; |
|
197 | + <select type="default" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][default_choice]"> |
|
198 | + <?php foreach ( $merge_field_data[ 'choices' ] as $choice => $value ) { |
|
199 | + $pre_selected = ! empty( $merge_field_data[ 'default_choice' ] ) ? $merge_field_data[ 'default_choice' ] : '0'; |
|
200 | 200 | ?> |
201 | 201 | <option value="<?php echo $choice; ?>" <?php selected( $pre_selected, $choice ); ?>><?php echo stripslashes( $value ); ?></option> |
202 | 202 | <?php } ?> |
203 | 203 | </select> |
204 | - <p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
204 | + <p class="description"><small><?php _e( "Which option should be selected by default?", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
205 | 205 | </td> |
206 | 206 | </tr> |
207 | 207 | |
@@ -215,65 +215,65 @@ discard block |
||
215 | 215 | <tr valign="top"> |
216 | 216 | <td scope="row"> |
217 | 217 | <label for="placeholder"> |
218 | - <?php _e( 'Description' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
218 | + <?php _e( 'Description', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
219 | 219 | </label> |
220 | 220 | </td> |
221 | 221 | <td> |
222 | - <textarea class="widefat field-description-input" name="field[<?php echo $merge_field_data['tag']; ?>][description]"></textarea> |
|
223 | - <p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
222 | + <textarea class="widefat field-description-input" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][description]"></textarea> |
|
223 | + <p class="description"><small><?php _e( "Enter the description for the form field. This will be displayed to the user and provide some direction on how the field should be filled out or selected.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
224 | 224 | </td> |
225 | 225 | </tr> |
226 | 226 | <!-- Additional Classes --> |
227 | 227 | <tr valign="top"> |
228 | 228 | <td scope="row"> |
229 | 229 | <label for="placeholder"> |
230 | - <?php _e( 'Additional Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
230 | + <?php _e( 'Additional Classes', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
231 | 231 | </label> |
232 | 232 | </td> |
233 | 233 | <td> |
234 | - <input type="text" class="widefat" name="field[<?php echo $merge_field_data['tag']; ?>][additional-classes]" value="<?php echo isset( $form_data['classes'] ) ? stripslashes( wp_strip_all_tags( $form_data['classes'] ) ) : '' ; ?>" /> |
|
235 | - <p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' );?></small></p> |
|
234 | + <input type="text" class="widefat" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][additional-classes]" value="<?php echo isset( $form_data[ 'classes' ] ) ? stripslashes( wp_strip_all_tags( $form_data[ 'classes' ] ) ) : ''; ?>" /> |
|
235 | + <p class="description"><small><?php printf( __( "Assign additional classes to this field. %s.", 'yikes-inc-easy-mailchimp-extender' ), '<a target="_blank" href="' . esc_url( 'https://yikesplugins.com/support/knowledge-base/bundled-css-classes/' ) . '">' . __( 'View bundled classes', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ); ?></small></p> |
|
236 | 236 | </td> |
237 | 237 | </tr> |
238 | 238 | <!-- Required Toggle --> |
239 | 239 | <tr valign="top"> |
240 | 240 | <td scope="row"> |
241 | 241 | <label for="field-required"> |
242 | - <?php _e( 'Field Required?' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
242 | + <?php _e( 'Field Required?', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
243 | 243 | </label> |
244 | 244 | </td> |
245 | 245 | <td> |
246 | - <input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data['tag']; ?>][require]" <?php checked( $merge_field_data['required'], 1 ); ?> <?php if( $merge_field_data['tag'] == 'EMAIL' ) { ?> disabled="disabled" checked="checked" title="<?php echo __( 'Email is a required field.' , 'yikes-inc-easy-mailchimp-extender' ); } ?>"> |
|
247 | - <p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
246 | + <input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][require]" <?php checked( $merge_field_data[ 'required' ], 1 ); ?> <?php if ( $merge_field_data[ 'tag' ] == 'EMAIL' ) { ?> disabled="disabled" checked="checked" title="<?php echo __( 'Email is a required field.', 'yikes-inc-easy-mailchimp-extender' ); } ?>"> |
|
247 | + <p class="description"><small><?php _e( "Require this field to be filled in before the form can be submitted.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
248 | 248 | </td> |
249 | 249 | </tr> |
250 | 250 | <!-- Visible Toggle --> |
251 | 251 | <tr valign="top"> |
252 | 252 | <td scope="row"> |
253 | 253 | <label for="hide-field"> |
254 | - <?php _e( 'Hide Field' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
254 | + <?php _e( 'Hide Field', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
255 | 255 | </label> |
256 | 256 | </td> |
257 | 257 | <td> |
258 | - <input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data['tag']; ?>][hide]" <?php checked( $merge_field_data['public'], '' ); ?> <?php if( $merge_field_data['tag'] == 'EMAIL' ) { ?> disabled="disabled" title="<?php echo __( 'Cannot toggle email field visibility.' , 'yikes-inc-easy-mailchimp-extender' ); } ?>"> |
|
259 | - <p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
258 | + <input type="checkbox" class="widefat" value="1" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][hide]" <?php checked( $merge_field_data[ 'public' ], '' ); ?> <?php if ( $merge_field_data[ 'tag' ] == 'EMAIL' ) { ?> disabled="disabled" title="<?php echo __( 'Cannot toggle email field visibility.', 'yikes-inc-easy-mailchimp-extender' ); } ?>"> |
|
259 | + <p class="description"><small><?php _e( "Hide this field from being displayed on the front end.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
260 | 260 | </td> |
261 | 261 | </tr> |
262 | 262 | <!-- Toggle Field Label Visibility --> |
263 | 263 | <tr valign="top"> |
264 | 264 | <td scope="row"> |
265 | 265 | <label for="placeholder"> |
266 | - <?php _e( 'Hide Label' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
266 | + <?php _e( 'Hide Label', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
267 | 267 | </label> |
268 | 268 | </td> |
269 | 269 | <td> |
270 | - <input type="checkbox" name="field[<?php echo $merge_field_data['tag']; ?>][hide-label]" value="1" /> |
|
271 | - <p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' );?></small></p> |
|
270 | + <input type="checkbox" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][hide-label]" value="1" /> |
|
271 | + <p class="description"><small><?php _e( "Toggle field label visibility.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
272 | 272 | </td> |
273 | 273 | </tr> |
274 | 274 | <!-- Display Phone/Date Formats back to the user --> |
275 | 275 | <?php |
276 | - switch( $form_data['field_type'] ) { |
|
276 | + switch ( $form_data[ 'field_type' ] ) { |
|
277 | 277 | |
278 | 278 | /* Store the phone format, for properly regex pattern */ |
279 | 279 | case 'phone': |
@@ -284,23 +284,23 @@ discard block |
||
284 | 284 | <td scope="row"> |
285 | 285 | <label for="placeholder"> |
286 | 286 | <?php |
287 | - switch( $form_data['field_type'] ) { |
|
287 | + switch ( $form_data[ 'field_type' ] ) { |
|
288 | 288 | default: |
289 | 289 | case 'birthday': |
290 | - $type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' ); |
|
291 | - $format = $merge_field_data['options']['date_format']; |
|
290 | + $type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' ); |
|
291 | + $format = $merge_field_data[ 'options' ][ 'date_format' ]; |
|
292 | 292 | $format_name = 'date_format'; |
293 | 293 | break; |
294 | 294 | |
295 | 295 | case 'date': |
296 | - $type = __( 'Date Format' , 'yikes-inc-easy-mailchimp-extender' ); |
|
297 | - $format = $merge_field_data['options']['date_format']; |
|
296 | + $type = __( 'Date Format', 'yikes-inc-easy-mailchimp-extender' ); |
|
297 | + $format = $merge_field_data[ 'options' ][ 'date_format' ]; |
|
298 | 298 | $format_name = 'date_format'; |
299 | 299 | break; |
300 | 300 | |
301 | 301 | case 'phone': |
302 | - $type = __( 'Phone Format' , 'yikes-inc-easy-mailchimp-extender' ); |
|
303 | - $format = ( ( $merge_field_data['options']['phone_format'] == 'none' ) ? __( 'International', 'yikes-inc-easy-mailchimp-extender' ) : $merge_field_data['options']['phone_format'] ); |
|
302 | + $type = __( 'Phone Format', 'yikes-inc-easy-mailchimp-extender' ); |
|
303 | + $format = ( ( $merge_field_data[ 'options' ][ 'phone_format' ] == 'none' ) ? __( 'International', 'yikes-inc-easy-mailchimp-extender' ) : $merge_field_data[ 'options' ][ 'phone_format' ] ); |
|
304 | 304 | $format_name = 'phone_format'; |
305 | 305 | break; |
306 | 306 | } |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | </td> |
311 | 311 | <td> |
312 | 312 | <strong><?php echo $format; ?></strong> |
313 | - <input type="hidden" name="field[<?php echo $merge_field_data['tag']; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" /> |
|
313 | + <input type="hidden" name="field[<?php echo $merge_field_data[ 'tag' ]; ?>][<?php echo $format_name; ?>]" value="<?php echo $format; ?>" /> |
|
314 | 314 | <p class="description"><small> |
315 | 315 | <?php printf( __( 'To change the %s please head over to <a href="%s" title="MailChimp" target="_blank">MailChimp</a>. If you alter the format, you should re-import this field.', 'yikes-inc-easy-mailchimp-extender' ), strtolower( $type ), esc_url( 'http://www.mailchimp.com' ) ); ?> |
316 | 316 | </small></p> |
@@ -331,8 +331,8 @@ discard block |
||
331 | 331 | </td> |
332 | 332 | <td> |
333 | 333 | <span class="toggle-container"> |
334 | - <a href="#" class="hide-field"><?php _e( "Close" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> | |
|
335 | - <a href="#" class="remove-field" alt="<?php echo $merge_field_data['tag']; ?>"><?php _e( "Remove Field" , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
334 | + <a href="#" class="hide-field"><?php _e( "Close", 'yikes-inc-easy-mailchimp-extender' ); ?></a> | |
|
335 | + <a href="#" class="remove-field" alt="<?php echo $merge_field_data[ 'tag' ]; ?>"><?php _e( "Remove Field", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
336 | 336 | </span> |
337 | 337 | </td> |
338 | 338 | </tr> |
@@ -12,15 +12,15 @@ discard block |
||
12 | 12 | |
13 | 13 | public function __construct() { |
14 | 14 | // ajax send merge variable to form builder |
15 | - add_action( 'wp_ajax_add_field_to_form', array( $this , 'send_field_to_form' ), 10 ); |
|
15 | + add_action( 'wp_ajax_add_field_to_form', array( $this, 'send_field_to_form' ), 10 ); |
|
16 | 16 | // ajax send interest group to form builder |
17 | - add_action( 'wp_ajax_add_interest_group_to_form', array( $this , 'send_interest_group_to_form' ), 10 ); |
|
17 | + add_action( 'wp_ajax_add_interest_group_to_form', array( $this, 'send_interest_group_to_form' ), 10 ); |
|
18 | 18 | // return new list data + activity (for dashboard widget ) |
19 | - add_action( 'wp_ajax_get_new_list_data', array( $this , 'get_new_list_data' ), 10 ); |
|
19 | + add_action( 'wp_ajax_get_new_list_data', array( $this, 'get_new_list_data' ), 10 ); |
|
20 | 20 | // return new list data + activity (for dashboard widget ) |
21 | - add_action( 'wp_ajax_check_list_for_interest_groups', array( $this , 'check_list_for_interest_groups' ), 10 ); |
|
21 | + add_action( 'wp_ajax_check_list_for_interest_groups', array( $this, 'check_list_for_interest_groups' ), 10 ); |
|
22 | 22 | // Add a new notification to a form |
23 | - add_action( 'wp_ajax_add_notification_to_form', array( $this , 'add_notification_to_form' ), 10 , 1 ); |
|
23 | + add_action( 'wp_ajax_add_notification_to_form', array( $this, 'add_notification_to_form' ), 10, 1 ); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /* |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * - return a single container |
29 | 29 | */ |
30 | 30 | public function add_notification_to_form() { |
31 | - if( $_POST['notification_name'] ) { |
|
31 | + if ( $_POST[ 'notification_name' ] ) { |
|
32 | 32 | include_once( YIKES_MC_PATH . 'admin/partials/ajax/add_notification_to_form.php' ); |
33 | 33 | } |
34 | 34 | exit(); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | // when the user wants to switch which form data |
39 | 39 | // is displayed on the dashboard |
40 | 40 | public function get_new_list_data() { |
41 | - $list_id = $_POST['list_id']; |
|
41 | + $list_id = $_POST[ 'list_id' ]; |
|
42 | 42 | $list_data = yikes_get_mc_api_manager()->get_list_handler()->get_list( $list_id ); |
43 | 43 | if ( is_wp_error( $list_data ) ) { |
44 | 44 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
@@ -61,17 +61,17 @@ discard block |
||
61 | 61 | /* note: this function is called statically from the integration settings page */ |
62 | 62 | public static function check_list_for_interest_groups( $list_id = '', $integration_type = '', $load = false ) { |
63 | 63 | if ( ! $list_id ) { |
64 | - $list_id = $_POST['list_id']; |
|
64 | + $list_id = $_POST[ 'list_id' ]; |
|
65 | 65 | } |
66 | 66 | if ( ! $integration_type ) { |
67 | - $integration_type = $_POST['integration']; |
|
67 | + $integration_type = $_POST[ 'integration' ]; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | |
71 | 71 | $interest_groupings = yikes_get_mc_api_manager()->get_list_handler()->get_interest_categories( $list_id ); |
72 | 72 | if ( is_wp_error( $interest_groupings ) ) { |
73 | 73 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
74 | - $error_logging->maybe_write_to_log( $interest_groupings['error'], __( "Get Interest Groups" , 'yikes-inc-easy-mailchimp-extender' ), "class.ajax.php" ); |
|
74 | + $error_logging->maybe_write_to_log( $interest_groupings[ 'error' ], __( "Get Interest Groups", 'yikes-inc-easy-mailchimp-extender' ), "class.ajax.php" ); |
|
75 | 75 | $interest_groupings = array(); |
76 | 76 | } |
77 | 77 |
@@ -2,23 +2,23 @@ discard block |
||
2 | 2 | <?php |
3 | 3 | |
4 | 4 | // if an error was returned in the most recent query |
5 | - if( isset( $_GET['sql_error'] ) ) { |
|
5 | + if ( isset( $_GET[ 'sql_error' ] ) ) { |
|
6 | 6 | // if error logging is turned on, lets display a better error to help narrow things down |
7 | 7 | // lets also log things to the error log |
8 | - if( get_option( 'yikes-mailchimp-debug-status' , '' ) == '1' ) { |
|
9 | - wp_die( '<strong>' . __( 'Error Creating Form' , 'yikes-inc-easy-mailchimp-extender' ) . '</strong> <p>' . stripslashes( urldecode( $_GET['sql_error'] ) ) . '</p>' , __( 'Error Creating Form' , 'yikes-inc-easy-mailchimp-extender' ) ); |
|
8 | + if ( get_option( 'yikes-mailchimp-debug-status', '' ) == '1' ) { |
|
9 | + wp_die( '<strong>' . __( 'Error Creating Form', 'yikes-inc-easy-mailchimp-extender' ) . '</strong> <p>' . stripslashes( urldecode( $_GET[ 'sql_error' ] ) ) . '</p>', __( 'Error Creating Form', 'yikes-inc-easy-mailchimp-extender' ) ); |
|
10 | 10 | } else { |
11 | - wp_die( '<strong>' . __( 'Error Creating Form' , 'yikes-inc-easy-mailchimp-extender' ) . '</strong><p>' . __( "Please try again. If the error persists please get in contact with the YIKES Inc. support team." , 'yikes-inc-easy-mailchimp-extender' ) . '</p>' ); |
|
11 | + wp_die( '<strong>' . __( 'Error Creating Form', 'yikes-inc-easy-mailchimp-extender' ) . '</strong><p>' . __( "Please try again. If the error persists please get in contact with the YIKES Inc. support team.", 'yikes-inc-easy-mailchimp-extender' ) . '</p>' ); |
|
12 | 12 | } |
13 | 13 | } |
14 | 14 | |
15 | 15 | /* Get The Form ID we need to edit */ |
16 | - if ( ! isset( $_GET['id'] ) ) { |
|
16 | + if ( ! isset( $_GET[ 'id' ] ) ) { |
|
17 | 17 | wp_die( __( 'Oh No!', 'yikes-inc-easy-mailchimp-extender' ), __( 'Error', 'yikes-inc-easy-mailchimp-extender' ) ); |
18 | 18 | } |
19 | 19 | |
20 | 20 | // grab and store the form ID |
21 | - $form_id = (int) $_GET['id']; |
|
21 | + $form_id = (int) $_GET[ 'id' ]; |
|
22 | 22 | |
23 | 23 | // Get our form interface. |
24 | 24 | $form_interface = yikes_easy_mailchimp_extender_get_form_interface(); |
@@ -31,19 +31,19 @@ discard block |
||
31 | 31 | |
32 | 32 | // if the form was not found return an error |
33 | 33 | if ( empty( $form ) ) { |
34 | - wp_die( printf( __( "Whoops! It looks like this form doesn't exist. If this error persists you may want to toggle on debugging on the <a href='%s'>%s</a> " , 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=debug-settings' ) ), __( 'debug settings page' , 'yikes-inc-easy-mailchimp-extender' ) ), __( 'Error' , 'yikes-inc-easy-mailchimp-extender' ) ); |
|
34 | + wp_die( printf( __( "Whoops! It looks like this form doesn't exist. If this error persists you may want to toggle on debugging on the <a href='%s'>%s</a> ", 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=debug-settings' ) ), __( 'debug settings page', 'yikes-inc-easy-mailchimp-extender' ) ), __( 'Error', 'yikes-inc-easy-mailchimp-extender' ) ); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | // set global form data, mainly for use in custom form field declarations |
38 | - $GLOBALS["form_data"] = $form; |
|
38 | + $GLOBALS[ "form_data" ] = $form; |
|
39 | 39 | |
40 | - $custom_styles = $form['custom_styles']; |
|
41 | - $optin_settings = $form['optin_settings']; |
|
42 | - $submission_settings = $form['submission_settings']; |
|
43 | - $error_messages = $form['error_messages']; |
|
40 | + $custom_styles = $form[ 'custom_styles' ]; |
|
41 | + $optin_settings = $form[ 'optin_settings' ]; |
|
42 | + $submission_settings = $form[ 'submission_settings' ]; |
|
43 | + $error_messages = $form[ 'error_messages' ]; |
|
44 | 44 | |
45 | - if ( isset( $form['form_settings'] ) ) { |
|
46 | - $form_settings = $form['form_settings']; |
|
45 | + if ( isset( $form[ 'form_settings' ] ) ) { |
|
46 | + $form_settings = $form[ 'form_settings' ]; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | // get defaults if none are saved in the database yet |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | } |
87 | 87 | |
88 | 88 | // Get the merge fields |
89 | - $available_merge_variables = $list_handler->get_merge_fields( $form['list_id'] ); |
|
89 | + $available_merge_variables = $list_handler->get_merge_fields( $form[ 'list_id' ] ); |
|
90 | 90 | if ( is_wp_error( $available_merge_variables ) ) { |
91 | 91 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
92 | 92 | $error_logging->maybe_write_to_log( |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | |
100 | 100 | // get the interest group data |
101 | - $interest_groupings = $list_handler->get_interest_categories( $form['list_id'] ); |
|
101 | + $interest_groupings = $list_handler->get_interest_categories( $form[ 'list_id' ] ); |
|
102 | 102 | if ( is_wp_error( $interest_groupings ) ) { |
103 | 103 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
104 | 104 | $error_logging->maybe_write_to_log( |
@@ -115,22 +115,22 @@ discard block |
||
115 | 115 | add_query_arg( |
116 | 116 | array( |
117 | 117 | 'action' => 'yikes-easy-mc-update-form', |
118 | - 'nonce' => wp_create_nonce( 'update-mailchimp-form'.-$form['id'] ) |
|
118 | + 'nonce' => wp_create_nonce( 'update-mailchimp-form' . -$form[ 'id' ] ) |
|
119 | 119 | ) |
120 | 120 | ) |
121 | 121 | ); |
122 | 122 | /* Display Our Form */ |
123 | 123 | ?> |
124 | 124 | <!-- Freddie Logo --> |
125 | - <img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php __( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" /> |
|
125 | + <img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php __( 'Freddie - MailChimp Mascot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" /> |
|
126 | 126 | |
127 | - <h1>YIKES Easy Forms for MailChimp | <?php echo __( 'Edit' , 'yikes-inc-easy-mailchimp-extender' ) . ' ' . $form['form_name']; ?></h1> |
|
127 | + <h1>YIKES Easy Forms for MailChimp | <?php echo __( 'Edit', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . $form[ 'form_name' ]; ?></h1> |
|
128 | 128 | |
129 | 129 | <!-- Settings Page Description --> |
130 | - <p class="yikes-easy-mc-about-text about-text"><?php _e( 'Update this MailChimp form\'s fields, styles and settings below.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
130 | + <p class="yikes-easy-mc-about-text about-text"><?php _e( 'Update this MailChimp form\'s fields, styles and settings below.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
131 | 131 | |
132 | 132 | <?php |
133 | - if ( isset( $_REQUEST['updated-form'] ) && $_REQUEST['updated-form'] == 'true' ) { |
|
133 | + if ( isset( $_REQUEST[ 'updated-form' ] ) && $_REQUEST[ 'updated-form' ] == 'true' ) { |
|
134 | 134 | ?> |
135 | 135 | <div class="updated manage-form-admin-notice"> |
136 | 136 | <p><?php _e( 'Opt-in form successfully updated.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -154,15 +154,15 @@ discard block |
||
154 | 154 | <div class="inside"> |
155 | 155 | |
156 | 156 | <label for="form-name"> |
157 | - <h3 class="bg-transparent"><?php _e( 'Form Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
158 | - <input autocomplete="disabled" id="form-name" name="form-name" type="text" value="<?php echo stripslashes( esc_html( $form['form_name'] ) ); ?>" class="widefat" /> |
|
159 | - <p class="description"><?php _e( "The title of this signup form." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
157 | + <h3 class="bg-transparent"><?php _e( 'Form Name', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
158 | + <input autocomplete="disabled" id="form-name" name="form-name" type="text" value="<?php echo stripslashes( esc_html( $form[ 'form_name' ] ) ); ?>" class="widefat" /> |
|
159 | + <p class="description"><?php _e( "The title of this signup form.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
160 | 160 | </label> |
161 | 161 | |
162 | 162 | <label for="form-description"> |
163 | - <h3 class="bg-transparent"><?php _e( 'Form Description' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
164 | - <textarea name="form-description" id="form-description" class="large-text edit-form-form-description"><?php echo isset( $form['form_description'] ) ? stripslashes( esc_textarea( $form['form_description'] ) ) : ''; ?></textarea> |
|
165 | - <p class="description"><?php _e( "Descriptions are optional and you may choose to display it to visitors to your site." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
163 | + <h3 class="bg-transparent"><?php _e( 'Form Description', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
164 | + <textarea name="form-description" id="form-description" class="large-text edit-form-form-description"><?php echo isset( $form[ 'form_description' ] ) ? stripslashes( esc_textarea( $form[ 'form_description' ] ) ) : ''; ?></textarea> |
|
165 | + <p class="description"><?php _e( "Descriptions are optional and you may choose to display it to visitors to your site.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
166 | 166 | <p class="description"><?php printf( __( 'To display the number of subscribers for the list associated with this form, use %s in the form description field above.', 'yikes-inc-easy-mailchimp-extender' ), '<code>[yikes-mailchimp-subscriber-count]</code>' ); ?><p> |
167 | 167 | </label> |
168 | 168 | |
@@ -178,16 +178,16 @@ discard block |
||
178 | 178 | |
179 | 179 | <ul id="yikes_easy_mc_toolbar_links"> |
180 | 180 | <li class="hidden_setting_list"> |
181 | - <a class="hidden_setting form-builder selected_hidden_setting" data-attr-container="form-builder" onclick="return false;" title="<?php esc_attr_e( 'Customize Form Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?>" href="#"> <?php _e( 'Form Builder' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
181 | + <a class="hidden_setting form-builder selected_hidden_setting" data-attr-container="form-builder" onclick="return false;" title="<?php esc_attr_e( 'Customize Form Fields', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="#"> <?php _e( 'Form Builder', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
182 | 182 | <div class="selected_setting_triangle"></div> |
183 | 183 | </li> |
184 | 184 | <li class="hidden_setting_list"> |
185 | - <a class="hidden_setting form-settings" onclick="return false;" data-attr-container="form-settings" title="<?php esc_attr_e( 'Form Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?>" href="#"> <?php _e( 'Form Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
185 | + <a class="hidden_setting form-settings" onclick="return false;" data-attr-container="form-settings" title="<?php esc_attr_e( 'Form Settings', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="#"> <?php _e( 'Form Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
186 | 186 | </li> |
187 | 187 | <li class="hidden_setting_list"> |
188 | - <a class="hidden_setting error-messages" onclick="return false;" data-attr-container="error-messages" title="<?php esc_attr_e( 'Customize Form Messages' , 'yikes-inc-easy-mailchimp-extender' ); ?>" href="#"> <?php _e( 'Custom Messages' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
188 | + <a class="hidden_setting error-messages" onclick="return false;" data-attr-container="error-messages" title="<?php esc_attr_e( 'Customize Form Messages', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="#"> <?php _e( 'Custom Messages', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
189 | 189 | </li> |
190 | - <?php do_action( 'yikes-mailchimp-edit-form-section-links' , $form ); ?> |
|
190 | + <?php do_action( 'yikes-mailchimp-edit-form-section-links', $form ); ?> |
|
191 | 191 | </ul> |
192 | 192 | |
193 | 193 | </div> |
@@ -208,22 +208,22 @@ discard block |
||
208 | 208 | <div class="meta-box-sortables ui-sortable"> |
209 | 209 | <div class="postbox yikes-easy-mc-postbox"> |
210 | 210 | <!-- container title --> |
211 | - <h3 class="edit-form-title"><?php _e( 'Form Builder' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
212 | - <p id="edit-form-description" class="description"><?php _e( 'Select fields from the right to add to this form, you can click a field to reveal advanced options, or drag it to re-arrange its position in the form.' , 'yikes-inc-easy-mailchimp-extender' );?></p> |
|
211 | + <h3 class="edit-form-title"><?php _e( 'Form Builder', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
212 | + <p id="edit-form-description" class="description"><?php _e( 'Select fields from the right to add to this form, you can click a field to reveal advanced options, or drag it to re-arrange its position in the form.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
213 | 213 | <div id="form-builder-container" class="inside"> |
214 | 214 | <!-- #poststuff --> |
215 | - <?php echo $this->generate_form_editor( $form['fields'], $form['list_id'] , $available_merge_variables , isset( $interest_groupings ) ? $interest_groupings : array() ); ?> |
|
215 | + <?php echo $this->generate_form_editor( $form[ 'fields' ], $form[ 'list_id' ], $available_merge_variables, isset( $interest_groupings ) ? $interest_groupings : array() ); ?> |
|
216 | 216 | </div> |
217 | 217 | |
218 | 218 | <!-- Bulk Delete Form Fields --> |
219 | - <a href="#" class="clear-form-fields" <?php if( isset( $form['fields'] ) && count( $form['fields'] ) <= 0 ) { ?> style="display:none;" <?php } ?>><?php _e( 'Clear Form Fields', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
219 | + <a href="#" class="clear-form-fields" <?php if ( isset( $form[ 'fields' ] ) && count( $form[ 'fields' ] ) <= 0 ) { ?> style="display:none;" <?php } ?>><?php _e( 'Clear Form Fields', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
220 | 220 | |
221 | 221 | <?php |
222 | - $display_none = ( isset( $form['fields'] ) && count( $form['fields'] ) <= 0 ) ? 'display:none;' : ''; |
|
222 | + $display_none = ( isset( $form[ 'fields' ] ) && count( $form[ 'fields' ] ) <= 0 ) ? 'display:none;' : ''; |
|
223 | 223 | ?> |
224 | 224 | |
225 | 225 | <!-- Save Fields Button --> |
226 | - <?php submit_button( __( 'Update Form' ) , 'primary' , '' , false , array( 'onclick' => '', 'style' => 'float:right;margin-right:12px;'.$display_none ) ); ?> |
|
226 | + <?php submit_button( __( 'Update Form' ), 'primary', '', false, array( 'onclick' => '', 'style' => 'float:right;margin-right:12px;' . $display_none ) ); ?> |
|
227 | 227 | |
228 | 228 | <!-- .inside --> |
229 | 229 | </div> |
@@ -236,15 +236,15 @@ discard block |
||
236 | 236 | <div id="postbox-container-1" class="postbox-container"> |
237 | 237 | <div class="meta-box-sortables"> |
238 | 238 | <div class="postbox yikes-easy-mc-postbox"> |
239 | - <h3 class="edit-form-title"><span><?php _e( "Form Fields & Interest Groups" , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
239 | + <h3 class="edit-form-title"><span><?php _e( "Form Fields & Interest Groups", 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
240 | 240 | <div class="inside"> |
241 | 241 | |
242 | 242 | <h3 class="nav-tab-wrapper mv_ig_list"> |
243 | - <a href="#" class="nav-tab nav-tab-active" alt="merge-variables"><div class="arrow-down"></div><?php _e( 'Form Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
244 | - <?php if( !isset( $merge_variable_error ) ) { ?> |
|
245 | - <a href="#" class="nav-tab"><?php _e( 'Interest Groups' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
243 | + <a href="#" class="nav-tab nav-tab-active" alt="merge-variables"><div class="arrow-down"></div><?php _e( 'Form Fields', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
244 | + <?php if ( ! isset( $merge_variable_error ) ) { ?> |
|
245 | + <a href="#" class="nav-tab"><?php _e( 'Interest Groups', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
246 | 246 | <?php } else { ?> |
247 | - <a href="#" class="nav-tab no-interest-groups-found-message" disabled="disabled" title="<?php _e( "No Interest Groups Exist" , 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Interest Groups' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
247 | + <a href="#" class="nav-tab no-interest-groups-found-message" disabled="disabled" title="<?php _e( "No Interest Groups Exist", 'yikes-inc-easy-mailchimp-extender' ); ?>"><?php _e( 'Interest Groups', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
248 | 248 | <?php } ?> |
249 | 249 | </h3> |
250 | 250 | |
@@ -252,11 +252,11 @@ discard block |
||
252 | 252 | |
253 | 253 | <div id="merge-variables-container" class="list-container"> |
254 | 254 | <?php |
255 | - if( ! isset( $merge_variable_error ) ) { |
|
255 | + if ( ! isset( $merge_variable_error ) ) { |
|
256 | 256 | // build a list of available merge variables, |
257 | 257 | // but exclude the ones already assigned to the form |
258 | - echo '<p class="description">' . __( "Select the fields below to add to the form builder." , 'yikes-inc-easy-mailchimp-extender' ) . '</p>'; |
|
259 | - $this->build_available_merge_vars( $form['fields'] , $available_merge_variables ); |
|
258 | + echo '<p class="description">' . __( "Select the fields below to add to the form builder.", 'yikes-inc-easy-mailchimp-extender' ) . '</p>'; |
|
259 | + $this->build_available_merge_vars( $form[ 'fields' ], $available_merge_variables ); |
|
260 | 260 | } else { |
261 | 261 | echo $merge_variable_error; |
262 | 262 | } |
@@ -265,14 +265,14 @@ discard block |
||
265 | 265 | |
266 | 266 | <div id="interest-groups-container" class="list-container"> |
267 | 267 | <?php |
268 | - if( isset( $interest_groupings ) && ! isset( $interest_groupings['error'] ) ) { |
|
268 | + if ( isset( $interest_groupings ) && ! isset( $interest_groupings[ 'error' ] ) ) { |
|
269 | 269 | // build a list of available merge variables, |
270 | 270 | // but exclude the ones already assigned to the form |
271 | - echo '<p class="description">' . __( "Select an interest group below to add to the form builder." , 'yikes-inc-easy-mailchimp-extender' ) . '</p>'; |
|
271 | + echo '<p class="description">' . __( "Select an interest group below to add to the form builder.", 'yikes-inc-easy-mailchimp-extender' ) . '</p>'; |
|
272 | 272 | // $this->build_available_merge_vars( $form['fields'] , $available_merge_variables ); |
273 | - $this->build_available_interest_groups( $form['fields'] , $interest_groupings , $form['list_id'] ); |
|
273 | + $this->build_available_interest_groups( $form[ 'fields' ], $interest_groupings, $form[ 'list_id' ] ); |
|
274 | 274 | } else { |
275 | - echo '<p class="description">' . $interest_groupings['error'] . '</p>'; |
|
275 | + echo '<p class="description">' . $interest_groupings[ 'error' ] . '</p>'; |
|
276 | 276 | } |
277 | 277 | ?> |
278 | 278 | </div> |
@@ -305,19 +305,19 @@ discard block |
||
305 | 305 | <div id="post-body-content"> |
306 | 306 | <div class="meta-box-sortables ui-sortable"> |
307 | 307 | <div class="postbox yikes-easy-mc-postbox"> |
308 | - <h3 class="edit-form-title"><span><?php _e( "Additional Form Settings" , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
308 | + <h3 class="edit-form-title"><span><?php _e( "Additional Form Settings", 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
309 | 309 | |
310 | 310 | <div class="inside form-settings-container"> |
311 | 311 | |
312 | - <p class="edit-form-description"><?php _e( "Adjust some additional form settings below." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
312 | + <p class="edit-form-description"><?php _e( "Adjust some additional form settings below.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
313 | 313 | |
314 | 314 | <!-- begin form classes section --> |
315 | 315 | <strong class="section-title first"><?php _e( 'Overall Form Classes', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
316 | 316 | <section class="section-interior"> |
317 | 317 | |
318 | 318 | <!-- form classes --> |
319 | - <label for="yikes-easy-mc-form-class-names"><strong><?php _e( 'Form Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
320 | - <input type="text" class="widefat" name="yikes-easy-mc-form-class-names" id="yikes-easy-mc-form-class-names" value="<?php echo $form_settings['yikes-easy-mc-form-class-names']; ?>" placeholder="<?php _e( 'Add additional classes to this opt-in form.', 'yikes-inc-easy-mailchimp-extender' ); ?>" > |
|
319 | + <label for="yikes-easy-mc-form-class-names"><strong><?php _e( 'Form Classes', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
320 | + <input type="text" class="widefat" name="yikes-easy-mc-form-class-names" id="yikes-easy-mc-form-class-names" value="<?php echo $form_settings[ 'yikes-easy-mc-form-class-names' ]; ?>" placeholder="<?php _e( 'Add additional classes to this opt-in form.', 'yikes-inc-easy-mailchimp-extender' ); ?>" > |
|
321 | 321 | <p class="description"><?php printf( __( 'Add additional class names to the %s element.', 'yikes-inc-easy-mailchimp-extender' ), '<code>' . htmlentities( '<form>' ) . '</code>' ); ?></p> |
322 | 322 | </label> |
323 | 323 | |
@@ -330,12 +330,12 @@ discard block |
||
330 | 330 | |
331 | 331 | <!-- setup the checked state here --> |
332 | 332 | <!-- inline form --> |
333 | - <strong><?php _e( 'Inline Form' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
333 | + <strong><?php _e( 'Inline Form', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
334 | 334 | <label class="inline-form-label"> |
335 | - <input type="radio" name="yikes-easy-mc-inline-form[]" value="1" <?php checked( $form_settings['yikes-easy-mc-inline-form'], '1' ); ?>/><?php _e( 'Enable', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
335 | + <input type="radio" name="yikes-easy-mc-inline-form[]" value="1" <?php checked( $form_settings[ 'yikes-easy-mc-inline-form' ], '1' ); ?>/><?php _e( 'Enable', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
336 | 336 | </label> |
337 | 337 | <label class="inline-form-label"> |
338 | - <input type="radio" name="yikes-easy-mc-inline-form[]" value="0" <?php checked( $form_settings['yikes-easy-mc-inline-form'], '0' ); ?> /><?php _e( 'Disable', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
338 | + <input type="radio" name="yikes-easy-mc-inline-form[]" value="0" <?php checked( $form_settings[ 'yikes-easy-mc-inline-form' ], '0' ); ?> /><?php _e( 'Disable', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
339 | 339 | </label> |
340 | 340 | <p class="description"><?php _e( 'Programatically setup this form so that all fields are on the same line.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
341 | 341 | <p class="description"><?php printf( __( 'If you are having issues with your theme not displaying the inline form properly, please see the following %s.', 'yikes-inc-easy-mailchimp-extender' ), '<a href="https://yikesplugins.com/support/knowledge-base/my-form-fields-are-not-fully-inline-after-enabling-the-inline-form-option-how-come/" target="_blank">' . __( 'knowledge base article', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ); ?></p> |
@@ -348,21 +348,21 @@ discard block |
||
348 | 348 | <section class="section-interior"> |
349 | 349 | |
350 | 350 | <!-- Submit button type --> |
351 | - <strong><?php _e( 'Submit Button Type' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
351 | + <strong><?php _e( 'Submit Button Type', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
352 | 352 | <label class="inline-form-label"> |
353 | - <input type="radio" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-submit-button-type[]" value="text" <?php checked( $form_settings['yikes-easy-mc-submit-button-type'], 'text' ); ?> /><?php _e( 'Text', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
353 | + <input type="radio" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-submit-button-type[]" value="text" <?php checked( $form_settings[ 'yikes-easy-mc-submit-button-type' ], 'text' ); ?> /><?php _e( 'Text', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
354 | 354 | </label> |
355 | 355 | <label class="inline-form-label"> |
356 | - <input type="radio" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-submit-button-type[]" value="image" <?php checked( $form_settings['yikes-easy-mc-submit-button-type'], 'image' ); ?> /><?php _e( 'Image', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
356 | + <input type="radio" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-submit-button-type[]" value="image" <?php checked( $form_settings[ 'yikes-easy-mc-submit-button-type' ], 'image' ); ?> /><?php _e( 'Image', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
357 | 357 | </label> |
358 | 358 | <p class="description"><?php _e( 'Select the submit button type for this form.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
359 | 359 | <!-- end submit button type --> |
360 | 360 | |
361 | 361 | <!-- Text submit button type --> |
362 | - <section class="submit-button-type-text nested-child<?php if( $form_settings['yikes-easy-mc-submit-button-type'] == 'image' ) { echo ' hidden'; } ?>"> |
|
362 | + <section class="submit-button-type-text nested-child<?php if ( $form_settings[ 'yikes-easy-mc-submit-button-type' ] == 'image' ) { echo ' hidden'; } ?>"> |
|
363 | 363 | <!-- submit button text --> |
364 | - <label for="yikes-easy-mc-submit-button-text"><strong><?php _e( 'Submit Button Text' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
365 | - <input type="text" class="widefat" name="yikes-easy-mc-submit-button-text" id="yikes-easy-mc-submit-button-text" value="<?php echo $form_settings['yikes-easy-mc-submit-button-text']; ?>" placeholder="<?php _e( 'Submit', 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
364 | + <label for="yikes-easy-mc-submit-button-text"><strong><?php _e( 'Submit Button Text', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
365 | + <input type="text" class="widefat" name="yikes-easy-mc-submit-button-text" id="yikes-easy-mc-submit-button-text" value="<?php echo $form_settings[ 'yikes-easy-mc-submit-button-text' ]; ?>" placeholder="<?php _e( 'Submit', 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
366 | 366 | <p class="description"><?php printf( __( 'Set the submit button text. Leaving this blank will default to %s.', 'yikes-inc-easy-mailchimp-extender' ), '"' . __( 'Submit', 'yikes-inc-easy-mailchimp-extender' ) . '"' ); ?></p> |
367 | 367 | |
368 | 368 | <p class="description"><?php _e( 'The submit button text set above, can be overwritten on a per-form basis using shortcodes.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -371,9 +371,9 @@ discard block |
||
371 | 371 | <!-- end text submit button type --> |
372 | 372 | |
373 | 373 | <!-- Image submit button type --> |
374 | - <section class="submit-button-type-image nested-child<?php if( $form_settings['yikes-easy-mc-submit-button-type'] == 'text' ) { echo ' hidden'; } ?>"> |
|
375 | - <label for="yikes-easy-mc-submit-button-image"><strong><?php _e( 'Submit Button URL' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
376 | - <input type="text" class="widefat" name="yikes-easy-mc-submit-button-image" id="yikes-easy-mc-submit-button-image" value="<?php echo $form_settings['yikes-easy-mc-submit-button-image']; ?>" placeholder="<?php _e( 'http://', 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
374 | + <section class="submit-button-type-image nested-child<?php if ( $form_settings[ 'yikes-easy-mc-submit-button-type' ] == 'text' ) { echo ' hidden'; } ?>"> |
|
375 | + <label for="yikes-easy-mc-submit-button-image"><strong><?php _e( 'Submit Button URL', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
376 | + <input type="text" class="widefat" name="yikes-easy-mc-submit-button-image" id="yikes-easy-mc-submit-button-image" value="<?php echo $form_settings[ 'yikes-easy-mc-submit-button-image' ]; ?>" placeholder="<?php _e( 'http://', 'yikes-inc-easy-mailchimp-extender' ); ?>"> |
|
377 | 377 | <p class="description"><?php _e( 'Enter the URL of an image you would like to use as the submit button for this form.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
378 | 378 | </label> |
379 | 379 | </section> |
@@ -381,8 +381,8 @@ discard block |
||
381 | 381 | |
382 | 382 | |
383 | 383 | <!-- submit button classes --> |
384 | - <label for="yikes-easy-mc-form-submit-button-classes"><strong style="float:left;"><?php _e( 'Submit Button Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
385 | - <input type="text" class="widefat" name="yikes-easy-mc-submit-button-classes" id="yikes-easy-mc-submit-button-classes" value="<?php echo $form_settings['yikes-easy-mc-submit-button-classes']; ?>" placeholder="<?php _e( 'Add additional classes to this submit button.', 'yikes-inc-easy-mailchimp-extender' ); ?>" > |
|
384 | + <label for="yikes-easy-mc-form-submit-button-classes"><strong style="float:left;"><?php _e( 'Submit Button Classes', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
385 | + <input type="text" class="widefat" name="yikes-easy-mc-submit-button-classes" id="yikes-easy-mc-submit-button-classes" value="<?php echo $form_settings[ 'yikes-easy-mc-submit-button-classes' ]; ?>" placeholder="<?php _e( 'Add additional classes to this submit button.', 'yikes-inc-easy-mailchimp-extender' ); ?>" > |
|
386 | 386 | <p class="description"><?php _e( 'Add custom classes to the submit button.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
387 | 387 | </label> |
388 | 388 | <!-- end submit button classes --> |
@@ -395,45 +395,45 @@ discard block |
||
395 | 395 | <section class="section-interior"> |
396 | 396 | <!-- Schedule form --> |
397 | 397 | <label class="inline-form-label"> |
398 | - <input type="checkbox" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-form-schedule" value="1" <?php checked( $form_settings['yikes-easy-mc-form-schedule'], '1' ); ?>/><?php _e( 'Schedule Form', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
398 | + <input type="checkbox" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-form-schedule" value="1" <?php checked( $form_settings[ 'yikes-easy-mc-form-schedule' ], '1' ); ?>/><?php _e( 'Schedule Form', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
399 | 399 | </label> |
400 | 400 | <p class="description" style="margin-bottom:0;"><?php _e( 'Set a time period that this form should be active on your site. (mm/dd/yyyy)', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
401 | 401 | <p class="description" style="margin: 0 0 .5em 0;"><?php _e( 'Once the end date & time have passed, users will no longer be able to signup for your mailing list.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
402 | 402 | <!-- Start Date Limitation Nested --> |
403 | - <section class="date-restirction-section nested-child<?php if( $form_settings['yikes-easy-mc-form-schedule'] == '0' ) { echo ' hidden'; } ?>"> |
|
403 | + <section class="date-restirction-section nested-child<?php if ( $form_settings[ 'yikes-easy-mc-form-schedule' ] == '0' ) { echo ' hidden'; } ?>"> |
|
404 | 404 | <!-- Start Date --> |
405 | - <label for="yikes-easy-mc-form-restriction-start-date"><strong><?php _e( 'Start Date' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
406 | - <input type="text" class="date-picker" name="yikes-easy-mc-form-restriction-start-date" id="yikes-easy-mc-form-restriction-start-date" value="<?php echo date( $this->yikes_jQuery_datepicker_date_format( get_option( 'date_format' ) ), $form_settings['yikes-easy-mc-form-restriction-start'] ); ?>" > |
|
405 | + <label for="yikes-easy-mc-form-restriction-start-date"><strong><?php _e( 'Start Date', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
406 | + <input type="text" class="date-picker" name="yikes-easy-mc-form-restriction-start-date" id="yikes-easy-mc-form-restriction-start-date" value="<?php echo date( $this->yikes_jQuery_datepicker_date_format( get_option( 'date_format' ) ), $form_settings[ 'yikes-easy-mc-form-restriction-start' ] ); ?>" > |
|
407 | 407 | <?php _e( 'at', 'yikes-inc-easy-mailchimp-extender' ); ?> |
408 | 408 | </label> |
409 | 409 | |
410 | 410 | <!-- Start Time --> |
411 | - <label for="yikes-easy-mc-form-restriction-start-time"><strong><?php _e( 'Start Time' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
412 | - <input type="text" class="time-picker" name="yikes-easy-mc-form-restriction-start-time" id="yikes-easy-mc-form-restriction-start-time" value="<?php echo date( 'g:iA', $form_settings['yikes-easy-mc-form-restriction-start'] ); ?>" > |
|
411 | + <label for="yikes-easy-mc-form-restriction-start-time"><strong><?php _e( 'Start Time', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
412 | + <input type="text" class="time-picker" name="yikes-easy-mc-form-restriction-start-time" id="yikes-easy-mc-form-restriction-start-time" value="<?php echo date( 'g:iA', $form_settings[ 'yikes-easy-mc-form-restriction-start' ] ); ?>" > |
|
413 | 413 | </label> |
414 | 414 | <p class="description"><?php _e( 'Set the dates that this form should display on your site.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
415 | 415 | </section> |
416 | 416 | <!-- end Start Date Limitation Nested --> |
417 | 417 | |
418 | 418 | <!-- End Date Limitation Nested --> |
419 | - <section class="date-restirction-section nested-child<?php if( $form_settings['yikes-easy-mc-form-schedule'] == '0' ) { echo ' hidden'; } ?> last"> |
|
419 | + <section class="date-restirction-section nested-child<?php if ( $form_settings[ 'yikes-easy-mc-form-schedule' ] == '0' ) { echo ' hidden'; } ?> last"> |
|
420 | 420 | <!-- End Date --> |
421 | - <label for="yikes-easy-mc-form-restriction-end-date"><strong><?php _e( 'End Date' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
422 | - <input type="text" class="date-picker" name="yikes-easy-mc-form-restriction-end-date" id="yikes-easy-mc-form-restriction-end-date" value="<?php echo date( $this->yikes_jQuery_datepicker_date_format( get_option( 'date_format' ) ), $form_settings['yikes-easy-mc-form-restriction-end'] ); ?>" > |
|
421 | + <label for="yikes-easy-mc-form-restriction-end-date"><strong><?php _e( 'End Date', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
422 | + <input type="text" class="date-picker" name="yikes-easy-mc-form-restriction-end-date" id="yikes-easy-mc-form-restriction-end-date" value="<?php echo date( $this->yikes_jQuery_datepicker_date_format( get_option( 'date_format' ) ), $form_settings[ 'yikes-easy-mc-form-restriction-end' ] ); ?>" > |
|
423 | 423 | <?php _e( 'at', 'yikes-inc-easy-mailchimp-extender' ); ?> |
424 | 424 | </label> |
425 | 425 | |
426 | 426 | <!-- End Time --> |
427 | - <label for="yikes-easy-mc-form-restriction-end-time"><strong><?php _e( 'End Time' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
428 | - <input type="text" class="time-picker" name="yikes-easy-mc-form-restriction-end-time" id="yikes-easy-mc-form-restriction-end-time" value="<?php echo date( 'g:iA', $form_settings['yikes-easy-mc-form-restriction-end'] ); ?>" > |
|
427 | + <label for="yikes-easy-mc-form-restriction-end-time"><strong><?php _e( 'End Time', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
428 | + <input type="text" class="time-picker" name="yikes-easy-mc-form-restriction-end-time" id="yikes-easy-mc-form-restriction-end-time" value="<?php echo date( 'g:iA', $form_settings[ 'yikes-easy-mc-form-restriction-end' ] ); ?>" > |
|
429 | 429 | </label> |
430 | 430 | <p class="description"><?php _e( 'Set the dates that this form should no longer display on your site.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
431 | 431 | |
432 | 432 | <!-- Form pending message --> |
433 | - <label for="yikes-easy-mc-form-restriction-pending-message"><strong><?php _e( 'Pending Message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
433 | + <label for="yikes-easy-mc-form-restriction-pending-message"><strong><?php _e( 'Pending Message', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
434 | 434 | <?php |
435 | 435 | wp_editor( |
436 | - $form_settings['yikes-easy-mc-form-restriction-pending-message'], |
|
436 | + $form_settings[ 'yikes-easy-mc-form-restriction-pending-message' ], |
|
437 | 437 | 'yikes-easy-mc-form-restriction-pending-message', |
438 | 438 | array( |
439 | 439 | 'editor_class' => 'yikes-easy-mc-form-restriction-pending-message', |
@@ -445,10 +445,10 @@ discard block |
||
445 | 445 | <p class="description"><?php _e( 'Set the message that should display prior to the form being active.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
446 | 446 | |
447 | 447 | <!-- form expired message --> |
448 | - <label for="yikes-easy-mc-form-restriction-expired-message"><strong><?php _e( 'Expired Message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
448 | + <label for="yikes-easy-mc-form-restriction-expired-message"><strong><?php _e( 'Expired Message', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
449 | 449 | <?php |
450 | 450 | wp_editor( |
451 | - $form_settings['yikes-easy-mc-form-restriction-expired-message'], |
|
451 | + $form_settings[ 'yikes-easy-mc-form-restriction-expired-message' ], |
|
452 | 452 | 'yikes-easy-mc-form-restriction-expired-message', |
453 | 453 | array( |
454 | 454 | 'editor_class' => 'yikes-easy-mc-form-restriction-expired-message', |
@@ -463,16 +463,16 @@ discard block |
||
463 | 463 | |
464 | 464 | <!-- Require Users to be Logged In --> |
465 | 465 | <label class="inline-form-label"> |
466 | - <input type="checkbox" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-form-login-required" value="1" <?php checked( $form_settings['yikes-easy-mc-form-login-required'], '1' ); ?> /><?php _e( 'Require Login', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
466 | + <input type="checkbox" onclick="toggle_nested_section( jQuery(this) );" name="yikes-easy-mc-form-login-required" value="1" <?php checked( $form_settings[ 'yikes-easy-mc-form-login-required' ], '1' ); ?> /><?php _e( 'Require Login', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
467 | 467 | </label> |
468 | 468 | <p class="description"><?php _e( 'Require users to be logged in before they can view and submit this opt-in form.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
469 | 469 | |
470 | 470 | <!-- Require Login Message --> |
471 | - <section class="login-restirction-section nested-child<?php if( $form_settings['yikes-easy-mc-form-login-required'] == '0' ) { echo ' hidden'; } ?>"> |
|
472 | - <label for="yikes-easy-mc-form-restriction-login-message"><strong><?php _e( 'Required Login Message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
471 | + <section class="login-restirction-section nested-child<?php if ( $form_settings[ 'yikes-easy-mc-form-login-required' ] == '0' ) { echo ' hidden'; } ?>"> |
|
472 | + <label for="yikes-easy-mc-form-restriction-login-message"><strong><?php _e( 'Required Login Message', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
473 | 473 | <?php |
474 | 474 | wp_editor( |
475 | - $form_settings['yikes-easy-mc-form-restriction-login-message'], |
|
475 | + $form_settings[ 'yikes-easy-mc-form-restriction-login-message' ], |
|
476 | 476 | 'yikes-easy-mc-form-restriction-login-message', |
477 | 477 | array( |
478 | 478 | 'editor_class' => 'yikes-easy-mc-form-restriction-login-message', |
@@ -501,14 +501,14 @@ discard block |
||
501 | 501 | <div id="postbox-container-1" class="postbox-container"> |
502 | 502 | <div class="meta-box-sortables"> |
503 | 503 | <div class="postbox yikes-easy-mc-postbox"> |
504 | - <h3 class="edit-form-title"><span><?php _e( "Form Settings Explained" , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
504 | + <h3 class="edit-form-title"><span><?php _e( "Form Settings Explained", 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
505 | 505 | <div class="inside"> |
506 | 506 | |
507 | 507 | <ul> |
508 | - <li><strong><?php _e( 'Classes' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Add additional classes to this form, allowing you to target it more easily for customization via CSS.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
509 | - <li><strong><?php _e( 'Form Layout' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Toggle the layout of this form between single column and an inline layout. The inline layout places all of your form fields and the submit button on a single line.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
510 | - <li><strong><?php _e( 'Submit Button' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Adjust setting specific to the submit button. Change the submit button text, or set it to a specified image. Use the "Submit Button Classes" to assign additional classes to your submit button - ensuring it fits better into your theme.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
511 | - <li><strong><?php _e( 'Form Restrictions' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Adjust the restrictions for this form. Limit form visibility to a given time period, require users to be logged in to sign up or combine the two!' , 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
508 | + <li><strong><?php _e( 'Classes', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Add additional classes to this form, allowing you to target it more easily for customization via CSS.', 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
509 | + <li><strong><?php _e( 'Form Layout', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Toggle the layout of this form between single column and an inline layout. The inline layout places all of your form fields and the submit button on a single line.', 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
510 | + <li><strong><?php _e( 'Submit Button', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Adjust setting specific to the submit button. Change the submit button text, or set it to a specified image. Use the "Submit Button Classes" to assign additional classes to your submit button - ensuring it fits better into your theme.', 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
511 | + <li><strong><?php _e( 'Form Restrictions', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'Adjust the restrictions for this form. Limit form visibility to a given time period, require users to be logged in to sign up or combine the two!', 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
512 | 512 | </ul> |
513 | 513 | |
514 | 514 | </div> |
@@ -536,41 +536,41 @@ discard block |
||
536 | 536 | <div id="post-body-content"> |
537 | 537 | <div class="meta-box-sortables ui-sortable"> |
538 | 538 | <div class="postbox yikes-easy-mc-postbox"> |
539 | - <h3 class="edit-form-title"><span><?php _e( "Custom Messages" , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
539 | + <h3 class="edit-form-title"><span><?php _e( "Custom Messages", 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
540 | 540 | |
541 | 541 | <div class="inside error-message-container"> |
542 | 542 | <?php |
543 | 543 | // build our default options |
544 | 544 | $error_message_array = array( |
545 | - 'success' => __( 'Thank You for subscribing! Check your email for the confirmation message.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
546 | - 'general-error' => __( "Whoops! It looks like something went wrong. Please try again." , 'yikes-inc-easy-mailchimp-extender' ), |
|
547 | - 'invalid-email' => __( "Please provide a valid email address." , 'yikes-inc-easy-mailchimp-extender' ), |
|
548 | - 'email-exists-error' => __( "The provided email is already subscribed to this list." , 'yikes-inc-easy-mailchimp-extender' ), |
|
549 | - 'update-link' => __ ( "To update your MailChimp profile, please [link]click to send yourself an update link[/link].", 'yikes-inc-easy-mailchimp-extender' ), |
|
545 | + 'success' => __( 'Thank You for subscribing! Check your email for the confirmation message.', 'yikes-inc-easy-mailchimp-extender' ), |
|
546 | + 'general-error' => __( "Whoops! It looks like something went wrong. Please try again.", 'yikes-inc-easy-mailchimp-extender' ), |
|
547 | + 'invalid-email' => __( "Please provide a valid email address.", 'yikes-inc-easy-mailchimp-extender' ), |
|
548 | + 'email-exists-error' => __( "The provided email is already subscribed to this list.", 'yikes-inc-easy-mailchimp-extender' ), |
|
549 | + 'update-link' => __( "To update your MailChimp profile, please [link]click to send yourself an update link[/link].", 'yikes-inc-easy-mailchimp-extender' ), |
|
550 | 550 | ); |
551 | - $global_error_messages = get_option( 'yikes-easy-mc-global-error-messages' , $error_message_array ); |
|
551 | + $global_error_messages = get_option( 'yikes-easy-mc-global-error-messages', $error_message_array ); |
|
552 | 552 | ?> |
553 | - <p class="edit-form-description"><?php _e( "Enter your custom messages for this form below. Leave the field blank to use the default global error message." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
553 | + <p class="edit-form-description"><?php _e( "Enter your custom messages for this form below. Leave the field blank to use the default global error message.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
554 | 554 | |
555 | 555 | <!-- Success Message --> |
556 | - <label for="yikes-easy-mc-success-message"><strong><?php _e( 'Success Message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
557 | - <input type="text" class="widefat" name="yikes-easy-mc-success-message" id="yikes-easy-mc-success-message" value="<?php echo isset( $error_messages['success'] ) ? stripslashes( esc_html( $error_messages['success'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['success']; ?>" > |
|
556 | + <label for="yikes-easy-mc-success-message"><strong><?php _e( 'Success Message', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
557 | + <input type="text" class="widefat" name="yikes-easy-mc-success-message" id="yikes-easy-mc-success-message" value="<?php echo isset( $error_messages[ 'success' ] ) ? stripslashes( esc_html( $error_messages[ 'success' ] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages[ 'success' ]; ?>" > |
|
558 | 558 | </label> |
559 | 559 | <!-- General Error Message --> |
560 | - <label for="yikes-easy-mc-general-error-message"><strong><?php _e( 'General Error Message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
561 | - <input type="text" class="widefat" name="yikes-easy-mc-general-error-message" id="yikes-easy-mc-general-error-message" value="<?php echo isset( $error_messages['general-error'] ) ? stripslashes( esc_html( $error_messages['general-error'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['general-error']; ?>" > |
|
560 | + <label for="yikes-easy-mc-general-error-message"><strong><?php _e( 'General Error Message', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
561 | + <input type="text" class="widefat" name="yikes-easy-mc-general-error-message" id="yikes-easy-mc-general-error-message" value="<?php echo isset( $error_messages[ 'general-error' ] ) ? stripslashes( esc_html( $error_messages[ 'general-error' ] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages[ 'general-error' ]; ?>" > |
|
562 | 562 | </label> |
563 | 563 | <!-- Invalid Email Address Message --> |
564 | - <label for="yikes-easy-mc-invalid-email-message"><strong><?php _e( 'Invalid Email' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
565 | - <input type="text" class="widefat" name="yikes-easy-mc-invalid-email-message" id="yikes-easy-mc-invalid-email-message" value="<?php echo isset( $error_messages['invalid-email'] ) ? stripslashes( esc_html( $error_messages['invalid-email'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['invalid-email']; ?>"> |
|
564 | + <label for="yikes-easy-mc-invalid-email-message"><strong><?php _e( 'Invalid Email', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
565 | + <input type="text" class="widefat" name="yikes-easy-mc-invalid-email-message" id="yikes-easy-mc-invalid-email-message" value="<?php echo isset( $error_messages[ 'invalid-email' ] ) ? stripslashes( esc_html( $error_messages[ 'invalid-email' ] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages[ 'invalid-email' ]; ?>"> |
|
566 | 566 | </label> |
567 | 567 | <!-- Email Address is already subscribed --> |
568 | - <label for="yikes-easy-mc-user-subscribed-message"><strong><?php _e( 'Email Already Subscribed' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
569 | - <input type="text" class="widefat" name="yikes-easy-mc-user-subscribed-message" id="yikes-easy-mc-user-subscribed-message" value="<?php echo isset( $error_messages['already-subscribed'] ) ? stripslashes( esc_html( $error_messages['already-subscribed'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['email-exists-error']; ?>"> |
|
568 | + <label for="yikes-easy-mc-user-subscribed-message"><strong><?php _e( 'Email Already Subscribed', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
569 | + <input type="text" class="widefat" name="yikes-easy-mc-user-subscribed-message" id="yikes-easy-mc-user-subscribed-message" value="<?php echo isset( $error_messages[ 'already-subscribed' ] ) ? stripslashes( esc_html( $error_messages[ 'already-subscribed' ] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages[ 'email-exists-error' ]; ?>"> |
|
570 | 570 | </label> |
571 | 571 | <!-- Click the link to update user profile etc. etc. --> |
572 | - <label for="yikes-easy-mc-user-subscribed-update-link"><strong><?php _e( 'Update Link' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
573 | - <input type="text" class="widefat" name="yikes-easy-mc-user-update-link" id="yikes-easy-mc-user-update-link" value="<?php echo isset( $error_messages['update-link'] ) ? stripslashes( esc_html( $error_messages['update-link'] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages['update-link']; ?>"> |
|
572 | + <label for="yikes-easy-mc-user-subscribed-update-link"><strong><?php _e( 'Update Link', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
573 | + <input type="text" class="widefat" name="yikes-easy-mc-user-update-link" id="yikes-easy-mc-user-update-link" value="<?php echo isset( $error_messages[ 'update-link' ] ) ? stripslashes( esc_html( $error_messages[ 'update-link' ] ) ) : ''; ?>" placeholder="<?php echo $global_error_messages[ 'update-link' ]; ?>"> |
|
574 | 574 | </label> |
575 | 575 | </div> |
576 | 576 | |
@@ -585,15 +585,15 @@ discard block |
||
585 | 585 | <div id="postbox-container-1" class="postbox-container"> |
586 | 586 | <div class="meta-box-sortables"> |
587 | 587 | <div class="postbox yikes-easy-mc-postbox"> |
588 | - <h3 class="edit-form-title"><span><?php _e( "Error Message Explanation" , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
588 | + <h3 class="edit-form-title"><span><?php _e( "Error Message Explanation", 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
589 | 589 | <div class="inside"> |
590 | 590 | |
591 | 591 | <ul> |
592 | - <li><strong><?php _e( 'Success Message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The message displayed to the user after they have submitted the form and the data has been successfully sent to MailChimp.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
593 | - <li><strong><?php _e( 'General Error Message' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The message displayed to the user after a generic error has occurred.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
594 | - <li><strong><?php _e( 'Invalid Email' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The message displayed to the user after they have entered a non-valid email address.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
595 | - <li><strong><?php _e( 'Email Already Subscribed' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The message displayed to the user after they attempt to sign up for a mailing list using an email address that is already subscribed. You can display the user email back in the response by using an <code>[email]</code> tag. This will be replaced with the email entered by the user, in the response.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
596 | - <li><strong><?php _e( 'Update Link' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The update link is used when you allow users to generate an update email, when they are already subscribed to a list. Wrap the text you want to use as the link in <code>[link][/link]</code> tags.' , 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
592 | + <li><strong><?php _e( 'Success Message', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The message displayed to the user after they have submitted the form and the data has been successfully sent to MailChimp.', 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
593 | + <li><strong><?php _e( 'General Error Message', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The message displayed to the user after a generic error has occurred.', 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
594 | + <li><strong><?php _e( 'Invalid Email', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The message displayed to the user after they have entered a non-valid email address.', 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
595 | + <li><strong><?php _e( 'Email Already Subscribed', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The message displayed to the user after they attempt to sign up for a mailing list using an email address that is already subscribed. You can display the user email back in the response by using an <code>[email]</code> tag. This will be replaced with the email entered by the user, in the response.', 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
596 | + <li><strong><?php _e( 'Update Link', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> : <?php _e( 'The update link is used when you allow users to generate an update email, when they are already subscribed to a list. Wrap the text you want to use as the link in <code>[link][/link]</code> tags.', 'yikes-inc-easy-mailchimp-extender' ); ?></li> |
|
597 | 597 | </ul> |
598 | 598 | |
599 | 599 | </div> |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | </label> |
613 | 613 | <!-- End Error Messages --> |
614 | 614 | |
615 | - <?php do_action( 'yikes-mailchimp-edit-form-sections' , $form ); ?> |
|
615 | + <?php do_action( 'yikes-mailchimp-edit-form-sections', $form ); ?> |
|
616 | 616 | |
617 | 617 | </div> |
618 | 618 | <!-- .inside --> |
@@ -627,107 +627,107 @@ discard block |
||
627 | 627 | <div id="postbox-container-1" class="postbox-container yikes-easy-forms-sidebar"> |
628 | 628 | <div class="meta-box-sortables"> |
629 | 629 | <div class="postbox yikes-easy-mc-postbox"> |
630 | - <h3><span><?php _e( 'Form Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
630 | + <h3><span><?php _e( 'Form Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
631 | 631 | |
632 | 632 | <div class="inside"> |
633 | 633 | <p class="inside-section-1"> |
634 | - <label for="shortcode"><?php _e( 'Edit Another Form' , 'yikes-inc-easy-mailchimp-extender' ); ?><br /> |
|
634 | + <label for="shortcode"><?php _e( 'Edit Another Form', 'yikes-inc-easy-mailchimp-extender' ); ?><br /> |
|
635 | 635 | <select class="widefat" name="form_switcher" id="form_switcher" onchange="YIKES_Easy_MC_SwitchForm(jQuery(this).val());"> |
636 | - <?php foreach( $all_forms as $single_form ) { ?> |
|
637 | - <option <?php selected( $form_id , $single_form['id'] ); ?>value="<?php echo $single_form['id']; ?>"><?php echo $single_form['form_name']; ?></option> |
|
636 | + <?php foreach ( $all_forms as $single_form ) { ?> |
|
637 | + <option <?php selected( $form_id, $single_form[ 'id' ] ); ?>value="<?php echo $single_form[ 'id' ]; ?>"><?php echo $single_form[ 'form_name' ]; ?></option> |
|
638 | 638 | <?php } ?> |
639 | 639 | </select> |
640 | 640 | </label> |
641 | 641 | </p> |
642 | 642 | |
643 | 643 | <p class="inside-section-2"> |
644 | - <label for="shortcode"><?php _e( 'Shortcode' , 'yikes-inc-easy-mailchimp-extender' ); ?><br /> |
|
645 | - <input type="text" onclick="this.setSelectionRange(0, this.value.length)" class="widefat shortcode-input-field" readonly value='[yikes-mailchimp form="<?php echo $form['id']; ?>"]' /> |
|
644 | + <label for="shortcode"><?php _e( 'Shortcode', 'yikes-inc-easy-mailchimp-extender' ); ?><br /> |
|
645 | + <input type="text" onclick="this.setSelectionRange(0, this.value.length)" class="widefat shortcode-input-field" readonly value='[yikes-mailchimp form="<?php echo $form[ 'id' ]; ?>"]' /> |
|
646 | 646 | </label> |
647 | 647 | </p> |
648 | 648 | |
649 | 649 | |
650 | 650 | <a href="#" class="expansion-section-title settings-sidebar"> |
651 | - <span class="dashicons dashicons-plus"></span><?php _e( 'Associated List Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
651 | + <span class="dashicons dashicons-plus"></span><?php _e( 'Associated List Settings', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
652 | 652 | </a> |
653 | 653 | <div class="yikes-mc-settings-expansion-section"> |
654 | 654 | <!-- Associated List --> |
655 | - <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="associated-list"><strong><?php _e( 'Associated List' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
655 | + <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="associated-list"><strong><?php _e( 'Associated List', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
656 | 656 | <select name="associated-list" id="associated-list" <?php if ( empty( $list_data ) ) { echo 'disabled="disabled"'; } ?> onchange="jQuery('.view-list-link').attr( 'href', '<?php echo esc_url( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' ) ); ?>' + jQuery( this ).val() );"> |
657 | 657 | <?php |
658 | 658 | if ( ! empty( $list_data ) ) { |
659 | - foreach( $list_data as $mailing_list ) { |
|
659 | + foreach ( $list_data as $mailing_list ) { |
|
660 | 660 | ?> |
661 | - <option <?php selected( $form['list_id'] , $mailing_list['id'] ); ?> value="<?php echo $mailing_list['id']; ?>"><?php echo stripslashes( $mailing_list['name'] ) . ' (' . $mailing_list['stats']['member_count'] . ') '; ?></option> |
|
661 | + <option <?php selected( $form[ 'list_id' ], $mailing_list[ 'id' ] ); ?> value="<?php echo $mailing_list[ 'id' ]; ?>"><?php echo stripslashes( $mailing_list[ 'name' ] ) . ' (' . $mailing_list[ 'stats' ][ 'member_count' ] . ') '; ?></option> |
|
662 | 662 | <?php |
663 | 663 | } |
664 | 664 | } else { |
665 | 665 | ?> |
666 | - <option value="no-forms"><?php _e( 'No Lists Found' , 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
666 | + <option value="no-forms"><?php _e( 'No Lists Found', 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
667 | 667 | <?php |
668 | 668 | } |
669 | 669 | ?> |
670 | 670 | </select> |
671 | - <?php if( !empty( $list_data['data'] ) ) { ?> |
|
671 | + <?php if ( ! empty( $list_data[ 'data' ] ) ) { ?> |
|
672 | 672 | <p class="description view-list"> |
673 | - <a href="<?php echo esc_url( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $form['list_id'] ) ); ?>" class="view-list-link"><?php _e( 'View List', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
673 | + <a href="<?php echo esc_url( admin_url( 'admin.php?page=yikes-mailchimp-view-list&list-id=' . $form[ 'list_id' ] ) ); ?>" class="view-list-link"><?php _e( 'View List', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
674 | 674 | </p> |
675 | 675 | <p class="description"> |
676 | - <?php _e( "Users who sign up via this form will be added to the list selected above." , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
676 | + <?php _e( "Users who sign up via this form will be added to the list selected above.", 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
677 | 677 | </p> |
678 | 678 | <?php } else { ?> |
679 | 679 | <p class="description"> |
680 | - <?php _e( "It looks like you first need to create a list to assign this form to. Head over to" , 'yikes-inc-easy-mailchimp-extender' ); ?> <a href="http://www.MailChimp.com" title="<?php _e( 'Create a new list' , 'yikes-inc-easy-mailchimp-extender' ); ?>">MailChimp</a> <?php _e( 'to create your first list' , 'yikes-inc-easy-mailchimp-extender' ); ?>. |
|
680 | + <?php _e( "It looks like you first need to create a list to assign this form to. Head over to", 'yikes-inc-easy-mailchimp-extender' ); ?> <a href="http://www.MailChimp.com" title="<?php _e( 'Create a new list', 'yikes-inc-easy-mailchimp-extender' ); ?>">MailChimp</a> <?php _e( 'to create your first list', 'yikes-inc-easy-mailchimp-extender' ); ?>. |
|
681 | 681 | </p> |
682 | 682 | <?php } ?> |
683 | 683 | </label></p> |
684 | 684 | </div> |
685 | 685 | |
686 | 686 | <a href="#" class="expansion-section-title settings-sidebar"> |
687 | - <span class="dashicons dashicons-plus"></span><?php _e( 'Opt-in Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
687 | + <span class="dashicons dashicons-plus"></span><?php _e( 'Opt-in Settings', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
688 | 688 | </a> |
689 | 689 | <div class="yikes-mc-settings-expansion-section"> |
690 | 690 | |
691 | 691 | <!-- Single or Double Opt-in --> |
692 | 692 | <?php |
693 | - if( !isset( $optin_settings['optin'] ) ) { |
|
694 | - $optin_settings['optin'] = '1'; |
|
693 | + if ( ! isset( $optin_settings[ 'optin' ] ) ) { |
|
694 | + $optin_settings[ 'optin' ] = '1'; |
|
695 | 695 | } |
696 | 696 | ?> |
697 | - <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="single-double-optin"><strong><?php _e( 'Single or Double Opt-in' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
697 | + <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="single-double-optin"><strong><?php _e( 'Single or Double Opt-in', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
698 | 698 | <span class="edit-form-field-container-span"> |
699 | - <label for="single"><input id="single" type="radio" name="single-double-optin" value="0" <?php checked( $optin_settings['optin'] , '0' ); ?>><?php _e( 'Single' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
700 | - <label for="double"><input id="double" type="radio" name="single-double-optin" value="1" <?php checked( $optin_settings['optin'] , '1' ); ?>><?php _e( 'Double' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
699 | + <label for="single"><input id="single" type="radio" name="single-double-optin" value="0" <?php checked( $optin_settings[ 'optin' ], '0' ); ?>><?php _e( 'Single', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
700 | + <label for="double"><input id="double" type="radio" name="single-double-optin" value="1" <?php checked( $optin_settings[ 'optin' ], '1' ); ?>><?php _e( 'Double', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
701 | 701 | </span> |
702 | - <p class="description"><?php _e( "Double opt-in requires users to confirm their email address before being added to a list (recommended)" , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
702 | + <p class="description"><?php _e( "Double opt-in requires users to confirm their email address before being added to a list (recommended)", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
703 | 703 | </label></p> |
704 | 704 | |
705 | 705 | <!-- Welcome Email --> |
706 | 706 | <?php |
707 | - if( !isset( $optin_settings['send_welcome_email'] ) ) { |
|
708 | - $optin_settings['send_welcome_email'] = '1'; |
|
707 | + if ( ! isset( $optin_settings[ 'send_welcome_email' ] ) ) { |
|
708 | + $optin_settings[ 'send_welcome_email' ] = '1'; |
|
709 | 709 | } |
710 | 710 | ?> |
711 | - <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="send-welcome-email"><strong><?php _e( 'Send Welcome Email' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
711 | + <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="send-welcome-email"><strong><?php _e( 'Send Welcome Email', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
712 | 712 | <span class="edit-form-field-container-span"> |
713 | - <label for="send-welcome"><input id="send-welcome" type="radio" name="send-welcome-email" value="1" <?php checked( $optin_settings['send_welcome_email'] , '1' ); ?>><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
714 | - <label for="do-not-send-welcome"><input id="do-not-send-welcome" type="radio" name="send-welcome-email" value="0" <?php checked( $optin_settings['send_welcome_email'] , '0' ); ?>><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
713 | + <label for="send-welcome"><input id="send-welcome" type="radio" name="send-welcome-email" value="1" <?php checked( $optin_settings[ 'send_welcome_email' ], '1' ); ?>><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
714 | + <label for="do-not-send-welcome"><input id="do-not-send-welcome" type="radio" name="send-welcome-email" value="0" <?php checked( $optin_settings[ 'send_welcome_email' ], '0' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
715 | 715 | </span> |
716 | - <p class="description"><?php _e( "When a user signs up, should they receive the default welcome email?" , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
716 | + <p class="description"><?php _e( "When a user signs up, should they receive the default welcome email?", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
717 | 717 | </label></p> |
718 | 718 | |
719 | 719 | <!-- Update Existing Users --> |
720 | 720 | <?php |
721 | - if( !isset( $optin_settings['update_existing_user'] ) ) { |
|
722 | - $optin_settings['update_existing_user'] = '1'; |
|
721 | + if ( ! isset( $optin_settings[ 'update_existing_user' ] ) ) { |
|
722 | + $optin_settings[ 'update_existing_user' ] = '1'; |
|
723 | 723 | } |
724 | 724 | ?> |
725 | - <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="update-existing-user"><strong><?php _e( 'Update Existing Subscriber' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
725 | + <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="update-existing-user"><strong><?php _e( 'Update Existing Subscriber', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
726 | 726 | <span class="form-field-container-span"> |
727 | - <label for="update-user"><input type="radio" id="update-user" onchange="toggleUpdateEmailContainer(this);return false;" name="update-existing-user" value="1" <?php checked( $optin_settings['update_existing_user'] , '1' ); ?>><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
728 | - <label for="do-not-update-user"><input type="radio" onchange="toggleUpdateEmailContainer(this);return false;" id="do-not-update-user" name="update-existing-user" value="0" <?php checked( $optin_settings['update_existing_user'] , '0' ); ?>><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
727 | + <label for="update-user"><input type="radio" id="update-user" onchange="toggleUpdateEmailContainer(this);return false;" name="update-existing-user" value="1" <?php checked( $optin_settings[ 'update_existing_user' ], '1' ); ?>><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
728 | + <label for="do-not-update-user"><input type="radio" onchange="toggleUpdateEmailContainer(this);return false;" id="do-not-update-user" name="update-existing-user" value="0" <?php checked( $optin_settings[ 'update_existing_user' ], '0' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
729 | 729 | </span> |
730 | - <p class="description"><?php printf( __( "Update an existing subscriber's profile information instead of displaying a %s message." , "yikes-inc-easy-mailchimp-extender" ), __( '"user already subscribed"', 'yikes-inc-easy-mailchimp-extender' ) ); ?></p> |
|
730 | + <p class="description"><?php printf( __( "Update an existing subscriber's profile information instead of displaying a %s message.", "yikes-inc-easy-mailchimp-extender" ), __( '"user already subscribed"', 'yikes-inc-easy-mailchimp-extender' ) ); ?></p> |
|
731 | 731 | </label></p> |
732 | 732 | |
733 | 733 | <!-- |
@@ -736,82 +736,82 @@ discard block |
||
736 | 736 | - No = Just update the user profile without an email |
737 | 737 | --> |
738 | 738 | <?php |
739 | - $send_update_email = ( isset( $optin_settings['send_update_email'] ) && '' !== $optin_settings['send_update_email'] ) ? $optin_settings['send_update_email'] : 0; |
|
739 | + $send_update_email = ( isset( $optin_settings[ 'send_update_email' ] ) && '' !== $optin_settings[ 'send_update_email' ] ) ? $optin_settings[ 'send_update_email' ] : 0; |
|
740 | 740 | ?> |
741 | - <p class="form-field-container send-update-email" <?php if ( 1 !== absint( $optin_settings['update_existing_user'] ) ) { ?>style="display:none;"<?php } ?>><!-- necessary to prevent skipping on slideToggle(); --><label for="update-existing-user"><strong><?php _e( 'Send Update Email' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
741 | + <p class="form-field-container send-update-email" <?php if ( 1 !== absint( $optin_settings[ 'update_existing_user' ] ) ) { ?>style="display:none;"<?php } ?>><!-- necessary to prevent skipping on slideToggle(); --><label for="update-existing-user"><strong><?php _e( 'Send Update Email', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
742 | 742 | <span class="form-field-container-span"> |
743 | - <label for="update-email"><input type="radio" id="update-email" name="update-existing-email" value="1" <?php checked( $send_update_email , '1' ); ?>><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
744 | - <label for="do-not-update-email"><input type="radio" id="do-not-update-email" name="update-existing-email" value="0" <?php checked( $send_update_email , '0' ); ?>><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
743 | + <label for="update-email"><input type="radio" id="update-email" name="update-existing-email" value="1" <?php checked( $send_update_email, '1' ); ?>><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
744 | + <label for="do-not-update-email"><input type="radio" id="do-not-update-email" name="update-existing-email" value="0" <?php checked( $send_update_email, '0' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
745 | 745 | </span> |
746 | - <em><?php printf( __( "Send an email to the user granting their permission to update their profile information. Otherwise, an existing subscriber filling out this form, will have their profile information updated without any further interaction." , "yikes-inc-easy-mailchimp-extender" ), __( '"user already subscribed"', 'yikes-inc-easy-mailchimp-extender' ) ); ?></em> |
|
746 | + <em><?php printf( __( "Send an email to the user granting their permission to update their profile information. Otherwise, an existing subscriber filling out this form, will have their profile information updated without any further interaction.", "yikes-inc-easy-mailchimp-extender" ), __( '"user already subscribed"', 'yikes-inc-easy-mailchimp-extender' ) ); ?></em> |
|
747 | 747 | </label></p> |
748 | 748 | |
749 | 749 | </div> |
750 | 750 | |
751 | 751 | <a href="#" class="expansion-section-title settings-sidebar"> |
752 | - <span class="dashicons dashicons-plus"></span><?php _e( 'Submission Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
752 | + <span class="dashicons dashicons-plus"></span><?php _e( 'Submission Settings', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
753 | 753 | </a> |
754 | 754 | <div class="yikes-mc-settings-expansion-section"> |
755 | 755 | <!-- AJAX form Submission --> |
756 | 756 | <?php |
757 | - if( !isset( $submission_settings['ajax'] ) ) { |
|
758 | - $submission_settings['ajax'] = '1'; |
|
757 | + if ( ! isset( $submission_settings[ 'ajax' ] ) ) { |
|
758 | + $submission_settings[ 'ajax' ] = '1'; |
|
759 | 759 | } |
760 | 760 | ?> |
761 | - <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="form-ajax-submission"><strong><?php _e( 'Enable AJAX Submission' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
761 | + <p class="form-field-container"><!-- necessary to prevent skipping on slideToggle(); --><label for="form-ajax-submission"><strong><?php _e( 'Enable AJAX Submission', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
762 | 762 | <span class="form-field-container-span"> |
763 | - <label for="enable-ajax"><input type="radio" id="enable-ajax" name="form-ajax-submission" value="1" <?php checked( $submission_settings['ajax'] , '1' ); ?>><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
764 | - <label for="disable-ajax"><input type="radio" id="disable-ajax" name="form-ajax-submission" value="0" <?php checked( $submission_settings['ajax'] , '0' ); ?>><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
763 | + <label for="enable-ajax"><input type="radio" id="enable-ajax" name="form-ajax-submission" value="1" <?php checked( $submission_settings[ 'ajax' ], '1' ); ?>><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
764 | + <label for="disable-ajax"><input type="radio" id="disable-ajax" name="form-ajax-submission" value="0" <?php checked( $submission_settings[ 'ajax' ], '0' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
765 | 765 | </span> |
766 | - <p class="description"><?php _e( "AJAX form submissions transmit data without requiring the page to refresh." , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
766 | + <p class="description"><?php _e( "AJAX form submissions transmit data without requiring the page to refresh.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
767 | 767 | </label></p> |
768 | 768 | |
769 | 769 | <!-- Redirect User On Submission --> |
770 | 770 | <?php |
771 | - if( !isset( $submission_settings['redirect_on_submission'] ) ) { |
|
772 | - $submission_settings['redirect_on_submission'] = '0'; |
|
773 | - $submission_settings['redirect_page'] = ''; |
|
771 | + if ( ! isset( $submission_settings[ 'redirect_on_submission' ] ) ) { |
|
772 | + $submission_settings[ 'redirect_on_submission' ] = '0'; |
|
773 | + $submission_settings[ 'redirect_page' ] = ''; |
|
774 | 774 | } |
775 | 775 | ?> |
776 | - <p><label for="redirect-user-on-submission"><strong><?php _e( 'Redirect On Submission' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
776 | + <p><label for="redirect-user-on-submission"><strong><?php _e( 'Redirect On Submission', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
777 | 777 | <span class="form-field-container-span"> |
778 | - <label for="redirect-user"><input type="radio" id="redirect-user" onclick="togglePageRedirection( this );" name="redirect-user-on-submission" value="1" <?php checked( $submission_settings['redirect_on_submission'] , '1' ); ?>><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
779 | - <label for="do-not-redirect-user"><input type="radio" id="do-not-redirect-user" onclick="togglePageRedirection( this );" name="redirect-user-on-submission" value="0" <?php checked( $submission_settings['redirect_on_submission'] , '0' ); ?>><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
778 | + <label for="redirect-user"><input type="radio" id="redirect-user" onclick="togglePageRedirection( this );" name="redirect-user-on-submission" value="1" <?php checked( $submission_settings[ 'redirect_on_submission' ], '1' ); ?>><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
779 | + <label for="do-not-redirect-user"><input type="radio" id="do-not-redirect-user" onclick="togglePageRedirection( this );" name="redirect-user-on-submission" value="0" <?php checked( $submission_settings[ 'redirect_on_submission' ], '0' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
780 | 780 | </span> |
781 | - <?php $this->generate_page_redirect_dropdown( $submission_settings['redirect_on_submission'] , $submission_settings['redirect_page'], ( isset( $submission_settings['custom_redirect_url'] ) ) ? esc_url( $submission_settings['custom_redirect_url'] ) : '' ); ?> |
|
782 | - <p class="description"><?php _e( "When the user signs up would you like to redirect them to another page?" , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
781 | + <?php $this->generate_page_redirect_dropdown( $submission_settings[ 'redirect_on_submission' ], $submission_settings[ 'redirect_page' ], ( isset( $submission_settings[ 'custom_redirect_url' ] ) ) ? esc_url( $submission_settings[ 'custom_redirect_url' ] ) : '' ); ?> |
|
782 | + <p class="description"><?php _e( "When the user signs up would you like to redirect them to another page?", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
783 | 783 | </label></p> |
784 | 784 | |
785 | 785 | <!-- Hide Form On Submission --> |
786 | 786 | <?php |
787 | - if( !isset( $submission_settings['hide_form_post_signup'] ) ) { |
|
788 | - $submission_settings['hide_form_post_signup'] = '0'; |
|
787 | + if ( ! isset( $submission_settings[ 'hide_form_post_signup' ] ) ) { |
|
788 | + $submission_settings[ 'hide_form_post_signup' ] = '0'; |
|
789 | 789 | } |
790 | 790 | ?> |
791 | - <p><label for="hide-form-post-signup"><strong><?php _e( 'Hide Form After Sign Up' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
791 | + <p><label for="hide-form-post-signup"><strong><?php _e( 'Hide Form After Sign Up', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
792 | 792 | <span class="form-field-container-span"> |
793 | - <label for="hide-form"><input type="radio" id="hide-form" name="hide-form-post-signup" value="1" <?php checked( $submission_settings['hide_form_post_signup'] , '1' ); ?> checked><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
794 | - <label for="do-not-hide-form"><input type="radio" id="do-not-hide-form" name="hide-form-post-signup" value="0" <?php checked( $submission_settings['hide_form_post_signup'] , '0' ); ?>><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
793 | + <label for="hide-form"><input type="radio" id="hide-form" name="hide-form-post-signup" value="1" <?php checked( $submission_settings[ 'hide_form_post_signup' ], '1' ); ?> checked><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
794 | + <label for="do-not-hide-form"><input type="radio" id="do-not-hide-form" name="hide-form-post-signup" value="0" <?php checked( $submission_settings[ 'hide_form_post_signup' ], '0' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
795 | 795 | </span> |
796 | - <p class="description"><?php _e( "Should the form be hidden after the user successfully signs up?" , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
796 | + <p class="description"><?php _e( "Should the form be hidden after the user successfully signs up?", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
797 | 797 | </label></p> |
798 | 798 | |
799 | 799 | <!-- Append or Replace Interest Groups --> |
800 | 800 | <?php |
801 | - if( !isset( $submission_settings['replace_interests'] ) ) { |
|
802 | - $submission_settings['replace_interests'] = '1'; // defaults to true |
|
801 | + if ( ! isset( $submission_settings[ 'replace_interests' ] ) ) { |
|
802 | + $submission_settings[ 'replace_interests' ] = '1'; // defaults to true |
|
803 | 803 | } |
804 | 804 | ?> |
805 | - <p><label for="replace-interest-groups"><strong><?php _e( 'Existing Interest Groups' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
805 | + <p><label for="replace-interest-groups"><strong><?php _e( 'Existing Interest Groups', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
|
806 | 806 | <span class="form-field-container-span"> |
807 | - <label for="replace-interest-groups"><input type="radio" id="replace-interest-groups" name="replace-interest-groups" value="1" <?php checked( $submission_settings['replace_interests'] , '1' ); ?> checked><?php _e( 'Replace' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
808 | - <label for="update-interest-groups"><input type="radio" id="update-interest-groups" name="replace-interest-groups" value="0" <?php checked( $submission_settings['replace_interests'] , '0' ); ?>><?php _e( 'Update' , 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
807 | + <label for="replace-interest-groups"><input type="radio" id="replace-interest-groups" name="replace-interest-groups" value="1" <?php checked( $submission_settings[ 'replace_interests' ], '1' ); ?> checked><?php _e( 'Replace', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
808 | + <label for="update-interest-groups"><input type="radio" id="update-interest-groups" name="replace-interest-groups" value="0" <?php checked( $submission_settings[ 'replace_interests' ], '0' ); ?>><?php _e( 'Update', 'yikes-inc-easy-mailchimp-extender' ); ?></label> |
|
809 | 809 | </span> |
810 | 810 | |
811 | - <p class="description"><small><?php _e( "<strong>Replace</strong>: Replace all interest groups with the new ones submitted." , 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
811 | + <p class="description"><small><?php _e( "<strong>Replace</strong>: Replace all interest groups with the new ones submitted.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
812 | 812 | |
813 | 813 | |
814 | - <p class="description"><small><?php _e( "<strong>Update</strong>: Update <em>only</em> the ones submitted. Leave existing interest groups as is." , 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
814 | + <p class="description"><small><?php _e( "<strong>Update</strong>: Update <em>only</em> the ones submitted. Leave existing interest groups as is.", 'yikes-inc-easy-mailchimp-extender' ); ?></small></p> |
|
815 | 815 | |
816 | 816 | </label></p> |
817 | 817 | |
@@ -824,9 +824,9 @@ discard block |
||
824 | 824 | |
825 | 825 | <span class="form-buttons-container" id="major-publishing-actions"> |
826 | 826 | <?php |
827 | - echo submit_button( __( 'Update Form' ) , 'primary' , '' , false , array( 'onclick' => 'jQuery(this).parent().prev().css({"display":"block","visibility":"inherit"});' ) ); |
|
828 | - $url = esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-delete-form', 'mailchimp-form' => $form['id'] , 'nonce' => wp_create_nonce( 'delete-mailchimp-form-'.$form['id'] ) ) , admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); |
|
829 | - echo '<a href="' . $url . '" class="yikes-delete-mailchimp-form" onclick="return confirm(\'' . __( "Are you sure you want to delete this form? This cannot be undone." , 'yikes-inc-easy-mailchimp-extender' ) . '\');">' . __( "Delete Form" , 'yikes-inc-easy-mailchimp-extender' ) . '</a>'; |
|
827 | + echo submit_button( __( 'Update Form' ), 'primary', '', false, array( 'onclick' => 'jQuery(this).parent().prev().css({"display":"block","visibility":"inherit"});' ) ); |
|
828 | + $url = esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-delete-form', 'mailchimp-form' => $form[ 'id' ], 'nonce' => wp_create_nonce( 'delete-mailchimp-form-' . $form[ 'id' ] ) ), admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ) ); |
|
829 | + echo '<a href="' . $url . '" class="yikes-delete-mailchimp-form" onclick="return confirm(\'' . __( "Are you sure you want to delete this form? This cannot be undone.", 'yikes-inc-easy-mailchimp-extender' ) . '\');">' . __( "Delete Form", 'yikes-inc-easy-mailchimp-extender' ) . '</a>'; |
|
830 | 830 | ?> |
831 | 831 | </span> |
832 | 832 |
@@ -302,9 +302,9 @@ |
||
302 | 302 | ?></ul><?php |
303 | 303 | } |
304 | 304 | /** |
305 | - * Custom action hook for our add-ons to hook into |
|
306 | - * @since 6.0.3.8 |
|
307 | - */ |
|
305 | + * Custom action hook for our add-ons to hook into |
|
306 | + * @since 6.0.3.8 |
|
307 | + */ |
|
308 | 308 | do_action( 'yikes-mailchimp-list-form-fields-metabox' ); |
309 | 309 | ?> |
310 | 310 |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! isset( $_REQUEST['list-id'] ) ) { |
|
2 | +if ( ! isset( $_REQUEST[ 'list-id' ] ) ) { |
|
3 | 3 | wp_die( __( 'Oops, we can\'t determine what List to view. Please go back and try again.' ) ); |
4 | 4 | } |
5 | 5 | |
6 | -$list_id = sanitize_key( $_REQUEST['list-id'] ); |
|
6 | +$list_id = sanitize_key( $_REQUEST[ 'list-id' ] ); |
|
7 | 7 | $list_helper = yikes_get_mc_api_manager()->get_list_handler(); |
8 | 8 | $api_key = yikes_get_mc_api_key(); |
9 | 9 | $dash_position = strpos( $api_key, '-' ); |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | // setup pagination variables |
63 | -$paged = isset( $_REQUEST['paged'] ) ? $_REQUEST['paged'] : '0'; |
|
63 | +$paged = isset( $_REQUEST[ 'paged' ] ) ? $_REQUEST[ 'paged' ] : '0'; |
|
64 | 64 | $limit = apply_filters( 'yikes_admin_list_subscriber_limit', '20' ); |
65 | -$sort_dir = isset( $_REQUEST['sort'] ) ? $_REQUEST['sort'] : 'DESC'; |
|
65 | +$sort_dir = isset( $_REQUEST[ 'sort' ] ) ? $_REQUEST[ 'sort' ] : 'DESC'; |
|
66 | 66 | |
67 | 67 | |
68 | 68 | if ( $sort_dir == 'DESC' ) { |
@@ -90,25 +90,25 @@ discard block |
||
90 | 90 | ?> |
91 | 91 | <div class="wrap"> |
92 | 92 | <!-- Freddie Logo --> |
93 | - <img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php __( 'Freddie - MailChimp Mascot' , 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" /> |
|
93 | + <img src="<?php echo YIKES_MC_URL . 'includes/images/MailChimp_Assets/Freddie_60px.png'; ?>" alt="<?php __( 'Freddie - MailChimp Mascot', 'yikes-inc-easy-mailchimp-extender' ); ?>" class="yikes-mc-freddie-logo" /> |
|
94 | 94 | |
95 | - <h1>YIKES Easy Forms for MailChimp | <?php echo $list_data['name']; ?></h1> |
|
95 | + <h1>YIKES Easy Forms for MailChimp | <?php echo $list_data[ 'name' ]; ?></h1> |
|
96 | 96 | |
97 | 97 | <!-- Settings Page Description --> |
98 | - <p class="yikes-easy-mc-about-text about-text"><?php _e( 'View all subscribers below. View additional subscriber info, or add additional fields to this list.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
99 | - <!-- <p class="add-new-subscriber-button"><a href="#" onclick="jQuery(this).parent().next().slideToggle();" class="add-new-h2"><?php _e( 'New Subscriber' , 'yikes-inc-easy-mailchimp-extender' ); ?></a></p> --> |
|
98 | + <p class="yikes-easy-mc-about-text about-text"><?php _e( 'View all subscribers below. View additional subscriber info, or add additional fields to this list.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
99 | + <!-- <p class="add-new-subscriber-button"><a href="#" onclick="jQuery(this).parent().next().slideToggle();" class="add-new-h2"><?php _e( 'New Subscriber', 'yikes-inc-easy-mailchimp-extender' ); ?></a></p> --> |
|
100 | 100 | |
101 | 101 | <?php |
102 | 102 | /* Display our admin notices here */ |
103 | 103 | // Unsubscribe user confirmation message |
104 | - if( isset( $_REQUEST['user-unsubscribed'] ) && $_REQUEST['user-unsubscribed'] == 'true' ) { |
|
104 | + if ( isset( $_REQUEST[ 'user-unsubscribed' ] ) && $_REQUEST[ 'user-unsubscribed' ] == 'true' ) { |
|
105 | 105 | ?> |
106 | 106 | <div class="updated manage-form-admin-notice"> |
107 | 107 | <p><?php _e( 'User successfully unsubscribed.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
108 | 108 | </div> |
109 | 109 | <?php |
110 | 110 | } |
111 | - if( isset( $_REQUEST['user-unsubscribed'] ) && $_REQUEST['user-unsubscribed'] == 'false' ) { |
|
111 | + if ( isset( $_REQUEST[ 'user-unsubscribed' ] ) && $_REQUEST[ 'user-unsubscribed' ] == 'false' ) { |
|
112 | 112 | ?> |
113 | 113 | <div class="error manage-form-admin-notice"> |
114 | 114 | <p><?php _e( "We've encountered an error trying to remove the subscriber. Please try again. If the error persists please get in contact with the YIKES Inc. support staff.", 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
@@ -118,9 +118,9 @@ discard block |
||
118 | 118 | ?> |
119 | 119 | |
120 | 120 | <section class="add-new-subscriber-form-container"> |
121 | - <h4><?php _e( 'Add New Subscriber' , 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
121 | + <h4><?php _e( 'Add New Subscriber', 'yikes-inc-easy-mailchimp-extender' ); ?></h4> |
|
122 | 122 | <form id="add-new-subcscriber"> |
123 | - <input type="text" class="regular-text" placeholder="<?php _e( 'User Email Address' , 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p> |
|
123 | + <input type="text" class="regular-text" placeholder="<?php _e( 'User Email Address', 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p> |
|
124 | 124 | <p><?php submit_button( 'Add Subscriber' ); ?></p> |
125 | 125 | </form> |
126 | 126 | </section> |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | <!-- TABLE HEAD --> |
143 | 143 | <thead> |
144 | 144 | <tr> |
145 | - <th id="user-email columnname" class="manage-column column-columnname" scope="col"><a id="user-email-sort" href="<?php echo esc_url_raw( add_query_arg( array( 'column' => 'email' , 'sort' => $opposite_sort_dir ) ) ); ?>"><?php _e( 'User Email' , 'yikes-inc-easy-mailchimp-extender' ); echo $icon;?></a></th> |
|
146 | - <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Email Client' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
145 | + <th id="user-email columnname" class="manage-column column-columnname" scope="col"><a id="user-email-sort" href="<?php echo esc_url_raw( add_query_arg( array( 'column' => 'email', 'sort' => $opposite_sort_dir ) ) ); ?>"><?php _e( 'User Email', 'yikes-inc-easy-mailchimp-extender' ); echo $icon; ?></a></th> |
|
146 | + <th id="columnname" class="manage-column column-columnname num" scope="col"><?php _e( 'Email Client', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
147 | 147 | </tr> |
148 | 148 | </thead> |
149 | 149 | <!-- end header --> |
@@ -151,8 +151,8 @@ discard block |
||
151 | 151 | <!-- FOOTER --> |
152 | 152 | <tfoot> |
153 | 153 | <tr> |
154 | - <th class="manage-column column-columnname" scope="col"><?php _e( 'User Email' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
155 | - <th class="manage-column column-columnname num" scope="col"><?php _e( 'Email Client' , 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
154 | + <th class="manage-column column-columnname" scope="col"><?php _e( 'User Email', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
155 | + <th class="manage-column column-columnname num" scope="col"><?php _e( 'Email Client', 'yikes-inc-easy-mailchimp-extender' ); ?></th> |
|
156 | 156 | </tr> |
157 | 157 | </tfoot> |
158 | 158 | <!-- end footer --> |
@@ -162,15 +162,15 @@ discard block |
||
162 | 162 | <?php if ( count( $subscribers_list ) > 0 ) { |
163 | 163 | $i = 1; |
164 | 164 | foreach ( $subscribers_list as $subscriber ) { |
165 | - $user_id = $subscriber['id']; |
|
165 | + $user_id = $subscriber[ 'id' ]; |
|
166 | 166 | $path = YIKES_MC_URL . "includes/images/na.png"; |
167 | 167 | $email_client_icon = "<img width='35' src='" . $path . "' alt='" . __( 'not set', 'yikes-inc-easy-mailchimp-extender' ) . "' title='" . __( 'not set', 'yikes-inc-easy-mailchimp-extender' ) . "'>"; |
168 | 168 | |
169 | 169 | ?> |
170 | 170 | <tr class="<?php if ( $i % 2 == 0 ) { echo 'alternate'; } ?>"> |
171 | 171 | <td class="column-columnname"> |
172 | - <a class="user-email row-title" href="mailto:<?php echo sanitize_email( $subscriber['email_address'] ); ?>"> |
|
173 | - <?php echo sanitize_email( $subscriber['email_address'] ); ?> |
|
172 | + <a class="user-email row-title" href="mailto:<?php echo sanitize_email( $subscriber[ 'email_address' ] ); ?>"> |
|
173 | + <?php echo sanitize_email( $subscriber[ 'email_address' ] ); ?> |
|
174 | 174 | </a> |
175 | 175 | <div class="row-actions"> |
176 | 176 | <?php $view_user_info_url = esc_url_raw( add_query_arg( array( |
@@ -184,17 +184,17 @@ discard block |
||
184 | 184 | 'nonce' => wp_create_nonce( 'unsubscribe-user-' . $user_id ), |
185 | 185 | 'email_id' => $user_id, |
186 | 186 | ) ) ); ?> |
187 | - <span><a href="<?php echo $url; ?>" onclick="return confirm('<?php printf( __( "Are you sure you want to unsubscribe %s from this mailing list?", 'yikes-inc-easy-mailchimp-extender' ), sanitize_email( $subscriber['email_address'] ) ); ?>');" class="yikes-delete-subscriber"><?php _e( "Unsubscribe", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
187 | + <span><a href="<?php echo $url; ?>" onclick="return confirm('<?php printf( __( "Are you sure you want to unsubscribe %s from this mailing list?", 'yikes-inc-easy-mailchimp-extender' ), sanitize_email( $subscriber[ 'email_address' ] ) ); ?>');" class="yikes-delete-subscriber"><?php _e( "Unsubscribe", 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
188 | 188 | </div> |
189 | 189 | </td> |
190 | 190 | <td class="column-columnname num"><?php echo $email_client_icon; ?></td> |
191 | 191 | </tr> |
192 | 192 | <?php |
193 | - $i ++; |
|
193 | + $i++; |
|
194 | 194 | } |
195 | 195 | } else { ?> |
196 | 196 | <tr class="no-items"> |
197 | - <td class="colspanchange no-current-subscriber-notice" colspan="2"><em><?php _e( 'No one is currently subscribed to this list.' , 'yikes-inc-easy-mailchimp-extender' ); ?></em></td> |
|
197 | + <td class="colspanchange no-current-subscriber-notice" colspan="2"><em><?php _e( 'No one is currently subscribed to this list.', 'yikes-inc-easy-mailchimp-extender' ); ?></em></td> |
|
198 | 198 | </tr> |
199 | 199 | <?php } ?> |
200 | 200 | </tbody> |
@@ -206,11 +206,11 @@ discard block |
||
206 | 206 | <!-- pagination --> |
207 | 207 | <div class="tablenav"> |
208 | 208 | <div class="tablenav-pages"> |
209 | - <a class='first-page <?php if( $paged == 0 ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the first page" , 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => 0 ) ) ); ?>'>«</a> |
|
210 | - <a class='prev-page <?php if( $paged == 0 ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the previous page" , 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => intval( $paged - 1 ) ) ) ); ?>'>‹</a> |
|
211 | - <span class="paging-input"><input class='current-page' title='<?php _e( "Current page" , 'yikes-inc-easy-mailchimp-extender' ); ?>' type='text' name='paged' value='<?php if( $paged == 0 ) { echo '1'; } else { echo intval( $paged + 1 ); } ?>' size='1' /> <?php _e( 'of', 'yikes-inc-easy-mailchimp-extender' ); ?> <span class='total-pages'><?php echo $total_pages; ?></span></span> |
|
212 | - <a class='next-page <?php if( $paged == intval( $total_pages - 1 ) ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the next page" , 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => intval( $paged + 1 ) ) ) ); ?>'>›</a> |
|
213 | - <a class='last-page <?php if( $paged == intval( $total_pages - 1 ) ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the last page" , 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => intval( $total_pages - 1 ) ) ) ); ?>'>»</a> |
|
209 | + <a class='first-page <?php if ( $paged == 0 ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the first page", 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => 0 ) ) ); ?>'>«</a> |
|
210 | + <a class='prev-page <?php if ( $paged == 0 ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the previous page", 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => intval( $paged - 1 ) ) ) ); ?>'>‹</a> |
|
211 | + <span class="paging-input"><input class='current-page' title='<?php _e( "Current page", 'yikes-inc-easy-mailchimp-extender' ); ?>' type='text' name='paged' value='<?php if ( $paged == 0 ) { echo '1'; } else { echo intval( $paged + 1 ); } ?>' size='1' /> <?php _e( 'of', 'yikes-inc-easy-mailchimp-extender' ); ?> <span class='total-pages'><?php echo $total_pages; ?></span></span> |
|
212 | + <a class='next-page <?php if ( $paged == intval( $total_pages - 1 ) ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the next page", 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => intval( $paged + 1 ) ) ) ); ?>'>›</a> |
|
213 | + <a class='last-page <?php if ( $paged == intval( $total_pages - 1 ) ) { echo 'disabled'; } ?>' title='<?php _e( "Go to the last page", 'yikes-inc-easy-mailchimp-extender' ); ?>' href='<?php echo esc_url_raw( add_query_arg( array( "paged" => intval( $total_pages - 1 ) ) ) ); ?>'>»</a> |
|
214 | 214 | </div> |
215 | 215 | </div> |
216 | 216 | |
@@ -225,21 +225,21 @@ discard block |
||
225 | 225 | |
226 | 226 | <div class="postbox yikes-easy-mc-postbox"> |
227 | 227 | |
228 | - <h3><?php _e( 'List Overview' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
228 | + <h3><?php _e( 'List Overview', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
229 | 229 | |
230 | 230 | <?php |
231 | 231 | // store list rating |
232 | - $list_rating = $list_data['list_rating']; |
|
233 | - if( $list_rating > 0 ) { |
|
234 | - $list_rating_explosion = explode( '.' , $list_rating ); |
|
232 | + $list_rating = $list_data[ 'list_rating' ]; |
|
233 | + if ( $list_rating > 0 ) { |
|
234 | + $list_rating_explosion = explode( '.', $list_rating ); |
|
235 | 235 | $star_array = array(); |
236 | 236 | $x = 1; |
237 | - while( $list_rating_explosion[0] >= $x ) { |
|
238 | - $star_array[] = '<span class="dashicons dashicons-star-filled list-rating-star"></span>'; |
|
237 | + while ( $list_rating_explosion[ 0 ] >= $x ) { |
|
238 | + $star_array[ ] = '<span class="dashicons dashicons-star-filled list-rating-star"></span>'; |
|
239 | 239 | $x++; |
240 | 240 | } |
241 | - if( $list_rating_explosion[1] == '5' ) { |
|
242 | - $star_array[] = '<span class="dashicons dashicons-star-half list-rating-star"></span>'; |
|
241 | + if ( $list_rating_explosion[ 1 ] == '5' ) { |
|
242 | + $star_array[ ] = '<span class="dashicons dashicons-star-half list-rating-star"></span>'; |
|
243 | 243 | } |
244 | 244 | } else { |
245 | 245 | $star_array = array( 'n/a' ); |
@@ -247,40 +247,40 @@ discard block |
||
247 | 247 | ?> |
248 | 248 | <table class="form-table"> |
249 | 249 | <tr valign="top"> |
250 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'List Rating' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
251 | - <td><?php echo implode( ' ' , $star_array ); ?></td> |
|
250 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'List Rating', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
251 | + <td><?php echo implode( ' ', $star_array ); ?></td> |
|
252 | 252 | </tr> |
253 | 253 | <tr valign="top"> |
254 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'Average Subscribers' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
255 | - <td><?php echo $list_data['stats']['avg_sub_rate']; ?><small> / <?php _e( 'month' , 'yikes-inc-easy-mailchimp-extender' ); ?></small></td> |
|
254 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'Average Subscribers', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
255 | + <td><?php echo $list_data[ 'stats' ][ 'avg_sub_rate' ]; ?><small> / <?php _e( 'month', 'yikes-inc-easy-mailchimp-extender' ); ?></small></td> |
|
256 | 256 | </tr> |
257 | 257 | <tr valign="top"> |
258 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'Subscriber Count' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
259 | - <td><?php echo intval( $list_data['stats']['member_count'] ); ?></td> |
|
258 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'Subscriber Count', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
259 | + <td><?php echo intval( $list_data[ 'stats' ][ 'member_count' ] ); ?></td> |
|
260 | 260 | </tr> |
261 | 261 | <tr valign="top"> |
262 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'New Since Last Campaign' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
263 | - <td><?php echo intval( $list_data['stats']['member_count_since_send'] ); ?></td> |
|
262 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'New Since Last Campaign', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
263 | + <td><?php echo intval( $list_data[ 'stats' ][ 'member_count_since_send' ] ); ?></td> |
|
264 | 264 | </tr> |
265 | 265 | <tr valign="top"> |
266 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'Created' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
267 | - <td><?php echo date( get_option('date_format') , strtotime( $list_data['date_created'] ) ); ?></td> |
|
266 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'Created', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
267 | + <td><?php echo date( get_option( 'date_format' ), strtotime( $list_data[ 'date_created' ] ) ); ?></td> |
|
268 | 268 | </tr> |
269 | 269 | <tr valign="top"> |
270 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'List Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
271 | - <td><?php echo intval( $list_data['stats']['merge_field_count'] + 1 ); // add 1 for our email field.. ?></td> |
|
270 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'List Fields', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
271 | + <td><?php echo intval( $list_data[ 'stats' ][ 'merge_field_count' ] + 1 ); // add 1 for our email field.. ?></td> |
|
272 | 272 | </tr> |
273 | 273 | <tr valign="top"> |
274 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'Short Signup URL' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
275 | - <td><input type="text" class="widefat view-list-sidebar-input" value="<?php echo esc_url_raw( $list_data['subscribe_url_short'] ); ?>" readonly onclick="jQuery(this).select();"></td> |
|
274 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'Short Signup URL', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
275 | + <td><input type="text" class="widefat view-list-sidebar-input" value="<?php echo esc_url_raw( $list_data[ 'subscribe_url_short' ] ); ?>" readonly onclick="jQuery(this).select();"></td> |
|
276 | 276 | </tr> |
277 | 277 | <tr valign="top"> |
278 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'Default From Email' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
279 | - <td><input type="text" class="widefat view-list-sidebar-input" value="<?php echo sanitize_email( $list_data['campaign_defaults']['from_email'] ); ?>" readonly onclick="jQuery(this).select();"></td> |
|
278 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'Default From Email', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
279 | + <td><input type="text" class="widefat view-list-sidebar-input" value="<?php echo sanitize_email( $list_data[ 'campaign_defaults' ][ 'from_email' ] ); ?>" readonly onclick="jQuery(this).select();"></td> |
|
280 | 280 | </tr> |
281 | 281 | <tr valign="top"> |
282 | - <td scope="row"><label for="tablecell"><strong><?php _e( 'Default From Name' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
283 | - <td><?php echo $list_data['campaign_defaults']['from_name']; ?></td> |
|
282 | + <td scope="row"><label for="tablecell"><strong><?php _e( 'Default From Name', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></label></td> |
|
283 | + <td><?php echo $list_data[ 'campaign_defaults' ][ 'from_name' ]; ?></td> |
|
284 | 284 | </tr> |
285 | 285 | </table> |
286 | 286 | |
@@ -290,14 +290,14 @@ discard block |
||
290 | 290 | <!-- Merge Field Info --> |
291 | 291 | <div class="postbox yikes-easy-mc-postbox"> |
292 | 292 | |
293 | - <h3><?php _e( 'Form Fields' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
293 | + <h3><?php _e( 'Form Fields', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
294 | 294 | <?php |
295 | - if( count( $merge_fields['merge_fields'] ) >= 1 ) { |
|
295 | + if ( count( $merge_fields[ 'merge_fields' ] ) >= 1 ) { |
|
296 | 296 | ?><ul class="merge-variable-ul"><?php |
297 | - echo '<li class="interest-group-count">' . sprintf( _n( '%d Field', '%d Fields', intval( count( $merge_fields['merge_fields'] ) ), 'yikes-inc-easy-mailchimp-extender' ), intval( count( $merge_fields['merge_fields'] ) ) ) . '</li>'; |
|
298 | - foreach( $merge_fields['merge_fields'] as $merge_field ) { |
|
297 | + echo '<li class="interest-group-count">' . sprintf( _n( '%d Field', '%d Fields', intval( count( $merge_fields[ 'merge_fields' ] ) ), 'yikes-inc-easy-mailchimp-extender' ), intval( count( $merge_fields[ 'merge_fields' ] ) ) ) . '</li>'; |
|
298 | + foreach ( $merge_fields[ 'merge_fields' ] as $merge_field ) { |
|
299 | 299 | // new action hook @since 6.0.3.8 |
300 | - echo '<li class="' . $merge_field['tag'] . '"><span class="dashicons dashicons-marker"></span>' . $merge_field['name'] . ' ' . do_action( 'yikes-mailchimp-list-field', $merge_field ) . '</li>'; |
|
300 | + echo '<li class="' . $merge_field[ 'tag' ] . '"><span class="dashicons dashicons-marker"></span>' . $merge_field[ 'name' ] . ' ' . do_action( 'yikes-mailchimp-list-field', $merge_field ) . '</li>'; |
|
301 | 301 | } |
302 | 302 | ?></ul><?php |
303 | 303 | } |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | <div class="postbox yikes-easy-mc-postbox"> |
315 | 315 | |
316 | 316 | |
317 | - <h3><?php _e( 'Interest Groups Overview' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
317 | + <h3><?php _e( 'Interest Groups Overview', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
318 | 318 | <?php |
319 | 319 | if ( ! empty( $interest_groupings ) ) { |
320 | 320 | ?> |
@@ -322,8 +322,8 @@ discard block |
||
322 | 322 | echo '<li class="interest-group-count">' . sprintf( _n( '%d Interest Group', '%d Interest Groups', intval( count( $interest_groupings ) ), 'yikes-inc-easy-mailchimp-extender' ), intval( count( $interest_groupings ) ) ) . '</li>'; |
323 | 323 | foreach ( $interest_groupings as $interest_group ) { |
324 | 324 | // Build up the total subscribers |
325 | - $count = array_sum( wp_list_pluck( $interest_group['items'], 'subscriber_count' ) ); |
|
326 | - echo '<li><span class="dashicons dashicons-marker"></span>' . $interest_group['title'] . '<span class="interest-group-title"></span><small title="' . $count . ' ' . __( "subscribers assigned to this group", 'yikes-inc-easy-mailchimp-extender' ) . '">(' . $count . ')</small></li>'; |
|
325 | + $count = array_sum( wp_list_pluck( $interest_group[ 'items' ], 'subscriber_count' ) ); |
|
326 | + echo '<li><span class="dashicons dashicons-marker"></span>' . $interest_group[ 'title' ] . '<span class="interest-group-title"></span><small title="' . $count . ' ' . __( "subscribers assigned to this group", 'yikes-inc-easy-mailchimp-extender' ) . '">(' . $count . ')</small></li>'; |
|
327 | 327 | } |
328 | 328 | ?></ul><?php |
329 | 329 | } else { |
@@ -347,17 +347,17 @@ discard block |
||
347 | 347 | <div class="postbox yikes-easy-mc-postbox"> |
348 | 348 | |
349 | 349 | |
350 | - <h3><?php _e( 'Segments Overview' , 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
350 | + <h3><?php _e( 'Segments Overview', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
|
351 | 351 | <?php |
352 | - if( isset( $segments['saved'] ) && count( $segments['saved'] ) >= 1 ) { |
|
352 | + if ( isset( $segments[ 'saved' ] ) && count( $segments[ 'saved' ] ) >= 1 ) { |
|
353 | 353 | $i = 1; |
354 | 354 | ?><ul class="segment-ul"><?php |
355 | - echo '<li class="segment-group-count">' . sprintf( _n( '%d Segment', '%d Segments', intval( count( $segments['saved'] ) ), 'yikes-inc-easy-mailchimp-extender' ), intval( count( $segments['saved'] ) ) ) . '</li>'; |
|
356 | - foreach( $segments['saved'] as $segment ) { |
|
357 | - echo '<li><span class="dashicons dashicons-arrow-right"></span>' . $segment['name'] . ' <small><a href="#" onclick="jQuery(this).parent().parent().next().slideToggle();jQuery(this).toggleText();return false;" data-alt-text="' . __( 'hide conditions' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( "view conditions" , 'yikes-inc-easy-mailchimp-extender' ) . '</a></small></li>'; |
|
355 | + echo '<li class="segment-group-count">' . sprintf( _n( '%d Segment', '%d Segments', intval( count( $segments[ 'saved' ] ) ), 'yikes-inc-easy-mailchimp-extender' ), intval( count( $segments[ 'saved' ] ) ) ) . '</li>'; |
|
356 | + foreach ( $segments[ 'saved' ] as $segment ) { |
|
357 | + echo '<li><span class="dashicons dashicons-arrow-right"></span>' . $segment[ 'name' ] . ' <small><a href="#" onclick="jQuery(this).parent().parent().next().slideToggle();jQuery(this).toggleText();return false;" data-alt-text="' . __( 'hide conditions', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( "view conditions", 'yikes-inc-easy-mailchimp-extender' ) . '</a></small></li>'; |
|
358 | 358 | ?><div class="conditionals yikes-easy-mc-hidden"><?php |
359 | - foreach( $segment['segment_opts']['conditions'] as $condition ) { |
|
360 | - echo '<li><small>' . sprintf( __( 'condition #%s : If %s %s %s', 'yikes-inc-easy-mailchimp-extender' ), intval( $i ), $condition['field'], $condition['op'], $condition['value'] ) . '</small></li>'; |
|
359 | + foreach ( $segment[ 'segment_opts' ][ 'conditions' ] as $condition ) { |
|
360 | + echo '<li><small>' . sprintf( __( 'condition #%s : If %s %s %s', 'yikes-inc-easy-mailchimp-extender' ), intval( $i ), $condition[ 'field' ], $condition[ 'op' ], $condition[ 'value' ] ) . '</small></li>'; |
|
361 | 361 | $i++; |
362 | 362 | } |
363 | 363 | ?></div><?php |
@@ -372,9 +372,9 @@ discard block |
||
372 | 372 | } |
373 | 373 | ?> |
374 | 374 | <!-- |
375 | - <a class="edit-segments-button" href="#" onclick="return false;" class="button-primary"><?php _e( 'Edit Segments' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
375 | + <a class="edit-segments-button" href="#" onclick="return false;" class="button-primary"><?php _e( 'Edit Segments', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
376 | 376 | --> |
377 | - <p class="description edit-segment-description"><?php _e( 'To edit this lists segments, head over to' , 'yikes-inc-easy-mailchimp-extender' ); ?> <a href="http://www.MailChimp.com" target="_blank">MailChimp</a></p> |
|
377 | + <p class="description edit-segment-description"><?php _e( 'To edit this lists segments, head over to', 'yikes-inc-easy-mailchimp-extender' ); ?> <a href="http://www.MailChimp.com" target="_blank">MailChimp</a></p> |
|
378 | 378 | |
379 | 379 | </div> |
380 | 380 |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | * Get and store our variables |
4 | 4 | * @since 6.0 |
5 | 5 | */ |
6 | -$list_id = $_GET['mailchimp-list']; |
|
7 | -$email_id = esc_attr( $_GET['email-id'] ); |
|
6 | +$list_id = $_GET[ 'mailchimp-list' ]; |
|
7 | +$email_id = esc_attr( $_GET[ 'email-id' ] ); |
|
8 | 8 | $list_helper = yikes_get_mc_api_manager()->get_list_handler(); |
9 | 9 | |
10 | 10 | /* |
@@ -36,14 +36,14 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | $other_lists = $list_helper->get_members_lists( $email_id ); |
39 | -$merge_data_array = $user_data['merge_fields']; |
|
39 | +$merge_data_array = $user_data[ 'merge_fields' ]; |
|
40 | 40 | |
41 | 41 | $additional_lists = array(); |
42 | 42 | $merge_variable_fields = array(); |
43 | 43 | |
44 | 44 | /* Build the array of mailing lists the user is subscribed to */ |
45 | 45 | foreach ( $other_lists as $id => $value ) { |
46 | - if ( 'subscribed' !== $value['status'] ) { |
|
46 | + if ( 'subscribed' !== $value[ 'status' ] ) { |
|
47 | 47 | continue; |
48 | 48 | } |
49 | 49 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | continue; |
59 | 59 | } |
60 | 60 | |
61 | - $additional_lists[ $list_data['id'] ] = $list_data['name']; |
|
61 | + $additional_lists[ $list_data[ 'id' ] ] = $list_data[ 'name' ]; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /* Build the array of merge variables => value */ |
@@ -74,21 +74,21 @@ discard block |
||
74 | 74 | } |
75 | 75 | // loop and display |
76 | 76 | if ( $merge_variables ) { |
77 | - foreach ( $merge_variables['merge_fields'] as $merge_variable ) { |
|
78 | - if ( $merge_variable['tag'] != 'EMAIL' ) { |
|
79 | - $merge_variable_fields[ $merge_variable['name'] ] = ( isset( $merge_data_array[ $merge_variable['tag'] ] ) ) ? $merge_data_array[ $merge_variable['tag'] ] : ''; |
|
77 | + foreach ( $merge_variables[ 'merge_fields' ] as $merge_variable ) { |
|
78 | + if ( $merge_variable[ 'tag' ] != 'EMAIL' ) { |
|
79 | + $merge_variable_fields[ $merge_variable[ 'name' ] ] = ( isset( $merge_data_array[ $merge_variable[ 'tag' ] ] ) ) ? $merge_data_array[ $merge_variable[ 'tag' ] ] : ''; |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
84 | 84 | |
85 | 85 | // store usable data |
86 | -$user_email = sanitize_email( $user_data['email_address'] ); |
|
86 | +$user_email = sanitize_email( $user_data[ 'email_address' ] ); |
|
87 | 87 | // prepend our email address to the beginning |
88 | 88 | $merge_variable_fields = array( 'Email Address' => $user_email ) + $merge_variable_fields; |
89 | 89 | $gravatar_image = get_avatar( $user_email, 120 ); |
90 | -$email_type = $user_data['email_type']; |
|
91 | -$member_rating = ( ! empty( $user_data['member_rating'] ) ) ? (int) $user_data['member_rating'] : 0; |
|
90 | +$email_type = $user_data[ 'email_type' ]; |
|
91 | +$member_rating = ( ! empty( $user_data[ 'member_rating' ] ) ) ? (int) $user_data[ 'member_rating' ] : 0; |
|
92 | 92 | $member_rating_stars = ''; |
93 | 93 | |
94 | 94 | // Create member rating stars |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
103 | -$last_changed = strtotime( $user_data['last_changed'] ); |
|
104 | -$user_language = ( ! empty( $user_data['language'] ) ) ? $user_data['language'] : ''; |
|
103 | +$last_changed = strtotime( $user_data[ 'last_changed' ] ); |
|
104 | +$user_language = ( ! empty( $user_data[ 'language' ] ) ) ? $user_data[ 'language' ] : ''; |
|
105 | 105 | $list_name = $additional_lists[ $list_id ]; |
106 | 106 | |
107 | 107 | // Generate our display page |
@@ -138,14 +138,14 @@ discard block |
||
138 | 138 | <span class="member-subscription-date"> |
139 | 139 | <?php echo __( 'Subscribed:', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . gmdate( 'F jS, Y h:i a', $last_changed ); ?> |
140 | 140 | </span> |
141 | - <?php if ( isset( $user_data['location'] ) && ! empty( $user_data['location'] ) ) { ?> |
|
142 | - <?php if ( isset( $user_data['location']['latitude'] ) && isset( $user_data['location']['longitude'] ) ) { ?> |
|
141 | + <?php if ( isset( $user_data[ 'location' ] ) && ! empty( $user_data[ 'location' ] ) ) { ?> |
|
142 | + <?php if ( isset( $user_data[ 'location' ][ 'latitude' ] ) && isset( $user_data[ 'location' ][ 'longitude' ] ) ) { ?> |
|
143 | 143 | <span class="member-location-data"> |
144 | - <?php echo __( 'Location:', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . yikes_mc_geocode_subscriber_data( $user_data['location']['latitude'], $user_data['location']['longitude'] ); ?> |
|
144 | + <?php echo __( 'Location:', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . yikes_mc_geocode_subscriber_data( $user_data[ 'location' ][ 'latitude' ], $user_data[ 'location' ][ 'longitude' ] ); ?> |
|
145 | 145 | </span> |
146 | 146 | <?php } else { ?> |
147 | 147 | <span class="member-location-data"> |
148 | - <?php echo __( 'Location:', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . $user_data['location']['timezone'] . ', ' . $user_data['location']['country_code']; ?> |
|
148 | + <?php echo __( 'Location:', 'yikes-inc-easy-mailchimp-extender' ) . ' ' . $user_data[ 'location' ][ 'timezone' ] . ', ' . $user_data[ 'location' ][ 'country_code' ]; ?> |
|
149 | 149 | </span> |
150 | 150 | <?php |
151 | 151 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | <hr class="yikes-mc-subscriber-hr" /> |
157 | 157 | |
158 | 158 | <?php |
159 | - if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'subscriber-data' ) ) { |
|
159 | + if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'subscriber-data' ) ) { |
|
160 | 160 | ?> |
161 | 161 | <section class="yikes-mc-card-body merge-variable-section"> |
162 | 162 | <h3><?php _e( 'Fields:', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
@@ -176,11 +176,11 @@ discard block |
||
176 | 176 | <strong><?php _e( 'No Subscriber Data Found', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
177 | 177 | <?php |
178 | 178 | } |
179 | - if ( isset( $user_data['ip_signup'] ) && $user_data['ip_signup'] != '' ) { |
|
179 | + if ( isset( $user_data[ 'ip_signup' ] ) && $user_data[ 'ip_signup' ] != '' ) { |
|
180 | 180 | ?> |
181 | 181 | <li> |
182 | 182 | <label> |
183 | - <strong class="section-label"><?php echo __( 'Signup IP', 'yikes-inc-easy-mailchimp-extender' ) . '</strong><p class="section-value"><em>' . $user_data['ip_signup']; ?></strong></p> |
|
183 | + <strong class="section-label"><?php echo __( 'Signup IP', 'yikes-inc-easy-mailchimp-extender' ) . '</strong><p class="section-value"><em>' . $user_data[ 'ip_signup' ]; ?></strong></p> |
|
184 | 184 | </label> |
185 | 185 | </li> |
186 | 186 | <?php |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | <?php |
192 | 192 | |
193 | 193 | |
194 | - if ( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) { |
|
194 | + if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'additional-subscriptions' ) { |
|
195 | 195 | ?> |
196 | 196 | <section class="yikes-mc-card-body"> |
197 | 197 | <?php |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | ?> |
221 | 221 | |
222 | 222 | <?php |
223 | - if ( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) { |
|
223 | + if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'delete-subscriber' ) { |
|
224 | 224 | $unsubscribe_subscriber_url = esc_url_raw( add_query_arg( array( |
225 | 225 | 'action' => 'yikes-easy-mc-unsubscribe-user', |
226 | 226 | 'mailchimp-list' => $list_id, |
@@ -275,36 +275,36 @@ discard block |
||
275 | 275 | <div id="customer-tab-wrapper"> |
276 | 276 | <ul id="customer-tab-wrapper-list"> |
277 | 277 | |
278 | - <?php if ( isset( $_GET['section'] ) && $_GET['section'] != 'subscriber-data' ) { ?> |
|
278 | + <?php if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] != 'subscriber-data' ) { ?> |
|
279 | 279 | <a title="<?php _e( 'Subscriber Details', 'yikes-inc-easy-mailchimp-extender' ); ?>" aria-label="<?php _e( 'Subscriber Details', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="<?php echo $subscriber_details; ?>"> |
280 | 280 | <?php } ?> |
281 | 281 | |
282 | - <li <?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'subscriber-data' ) ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
282 | + <li <?php if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'subscriber-data' ) ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
283 | 283 | <span class="dashicons dashicons-id"></span></li> |
284 | 284 | |
285 | - <?php if ( isset( $_GET['section'] ) && $_GET['section'] != 'subscriber-data' ) { ?> |
|
285 | + <?php if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] != 'subscriber-data' ) { ?> |
|
286 | 286 | </a> |
287 | 287 | <?php } ?> |
288 | 288 | |
289 | - <?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] != 'additional-subscriptions' ) ) { ?> |
|
289 | + <?php if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] != 'additional-subscriptions' ) ) { ?> |
|
290 | 290 | <a title="<?php _e( 'Additional Subscriptions', 'yikes-inc-easy-mailchimp-extender' ); ?>" aria-label="<?php _e( 'Additional Subscriptions', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="<?php echo $additional_subscription_url; ?>"> |
291 | 291 | <?php } ?> |
292 | 292 | |
293 | - <li <?php if ( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
293 | + <li <?php if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'additional-subscriptions' ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
294 | 294 | <span class="dashicons dashicons-portfolio"></span></li> |
295 | 295 | |
296 | - <?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) ) { ?> |
|
296 | + <?php if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'additional-subscriptions' ) ) { ?> |
|
297 | 297 | </a> |
298 | 298 | <?php } ?> |
299 | 299 | |
300 | - <?php if ( ! isset( $_GET['section'] ) || isset( $_GET['section'] ) && $_GET['section'] != 'delete-subscriber' ) { ?> |
|
300 | + <?php if ( ! isset( $_GET[ 'section' ] ) || isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] != 'delete-subscriber' ) { ?> |
|
301 | 301 | <a title="<?php _e( 'Delete Subscriber', 'yikes-inc-easy-mailchimp-extender' ); ?>" aria-label="<?php _e( 'Delete Subscriber', 'yikes-inc-easy-mailchimp-extender' ); ?>" href="<?php echo $delete_subscriber_url; ?>"> |
302 | 302 | <?php } ?> |
303 | 303 | |
304 | - <li <?php if ( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
304 | + <li <?php if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'delete-subscriber' ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
305 | 305 | <span class="dashicons dashicons-trash"></span></li> |
306 | 306 | |
307 | - <?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) ) { ?> |
|
307 | + <?php if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'delete-subscriber' ) ) { ?> |
|
308 | 308 | </a> |
309 | 309 | <?php } ?> |
310 | 310 | |
@@ -326,9 +326,9 @@ discard block |
||
326 | 326 | if ( is_wp_error( $geocode_response_body ) ) { |
327 | 327 | return; |
328 | 328 | } |
329 | - $city = $geocode_response_body['results'][0]['address_components'][2]['short_name']; |
|
330 | - $state = $geocode_response_body['results'][0]['address_components'][5]['short_name']; |
|
331 | - $country = $geocode_response_body['results'][0]['address_components'][6]['short_name']; |
|
329 | + $city = $geocode_response_body[ 'results' ][ 0 ][ 'address_components' ][ 2 ][ 'short_name' ]; |
|
330 | + $state = $geocode_response_body[ 'results' ][ 0 ][ 'address_components' ][ 5 ][ 'short_name' ]; |
|
331 | + $country = $geocode_response_body[ 'results' ][ 0 ][ 'address_components' ][ 6 ][ 'short_name' ]; |
|
332 | 332 | |
333 | 333 | return $link = '<a href="http://maps.google.com/maps?q=' . $latitude . ',' . $longitude . '" target="_blank" title="' . __( 'View Google Map', 'yikes-inc-easy-mailchimp-extender' ) . '">' . $city . ', ' . $state . ', ' . $country . '</a> <span class="flag-icon flag-icon-' . strtolower( $country ) . '"></span>'; |
334 | 334 | } |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // enqueue jquery qtip for our tooltip |
14 | - wp_enqueue_script( 'jquery-qtip-tooltip', YIKES_MC_URL . 'admin/js/min/jquery.qtip.min.js' , array( 'jquery' ) ); |
|
15 | - wp_enqueue_style( 'jquery-qtip-style', YIKES_MC_URL . 'admin/css/jquery.qtip.min.css' ); |
|
14 | + wp_enqueue_script( 'jquery-qtip-tooltip', YIKES_MC_URL . 'admin/js/min/jquery.qtip.min.js', array( 'jquery' ) ); |
|
15 | + wp_enqueue_style( 'jquery-qtip-style', YIKES_MC_URL . 'admin/css/jquery.qtip.min.css' ); |
|
16 | 16 | |
17 | 17 | ?> |
18 | 18 | <script> |
@@ -43,40 +43,40 @@ discard block |
||
43 | 43 | ); |
44 | 44 | |
45 | 45 | $class_descriptions = array( |
46 | - 'comment_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/wordpress-banner-logo.png" title="' . __( 'WordPress' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the WordPress core comment form opt-in checkbox will display a checkbox to your current users when leaving a comment (if they are not currently subscribed).' , 'yikes-inc-easy-mailchimp-extender' ), |
|
47 | - 'registration_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/wordpress-banner-logo.png" title="' . __( 'WordPress' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the WordPress core registration form opt-in checkbox will display a checkbox to new users when registering for your site.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
48 | - 'woocommerce_checkout_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/woocommerce-banner.png" title="' . __( 'WooCommerce Store' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the WooCommerce checkout opt-in form allows you to capture email addresses from users who make purchases in your store. This option will add an opt-in checkbox to the checkout page.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
49 | - 'easy_digital_downloads_checkout_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/edd-banner.png" title="' . __( 'Easy Digital Downloads' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the Easy Digital Downloads checkout opt-in allows users who make a purchase to opt-in to your mailing list during checkout.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
50 | - 'buddypress_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/buddypress-banner.png" title="' . __( 'BuddyPress' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the BuddyPress opt-in allows users who register for your site to be automatically added to the mailing list of your choice.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
51 | - 'bbpress_forms' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/bbpress-banner.png" title="' . __( 'bbPress' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the bbPress opt-in enables users who register to use the forums on your site to be automatically added to the mailing list of your choice.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
52 | - 'contact_form_7' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/cf7-banner.png" title="' . __( 'Contact Form 7' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Once the Contact Form 7 integration is active you can use our custom shortcode [yikes_mailchimp_checkbox] in your contact forms to subscribe users to a pre-selected list.' , 'yikes-inc-easy-mailchimp-extender' ), |
|
46 | + 'comment_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/wordpress-banner-logo.png" title="' . __( 'WordPress', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the WordPress core comment form opt-in checkbox will display a checkbox to your current users when leaving a comment (if they are not currently subscribed).', 'yikes-inc-easy-mailchimp-extender' ), |
|
47 | + 'registration_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/wordpress-banner-logo.png" title="' . __( 'WordPress', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the WordPress core registration form opt-in checkbox will display a checkbox to new users when registering for your site.', 'yikes-inc-easy-mailchimp-extender' ), |
|
48 | + 'woocommerce_checkout_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/woocommerce-banner.png" title="' . __( 'WooCommerce Store', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the WooCommerce checkout opt-in form allows you to capture email addresses from users who make purchases in your store. This option will add an opt-in checkbox to the checkout page.', 'yikes-inc-easy-mailchimp-extender' ), |
|
49 | + 'easy_digital_downloads_checkout_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/edd-banner.png" title="' . __( 'Easy Digital Downloads', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the Easy Digital Downloads checkout opt-in allows users who make a purchase to opt-in to your mailing list during checkout.', 'yikes-inc-easy-mailchimp-extender' ), |
|
50 | + 'buddypress_form' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/buddypress-banner.png" title="' . __( 'BuddyPress', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the BuddyPress opt-in allows users who register for your site to be automatically added to the mailing list of your choice.', 'yikes-inc-easy-mailchimp-extender' ), |
|
51 | + 'bbpress_forms' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/bbpress-banner.png" title="' . __( 'bbPress', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Enabling the bbPress opt-in enables users who register to use the forums on your site to be automatically added to the mailing list of your choice.', 'yikes-inc-easy-mailchimp-extender' ), |
|
52 | + 'contact_form_7' => '<img class="tooltip-integration-banner" src="' . YIKES_MC_URL . 'includes/images/Checkbox_Integration_Logos/cf7-banner.png" title="' . __( 'Contact Form 7', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'Once the Contact Form 7 integration is active you can use our custom shortcode [yikes_mailchimp_checkbox] in your contact forms to subscribe users to a pre-selected list.', 'yikes-inc-easy-mailchimp-extender' ), |
|
53 | 53 | ); |
54 | 54 | |
55 | 55 | // Easy Digital Downloads |
56 | - if( class_exists( 'Easy_Digital_Downloads' ) ) { |
|
57 | - $active_plugins['easy_digital_downloads_checkout_form'] = __( 'Easy Digital Downloads Checkout', 'yikes-inc-easy-mailchimp-extender' ); |
|
56 | + if ( class_exists( 'Easy_Digital_Downloads' ) ) { |
|
57 | + $active_plugins[ 'easy_digital_downloads_checkout_form' ] = __( 'Easy Digital Downloads Checkout', 'yikes-inc-easy-mailchimp-extender' ); |
|
58 | 58 | } |
59 | 59 | // WooCommerce |
60 | - if( class_exists( 'WooCommerce' ) ) { |
|
61 | - $active_plugins['woocommerce_checkout_form'] = __( 'WooCommerce Checkout', 'yikes-inc-easy-mailchimp-extender' ); |
|
60 | + if ( class_exists( 'WooCommerce' ) ) { |
|
61 | + $active_plugins[ 'woocommerce_checkout_form' ] = __( 'WooCommerce Checkout', 'yikes-inc-easy-mailchimp-extender' ); |
|
62 | 62 | } |
63 | 63 | // BuddyPress |
64 | - if( class_exists( 'BuddyPress' ) ) { |
|
65 | - $active_plugins['buddypress_form'] = __( 'BuddyPress Registration', 'yikes-inc-easy-mailchimp-extender' ); |
|
64 | + if ( class_exists( 'BuddyPress' ) ) { |
|
65 | + $active_plugins[ 'buddypress_form' ] = __( 'BuddyPress Registration', 'yikes-inc-easy-mailchimp-extender' ); |
|
66 | 66 | } |
67 | 67 | // bbPress |
68 | - if( class_exists( 'bbPress' ) ) { |
|
69 | - $active_plugins['bbpress_forms'] = __( 'bbPress', 'yikes-inc-easy-mailchimp-extender' ); |
|
68 | + if ( class_exists( 'bbPress' ) ) { |
|
69 | + $active_plugins[ 'bbpress_forms' ] = __( 'bbPress', 'yikes-inc-easy-mailchimp-extender' ); |
|
70 | 70 | } |
71 | 71 | // Contact Form 7 |
72 | - if( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) { |
|
73 | - $active_plugins['contact_form_7'] = __( 'Contact Form 7', 'yikes-inc-easy-mailchimp-extender' ); |
|
72 | + if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) { |
|
73 | + $active_plugins[ 'contact_form_7' ] = __( 'Contact Form 7', 'yikes-inc-easy-mailchimp-extender' ); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | // store our checkbox options |
77 | - $options = get_option( 'optin-checkbox-init' , '' ); |
|
77 | + $options = get_option( 'optin-checkbox-init', '' ); |
|
78 | 78 | ?> |
79 | -<h3><span><?php _e( 'Integration Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
79 | +<h3><span><?php _e( 'Integration Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
80 | 80 | |
81 | 81 | |
82 | 82 | <?php |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $error_logging = new Yikes_Inc_Easy_Mailchimp_Error_Logging(); |
88 | 88 | $error_logging->maybe_write_to_log( |
89 | 89 | $list_data->get_error_code(), |
90 | - __( "Get Account Lists" , 'yikes-inc-easy-mailchimp-extender' ), |
|
90 | + __( "Get Account Lists", 'yikes-inc-easy-mailchimp-extender' ), |
|
91 | 91 | "Integration Settings Page" |
92 | 92 | ); |
93 | 93 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | ?> |
96 | 96 | <div class="inside"> |
97 | 97 | <?php |
98 | - echo sprintf( __( 'Please %s to setup your integrations.', 'yikes-inc-easy-mailchimp-extender' ), '<a href="' . esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=general-settings' ) ) . '" title="' . __( 'General Settings' , 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'enter a valid MailChimp API key' , 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ); |
|
98 | + echo sprintf( __( 'Please %s to setup your integrations.', 'yikes-inc-easy-mailchimp-extender' ), '<a href="' . esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp-settings§ion=general-settings' ) ) . '" title="' . __( 'General Settings', 'yikes-inc-easy-mailchimp-extender' ) . '">' . __( 'enter a valid MailChimp API key', 'yikes-inc-easy-mailchimp-extender' ) . '</a>' ); |
|
99 | 99 | ?> |
100 | 100 | </div> |
101 | 101 | <?php |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | <div class="inside"> |
107 | 107 | |
108 | 108 | <p> |
109 | - <?php _e( 'Select which plugins or features Easy Forms for MailChimp by Yikes Inc. should integrate with. Depending on which plugins or features you choose to integrate with, an opt-in checkbox will be generated. For example, the comment form checkbox will generate a checkbox below the standard WordPress comment form to add any new commenters to a pre-determined MailChimp mailing list.' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
109 | + <?php _e( 'Select which plugins or features Easy Forms for MailChimp by Yikes Inc. should integrate with. Depending on which plugins or features you choose to integrate with, an opt-in checkbox will be generated. For example, the comment form checkbox will generate a checkbox below the standard WordPress comment form to add any new commenters to a pre-determined MailChimp mailing list.', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
110 | 110 | </p> |
111 | 111 | |
112 | 112 | <!-- Settings Form --> |
@@ -116,30 +116,30 @@ discard block |
||
116 | 116 | |
117 | 117 | <ul> |
118 | 118 | <?php |
119 | - if( !empty( $active_plugins ) ) { |
|
119 | + if ( ! empty( $active_plugins ) ) { |
|
120 | 120 | |
121 | - foreach( $active_plugins as $class => $value ) { |
|
121 | + foreach ( $active_plugins as $class => $value ) { |
|
122 | 122 | // echo $class; |
123 | - $checked = isset( $options[$class]['value'] ) ? 'checked="checked"' : ''; |
|
124 | - $hidden = !isset( $options[$class]['value'] ) ? 'yikes-easy-mc-hidden' : ''; |
|
125 | - $checkbox_label = isset( $options[$class]['label'] ) ? esc_attr__( $options[$class]['label'] ) : ''; |
|
126 | - $precheck_checkbox = isset( $options[$class]['precheck'] ) ? $options[$class]['precheck'] : ''; |
|
127 | - $selected_list = isset( $options[$class]['associated-list'] ) ? $options[$class]['associated-list'] : '-'; |
|
128 | - $list_interest_groups = isset( $options[$class]['interest-groups'] ) ? $options[$class]['interest-groups'] : false; |
|
123 | + $checked = isset( $options[ $class ][ 'value' ] ) ? 'checked="checked"' : ''; |
|
124 | + $hidden = ! isset( $options[ $class ][ 'value' ] ) ? 'yikes-easy-mc-hidden' : ''; |
|
125 | + $checkbox_label = isset( $options[ $class ][ 'label' ] ) ? esc_attr__( $options[ $class ][ 'label' ] ) : ''; |
|
126 | + $precheck_checkbox = isset( $options[ $class ][ 'precheck' ] ) ? $options[ $class ][ 'precheck' ] : ''; |
|
127 | + $selected_list = isset( $options[ $class ][ 'associated-list' ] ) ? $options[ $class ][ 'associated-list' ] : '-'; |
|
128 | + $list_interest_groups = isset( $options[ $class ][ 'interest-groups' ] ) ? $options[ $class ][ 'interest-groups' ] : false; |
|
129 | 129 | ?> |
130 | 130 | <li> |
131 | 131 | <label> |
132 | - <input type="checkbox" name="optin-checkbox-init[<?php echo $class; ?>][value]" value="on" <?php echo $checked; ?> onclick="jQuery(this).parents('li').next().stop().slideToggle();"><?php echo ucwords( $value ); ?><span class="dashicons dashicons-editor-help"></span><div class="tooltiptext qtip-bootstrap" style="display:none;"><?php echo $class_descriptions[$class]; ?></div> |
|
132 | + <input type="checkbox" name="optin-checkbox-init[<?php echo $class; ?>][value]" value="on" <?php echo $checked; ?> onclick="jQuery(this).parents('li').next().stop().slideToggle();"><?php echo ucwords( $value ); ?><span class="dashicons dashicons-editor-help"></span><div class="tooltiptext qtip-bootstrap" style="display:none;"><?php echo $class_descriptions[ $class ]; ?></div> |
|
133 | 133 | </label> |
134 | 134 | </li> |
135 | 135 | <!-- checkbox settings, text - associated list etc. --> |
136 | 136 | <li class="optin-checkbox-init[<?php echo $class; ?>]-settings <?php echo $hidden; ?>"> |
137 | - <?php if( $class == 'contact_form_7' ) { ?> |
|
137 | + <?php if ( $class == 'contact_form_7' ) { ?> |
|
138 | 138 | <p style="margin-top:0;"><small class="contact-form-7-notice"><?php printf( __( 'Use %s in Contact Form 7 to display the checkbox.', 'yikes-inc-easy-mailchimp-extender' ), '<code>[yikes_mailchimp_checkbox]</code>' ); ?></small></p> |
139 | 139 | <?php } ?> |
140 | 140 | <p style="margin-top:0;padding-top:0;margin-bottom:0;padding-bottom:0;"> |
141 | 141 | <!-- checkbox associated list --> |
142 | - <label><?php _e( 'Associated List' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
142 | + <label><?php _e( 'Associated List', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
143 | 143 | <?php |
144 | 144 | if ( count( $list_data ) > 0 ) { |
145 | 145 | ?> |
@@ -147,26 +147,26 @@ discard block |
||
147 | 147 | data-attr-integration="<?php echo $class; ?>" |
148 | 148 | name="optin-checkbox-init[<?php echo $class; ?>][associated-list]" |
149 | 149 | onchange="checkForInterestGroups( jQuery( this ), jQuery( this ).find( 'option:selected' ).val(), jQuery( this ).attr( 'data-attr-integration' ) );return false;"> |
150 | - <option value="-" <?php selected( $selected_list , '-' ); ?>><?php _e( 'Select a List' , 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
151 | - <?php foreach( $list_data as $list ) { ?> |
|
152 | - <option value="<?php echo $list['id']; ?>" <?php selected( $selected_list , $list['id'] ); ?>><?php echo $list['name']; ?></option> |
|
150 | + <option value="-" <?php selected( $selected_list, '-' ); ?>><?php _e( 'Select a List', 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
151 | + <?php foreach ( $list_data as $list ) { ?> |
|
152 | + <option value="<?php echo $list[ 'id' ]; ?>" <?php selected( $selected_list, $list[ 'id' ] ); ?>><?php echo $list[ 'name' ]; ?></option> |
|
153 | 153 | <?php } ?> |
154 | 154 | </select> |
155 | 155 | <?php |
156 | 156 | } else { |
157 | - echo '<p class="description no-lists-setup-notice"><strong>' . __( 'You have not setup any lists. You should head over to MailChimp and setup your first list.' , 'yikes-inc-easy-mailchimp-extender' ) . '</strong></p>'; |
|
157 | + echo '<p class="description no-lists-setup-notice"><strong>' . __( 'You have not setup any lists. You should head over to MailChimp and setup your first list.', 'yikes-inc-easy-mailchimp-extender' ) . '</strong></p>'; |
|
158 | 158 | } |
159 | 159 | ?> |
160 | 160 | </label> |
161 | 161 | <!-- checkbox text label --> |
162 | - <label><?php _e( 'Checkbox Label' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
162 | + <label><?php _e( 'Checkbox Label', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
163 | 163 | <input type="text" class="optin-checkbox-init[<?php echo $class; ?>][label] optin-checkbox-label-input" name="optin-checkbox-init[<?php echo $class; ?>][label]" value="<?php echo $checkbox_label; ?>"> |
164 | 164 | </label> |
165 | 165 | <!-- prechecked? --> |
166 | - <label><?php _e( 'Precheck Checkbox' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
166 | + <label><?php _e( 'Precheck Checkbox', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
167 | 167 | <select id="optin-checkbox-init[<?php echo $class; ?>][precheck]" name="optin-checkbox-init[<?php echo $class; ?>][precheck]" class="optin-checkbox-init[<?php echo $class; ?>][precheck] checkbox-settings-list-dropdown"> |
168 | - <option value="true" <?php selected( $precheck_checkbox , 'true' ); ?>><?php _e( 'Yes' , 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
169 | - <option value="false" <?php selected( $precheck_checkbox , 'false' ); ?>><?php _e( 'No' , 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
168 | + <option value="true" <?php selected( $precheck_checkbox, 'true' ); ?>><?php _e( 'Yes', 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
169 | + <option value="false" <?php selected( $precheck_checkbox, 'false' ); ?>><?php _e( 'No', 'yikes-inc-easy-mailchimp-extender' ); ?></option> |
|
170 | 170 | </select> |
171 | 171 | </label> |
172 | 172 | |
@@ -177,8 +177,8 @@ discard block |
||
177 | 177 | $interest_groupings = get_transient( $selected_list . '_interest_group' ); |
178 | 178 | $integration_type = $class; |
179 | 179 | require( YIKES_MC_PATH . 'admin/partials/menu/options-sections/templates/integration-interest-groups.php' ); |
180 | - } else if( $selected_list != '-' && $list_interest_groups ) { |
|
181 | - $list_id = $options[$class]['associated-list']; |
|
180 | + } else if ( $selected_list != '-' && $list_interest_groups ) { |
|
181 | + $list_id = $options[ $class ][ 'associated-list' ]; |
|
182 | 182 | $integration_type = $class; |
183 | 183 | YIKES_Inc_Easy_MailChimp_Process_Ajax::check_list_for_interest_groups( $list_id, $integration_type, true ); |
184 | 184 | } |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | } else { |
194 | 194 | ?> |
195 | 195 | <li> |
196 | - <?php _e( 'Nothing is active.' , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
196 | + <?php _e( 'Nothing is active.', 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
197 | 197 | </li> |
198 | 198 | <?php |
199 | 199 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$integration_options = get_option( 'optin-checkbox-init' , '' ); |
|
3 | +$integration_options = get_option( 'optin-checkbox-init', '' ); |
|
4 | 4 | |
5 | 5 | ?> |
6 | 6 | <br /> |
@@ -11,25 +11,25 @@ discard block |
||
11 | 11 | /* |
12 | 12 | * Loop over interest groups |
13 | 13 | */ |
14 | -foreach( $interest_groupings as $id => $interest_group ) { |
|
14 | +foreach ( $interest_groupings as $id => $interest_group ) { |
|
15 | 15 | |
16 | - $interest_group_type = isset( $interest_group['type'] ) ? $interest_group['type'] : ''; |
|
17 | - $interest_groups_fields = isset( $interest_group['items'] ) ? $interest_group['items'] : array(); |
|
18 | - $selected_interest_groups = isset( $integration_options[ $integration_type ]['interest-groups'] ) ? $integration_options[ $integration_type ]['interest-groups'] : array(); |
|
16 | + $interest_group_type = isset( $interest_group[ 'type' ] ) ? $interest_group[ 'type' ] : ''; |
|
17 | + $interest_groups_fields = isset( $interest_group[ 'items' ] ) ? $interest_group[ 'items' ] : array(); |
|
18 | + $selected_interest_groups = isset( $integration_options[ $integration_type ][ 'interest-groups' ] ) ? $integration_options[ $integration_type ][ 'interest-groups' ] : array(); |
|
19 | 19 | ?> |
20 | 20 | <section class="interest-group-section"> |
21 | - <strong class="interest-group-section-title"><?php echo ucwords( $interest_group['title'] ); ?></strong> |
|
21 | + <strong class="interest-group-section-title"><?php echo ucwords( $interest_group[ 'title' ] ); ?></strong> |
|
22 | 22 | <?php |
23 | 23 | /* |
24 | 24 | * Loop over the interest group types, and return the appropriate type |
25 | 25 | */ |
26 | 26 | $checked = $selected = ''; |
27 | - switch( $interest_group_type ) { |
|
27 | + switch ( $interest_group_type ) { |
|
28 | 28 | |
29 | 29 | default: |
30 | 30 | case 'hidden': |
31 | 31 | case 'checkboxes': |
32 | - foreach( $interest_groups_fields as $field_id => $field ) { |
|
32 | + foreach ( $interest_groups_fields as $field_id => $field ) { |
|
33 | 33 | if ( isset( $selected_interest_groups[ $id ] ) ) { |
34 | 34 | $checked = checked( true, in_array( $field_id, $selected_interest_groups[ $id ] ), false ); |
35 | 35 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | <input type="checkbox" |
39 | 39 | name="optin-checkbox-init[<?php echo $integration_type; ?>][interest-groups][<?php echo $id; ?>][]" |
40 | 40 | value="<?php echo $field_id; ?>" <?php echo $checked ?>> |
41 | - <?php echo $field['name']; ?> |
|
41 | + <?php echo $field[ 'name' ]; ?> |
|
42 | 42 | </label> |
43 | 43 | <?php |
44 | 44 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | <input type="radio" |
55 | 55 | name="optin-checkbox-init[<?php echo $integration_type; ?>][interest-groups][<?php echo $id; ?>][]" |
56 | 56 | value="<?php echo $field_id; ?>" <?php echo $checked; ?>> |
57 | - <?php echo $field['name']; ?> |
|
57 | + <?php echo $field[ 'name' ]; ?> |
|
58 | 58 | </label> |
59 | 59 | <?php |
60 | 60 | } |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | if ( ! empty( $interest_groups_fields ) ) { |
66 | 66 | ?> |
67 | 67 | <select name="optin-checkbox-init[<?php echo $integration_type; ?>][interest-groups][<?php echo $id; ?>][]"> |
68 | - <?php foreach( $interest_groups_fields as $field_id => $field ) { |
|
68 | + <?php foreach ( $interest_groups_fields as $field_id => $field ) { |
|
69 | 69 | if ( isset( $selected_interest_groups[ $id ] ) ) { |
70 | 70 | $selected = checked( true, in_array( $field_id, $selected_interest_groups[ $id ] ), false ); |
71 | 71 | } |
72 | 72 | ?> |
73 | 73 | <option value="<?php echo $field_id; ?>" <?php echo $selected; ?>> |
74 | - <?php echo $field['name']; ?> |
|
74 | + <?php echo $field[ 'name' ]; ?> |
|
75 | 75 | </option> |
76 | 76 | <?php |
77 | 77 | } |