@@ -22,13 +22,13 @@ |
||
22 | 22 | } |
23 | 23 | |
24 | 24 | // Verify Honeypot |
25 | - if ( ! empty( $_POST['hp'] ) ) { |
|
25 | + if ( ! empty( $_POST[ 'hp' ] ) ) { |
|
26 | 26 | wp_send_json_error( '2' ); |
27 | 27 | } |
28 | 28 | |
29 | 29 | // Get email, list ID |
30 | - $email = isset( $_POST['email'] ) ? $_POST['email'] : ''; |
|
31 | - $list_id = isset( $_POST['list_id'] ) ? $_POST['list_id'] : ''; |
|
30 | + $email = isset( $_POST[ 'email' ] ) ? $_POST[ 'email' ] : ''; |
|
31 | + $list_id = isset( $_POST[ 'list_id' ] ) ? $_POST[ 'list_id' ] : ''; |
|
32 | 32 | |
33 | 33 | if ( empty( $email ) || empty( $list_id ) ) { |
34 | 34 | wp_send_json_error( '3' ); |
@@ -14,20 +14,20 @@ discard block |
||
14 | 14 | |
15 | 15 | $values = is_array( $args ) ? array_merge( $defaults, $args ) : $defaults; |
16 | 16 | |
17 | - if ( empty( $values['list'] ) && empty( $values['form'] ) ) { |
|
17 | + if ( empty( $values[ 'list' ] ) && empty( $values[ 'form' ] ) ) { |
|
18 | 18 | return '<!-- YIKES Easy Forms Error: no list ID / form ID -->'; |
19 | 19 | } |
20 | 20 | |
21 | - if ( ! empty( $values['form'] ) ) { |
|
21 | + if ( ! empty( $values[ 'form' ] ) ) { |
|
22 | 22 | |
23 | 23 | // Get the list ID from the form ID |
24 | 24 | $interface = yikes_easy_mailchimp_extender_get_form_interface(); |
25 | - $form_data = $interface->get_form( $values['form'] ); |
|
26 | - $list_id = isset( $form_data['list_id'] ) ? $form_data['list_id'] : null; |
|
25 | + $form_data = $interface->get_form( $values[ 'form' ] ); |
|
26 | + $list_id = isset( $form_data[ 'list_id' ] ) ? $form_data[ 'list_id' ] : null; |
|
27 | 27 | |
28 | - } else if ( ! empty( $values['list'] ) ) { |
|
28 | + } else if ( ! empty( $values[ 'list' ] ) ) { |
|
29 | 29 | |
30 | - $list_id = $values['list']; |
|
30 | + $list_id = $values[ 'list' ]; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | if ( empty( $list_id ) ) { |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | 'loader' => apply_filters( 'yikes-mailchimp-unsubscribe-loader', YIKES_MC_URL . 'includes/images/ripple.svg' ), |
46 | 46 | ) |
47 | 47 | ); |
48 | - wp_enqueue_script ( 'yikes-mailchimp-unsubscribe-script' ); |
|
48 | + wp_enqueue_script( 'yikes-mailchimp-unsubscribe-script' ); |
|
49 | 49 | |
50 | 50 | // Include our styles |
51 | 51 | wp_enqueue_style( 'yikes-mailchimp-unsubscribe-styles', plugin_dir_url( __FILE__ ) . '/unsubscribe.css', array(), YIKES_MC_VERSION, 'all' ); |
@@ -55,11 +55,11 @@ discard block |
||
55 | 55 | <section id="yikes-mailchimp-unsubscribe-container-<?php echo $list_id; ?>" class="yikes-mailchimp-unsubscribe-container"> |
56 | 56 | |
57 | 57 | <div id="yikes-mailchimp-unsubscribe-title-<?php echo $list_id; ?>" class="yikes-mailchimp-unsubscribe-title"> |
58 | - <h2><?php echo apply_filters( 'yikes-mailchimp-unsubscribe-title', $values['title'] ); ?></h2> |
|
58 | + <h2><?php echo apply_filters( 'yikes-mailchimp-unsubscribe-title', $values[ 'title' ] ); ?></h2> |
|
59 | 59 | </div> |
60 | 60 | |
61 | 61 | <div id="yikes-mailchimp-unsubscribe-description-<?php echo $list_id; ?>" class="yikes-mailchimp-unsubscribe-description"> |
62 | - <?php echo apply_filters( 'yikes-mailchimp-unsubscribe-description', $values['description'] ); ?> |
|
62 | + <?php echo apply_filters( 'yikes-mailchimp-unsubscribe-description', $values[ 'description' ] ); ?> |
|
63 | 63 | </div> |
64 | 64 | |
65 | 65 | <?php do_action( 'yikes-mailchimp-unsubscribe-before-form' ); ?> |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | <!-- Email --> |
72 | 72 | <?php do_action( 'yikes-mailchimp-unsubscribe-before-email' ); ?> |
73 | 73 | <label for="yikes-mailchimp-unsubscribe-email" class="EMAIL-label"> |
74 | - <span class="EMAIL-label"><?php echo $values['email_label']; ?></span> |
|
75 | - <input name="EMAIL" placeholder="<?php echo $values['email_placeholder']; ?>" class="yikes-mailchimp-unsubscribe-email" id="yikes-mailchimp-unsubscribe-email" required="required" type="email" value="<?php echo esc_attr( apply_filters( 'yikes-mailchimp-unsubscribe-email-default', '' ) ); ?>"> |
|
74 | + <span class="EMAIL-label"><?php echo $values[ 'email_label' ]; ?></span> |
|
75 | + <input name="EMAIL" placeholder="<?php echo $values[ 'email_placeholder' ]; ?>" class="yikes-mailchimp-unsubscribe-email" id="yikes-mailchimp-unsubscribe-email" required="required" type="email" value="<?php echo esc_attr( apply_filters( 'yikes-mailchimp-unsubscribe-email-default', '' ) ); ?>"> |
|
76 | 76 | </label> |
77 | 77 | <?php do_action( 'yikes-mailchimp-unsubscribe-after-email' ); ?> |
78 | 78 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | <!-- Submit Button --> |
86 | 86 | <button type="submit" class="yikes-mailchimp-unsubscribe-submit-button"> |
87 | - <span class="yikes-mailchimp-submit-button-span-text"><?php echo $values['submit_label']; ?></span> |
|
87 | + <span class="yikes-mailchimp-submit-button-span-text"><?php echo $values[ 'submit_label' ]; ?></span> |
|
88 | 88 | </button> |
89 | 89 | |
90 | 90 | <input type="hidden" class="yikes-mailchimp-unsubscribe-nonce" name="yikes-mailchimp-unsubscribe-nonce" value="<?php echo wp_create_nonce( 'yikes-mailchimp-unsubscribe' ); ?>"> |
@@ -64,13 +64,13 @@ discard block |
||
64 | 64 | $checkbox_options = get_option( 'optin-checkbox-init', array() ); |
65 | 65 | |
66 | 66 | // Only display the field if a list is set. |
67 | - if ( isset( $checkbox_options[ $this->type ] ) && isset( $checkbox_options[ $this->type ]['associated-list'] ) && '-' !== $checkbox_options[ $this->type ]['associated-list'] ) { |
|
67 | + if ( isset( $checkbox_options[ $this->type ] ) && isset( $checkbox_options[ $this->type ][ 'associated-list' ] ) && '-' !== $checkbox_options[ $this->type ][ 'associated-list' ] ) { |
|
68 | 68 | |
69 | 69 | if ( $this->is_user_already_subscribed( $this->type ) ) { |
70 | 70 | return $fields; |
71 | 71 | } |
72 | 72 | |
73 | - $precheck = isset( $checkbox_options[ $this->type ]['precheck'] ) && 'true' === $checkbox_options[ $this->type ]['precheck'] ? '1' : '0'; |
|
73 | + $precheck = isset( $checkbox_options[ $this->type ][ 'precheck' ] ) && 'true' === $checkbox_options[ $this->type ][ 'precheck' ] ? '1' : '0'; |
|
74 | 74 | |
75 | 75 | /** |
76 | 76 | * Filter where the checkbox goes. |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | 'id' => 'yikes_mailchimp_checkbox_' . $this->type, |
86 | 86 | 'type' => 'checkbox', |
87 | 87 | 'class' => apply_filters( 'yikes-mailchimp-wooco-integration-checkbox-classes', array( 'form-row-wide' ) ), |
88 | - 'label' => $checkbox_options[ $this->type ]['label'], |
|
88 | + 'label' => $checkbox_options[ $this->type ][ 'label' ], |
|
89 | 89 | 'default' => $precheck, |
90 | 90 | ); |
91 | 91 |
@@ -72,12 +72,12 @@ discard block |
||
72 | 72 | $precheck = isset( $checkbox_options[ $this->type ]['precheck'] ) && 'true' === $checkbox_options[ $this->type ]['precheck'] ? '1' : '0'; |
73 | 73 | |
74 | 74 | /** |
75 | - * Filter where the checkbox goes. |
|
76 | - * |
|
77 | - * See this WooCo article for possible values: https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/ |
|
78 | - * |
|
79 | - * @param string | Which set of fields the checkbox should go into |
|
80 | - */ |
|
75 | + * Filter where the checkbox goes. |
|
76 | + * |
|
77 | + * See this WooCo article for possible values: https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/ |
|
78 | + * |
|
79 | + * @param string | Which set of fields the checkbox should go into |
|
80 | + */ |
|
81 | 81 | $field_placement = apply_filters( 'yikes-mailchimp-wooco-integration-checkbox-placement', 'billing' ); |
82 | 82 | |
83 | 83 | $yikes_checkbox = array( |
@@ -89,13 +89,13 @@ discard block |
||
89 | 89 | ); |
90 | 90 | |
91 | 91 | /** |
92 | - * Filter the checkbox data. |
|
93 | - * |
|
94 | - * See this WooCo article for possible values: https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/ |
|
95 | - * |
|
96 | - * @param array $yikes_checkbox The checkbox's fields. |
|
97 | - * @return array $yikes_checkbox The checkbox's fields. |
|
98 | - */ |
|
92 | + * Filter the checkbox data. |
|
93 | + * |
|
94 | + * See this WooCo article for possible values: https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/ |
|
95 | + * |
|
96 | + * @param array $yikes_checkbox The checkbox's fields. |
|
97 | + * @return array $yikes_checkbox The checkbox's fields. |
|
98 | + */ |
|
99 | 99 | $yikes_checkbox = apply_filters( 'yikes_mailchimp_wooco_integration_checkbox_field', $yikes_checkbox, $checkbox_options[ $this->type ] ); |
100 | 100 | |
101 | 101 | $fields[ $field_placement ][ 'yikes_mailchimp_checkbox_' . $this->type ] = $yikes_checkbox; |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | wp_send_json_error( '1' ); |
41 | 41 | } |
42 | 42 | |
43 | - $form_id = isset( $_POST['form_id'] ) ? filter_var( wp_unslash( $_POST['form_id'] ), FILTER_SANITIZE_NUMBER_INT ) : ''; |
|
43 | + $form_id = isset( $_POST[ 'form_id' ] ) ? filter_var( wp_unslash( $_POST[ 'form_id' ] ), FILTER_SANITIZE_NUMBER_INT ) : ''; |
|
44 | 44 | |
45 | 45 | if ( empty( $form_id ) ) { |
46 | 46 | wp_send_json_error( '1' ); |
@@ -75,12 +75,12 @@ discard block |
||
75 | 75 | |
76 | 76 | $locale = get_locale(); |
77 | 77 | $locale_a = explode( '_', $locale ); |
78 | - $locale = isset( $locale_a[0] ) ? $locale_a[0] : $locale; |
|
78 | + $locale = isset( $locale_a[ 0 ] ) ? $locale_a[ 0 ] : $locale; |
|
79 | 79 | $return = apply_filters( 'yikes_mailchimp_recaptcha_data', array( |
80 | 80 | 'site_key' => $site_key, |
81 | 81 | 'secret_key' => $secret_key, |
82 | 82 | 'locale' => $locale, |
83 | - )); |
|
83 | + ) ); |
|
84 | 84 | |
85 | 85 | wp_send_json_success( $return ); |
86 | 86 | } |
@@ -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 |
@@ -144,11 +144,11 @@ discard block |
||
144 | 144 | echo sprintf( esc_html__( 'Subscribed: %1$1s', 'yikes-inc-easy-mailchimp-extender' ), esc_html( gmdate( 'F jS, Y h:i a', $last_changed ) ) ); |
145 | 145 | ?> |
146 | 146 | </span> |
147 | - <?php if ( isset( $user_data['location'] ) && isset( $user_data['location']['timezone'] ) && ! empty( $user_data['location']['timezone'] ) && isset( $user_data['location']['country_code'] ) && ! empty( $user_data['location']['country_code'] ) ) { ?> |
|
147 | + <?php if ( isset( $user_data[ 'location' ] ) && isset( $user_data[ 'location' ][ 'timezone' ] ) && ! empty( $user_data[ 'location' ][ 'timezone' ] ) && isset( $user_data[ 'location' ][ 'country_code' ] ) && ! empty( $user_data[ 'location' ][ 'country_code' ] ) ) { ?> |
|
148 | 148 | <span class="member-location-data"> |
149 | 149 | <?php |
150 | 150 | /* translators: the placeholders are a timezone and a country code */ |
151 | - echo sprintf( esc_html__( 'Location: %1$1s, %2$2s', 'yikes-inc-easy-mailchimp-extender' ), esc_html( $user_data['location']['timezone'] ), esc_html( $user_data['location']['country_code'] ) ); |
|
151 | + echo sprintf( esc_html__( 'Location: %1$1s, %2$2s', 'yikes-inc-easy-mailchimp-extender' ), esc_html( $user_data[ 'location' ][ 'timezone' ] ), esc_html( $user_data[ 'location' ][ 'country_code' ] ) ); |
|
152 | 152 | ?> |
153 | 153 | </span> |
154 | 154 | <?php } ?> |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | <hr class="yikes-mc-subscriber-hr" /> |
158 | 158 | |
159 | 159 | <?php |
160 | - if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && filter_var( wp_unslash( $_GET['section'] ), FILTER_SANITIZE_STRING ) === 'subscriber-data' ) ) { |
|
160 | + if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && filter_var( wp_unslash( $_GET[ 'section' ] ), FILTER_SANITIZE_STRING ) === 'subscriber-data' ) ) { |
|
161 | 161 | ?> |
162 | 162 | <section class="yikes-mc-card-body merge-variable-section"> |
163 | 163 | <h3><?php esc_html_e( 'Fields:', 'yikes-inc-easy-mailchimp-extender' ); ?></h3> |
@@ -177,12 +177,12 @@ discard block |
||
177 | 177 | <strong><?php esc_html_e( 'No Subscriber Data Found', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
178 | 178 | <?php |
179 | 179 | } |
180 | - if ( isset( $user_data['ip_signup'] ) && ! empty( $user_data['ip_signup'] ) ) { |
|
180 | + if ( isset( $user_data[ 'ip_signup' ] ) && ! empty( $user_data[ 'ip_signup' ] ) ) { |
|
181 | 181 | ?> |
182 | 182 | <li> |
183 | 183 | <label> |
184 | 184 | <strong class="section-label"><?php esc_html_e( 'Signup IP', 'yikes-inc-easy-mailchimp-extender' ); ?></strong> |
185 | - <p class="section-value"><em><?php esc_html_e( $user_data['ip_signup'] ); ?></em></p> |
|
185 | + <p class="section-value"><em><?php esc_html_e( $user_data[ 'ip_signup' ] ); ?></em></p> |
|
186 | 186 | </label> |
187 | 187 | </li> |
188 | 188 | <?php |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | <?php |
194 | 194 | |
195 | 195 | |
196 | - if ( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) { |
|
196 | + if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'additional-subscriptions' ) { |
|
197 | 197 | ?> |
198 | 198 | <section class="yikes-mc-card-body"> |
199 | 199 | <?php |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | ?> |
223 | 223 | |
224 | 224 | <?php |
225 | - if ( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) { |
|
225 | + if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'delete-subscriber' ) { |
|
226 | 226 | $unsubscribe_subscriber_url = esc_url_raw( add_query_arg( array( |
227 | 227 | 'action' => 'yikes-easy-mc-unsubscribe-user', |
228 | 228 | 'mailchimp-list' => $list_id, |
@@ -277,36 +277,36 @@ discard block |
||
277 | 277 | <div id="customer-tab-wrapper"> |
278 | 278 | <ul id="customer-tab-wrapper-list"> |
279 | 279 | |
280 | - <?php if ( isset( $_GET['section'] ) && $_GET['section'] != 'subscriber-data' ) { ?> |
|
280 | + <?php if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] != 'subscriber-data' ) { ?> |
|
281 | 281 | <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; ?>"> |
282 | 282 | <?php } ?> |
283 | 283 | |
284 | - <li <?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'subscriber-data' ) ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
284 | + <li <?php if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'subscriber-data' ) ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
285 | 285 | <span class="dashicons dashicons-id"></span></li> |
286 | 286 | |
287 | - <?php if ( isset( $_GET['section'] ) && $_GET['section'] != 'subscriber-data' ) { ?> |
|
287 | + <?php if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] != 'subscriber-data' ) { ?> |
|
288 | 288 | </a> |
289 | 289 | <?php } ?> |
290 | 290 | |
291 | - <?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] != 'additional-subscriptions' ) ) { ?> |
|
291 | + <?php if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] != 'additional-subscriptions' ) ) { ?> |
|
292 | 292 | <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; ?>"> |
293 | 293 | <?php } ?> |
294 | 294 | |
295 | - <li <?php if ( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
295 | + <li <?php if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'additional-subscriptions' ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
296 | 296 | <span class="dashicons dashicons-portfolio"></span></li> |
297 | 297 | |
298 | - <?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'additional-subscriptions' ) ) { ?> |
|
298 | + <?php if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'additional-subscriptions' ) ) { ?> |
|
299 | 299 | </a> |
300 | 300 | <?php } ?> |
301 | 301 | |
302 | - <?php if ( ! isset( $_GET['section'] ) || isset( $_GET['section'] ) && $_GET['section'] != 'delete-subscriber' ) { ?> |
|
302 | + <?php if ( ! isset( $_GET[ 'section' ] ) || isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] != 'delete-subscriber' ) { ?> |
|
303 | 303 | <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; ?>"> |
304 | 304 | <?php } ?> |
305 | 305 | |
306 | - <li <?php if ( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
306 | + <li <?php if ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'delete-subscriber' ) { ?>class="active" <?php } else { ?>class="inactive"<?php } ?>> |
|
307 | 307 | <span class="dashicons dashicons-trash"></span></li> |
308 | 308 | |
309 | - <?php if ( ! isset( $_GET['section'] ) || ( isset( $_GET['section'] ) && $_GET['section'] == 'delete-subscriber' ) ) { ?> |
|
309 | + <?php if ( ! isset( $_GET[ 'section' ] ) || ( isset( $_GET[ 'section' ] ) && $_GET[ 'section' ] == 'delete-subscriber' ) ) { ?> |
|
310 | 310 | </a> |
311 | 311 | <?php } ?> |
312 | 312 |
@@ -66,46 +66,46 @@ |
||
66 | 66 | */ |
67 | 67 | public function render_block( $attributes, $content ) { |
68 | 68 | |
69 | - if ( ! isset( $attributes['form_id'] ) ) { |
|
69 | + if ( ! isset( $attributes[ 'form_id' ] ) ) { |
|
70 | 70 | return; |
71 | 71 | } |
72 | 72 | |
73 | 73 | $shortcode_attributes = array( |
74 | - 'form' => $attributes['form_id'], |
|
75 | - 'submit' => isset( $attributes['submit_button_text'] ) && ! empty( $attributes['submit_button_text'] ) ? $attributes['submit_button_text'] : '', |
|
76 | - 'title' => isset( $attributes['show_title'] ) && true === $attributes['show_title'] ? '1' : '0', |
|
77 | - 'custom_title' => isset( $attributes['form_title'] ) ? $attributes['form_title'] : '', |
|
78 | - 'description' => isset( $attributes['show_description'] ) && true === $attributes['show_description'] ? '1' : '0', |
|
79 | - 'custom_description' => isset( $attributes['form_description'] ) ? $attributes['form_description'] : '', |
|
80 | - 'ajax' => isset( $attributes['is_ajax'] ) && true === $attributes['is_ajax'] ? '1' : '0', |
|
81 | - 'recaptcha' => ! isset( $attributes['recaptcha'] ) || isset( $attributes['recaptcha'] ) && false === $attributes['recaptcha'] ? '0' : '', |
|
82 | - 'recaptcha_lang' => isset( $attributes['recaptcha_lang'] ) ? $attributes['recaptcha_lang'] : '', |
|
83 | - 'recaptcha_type' => isset( $attributes['recaptcha_type'] ) ? $attributes['recaptcha_type'] : '', |
|
84 | - 'recaptcha_theme' => isset( $attributes['recaptcha_theme'] ) ? $attributes['recaptcha_theme'] : '', |
|
85 | - 'recaptcha_size' => isset( $attributes['recaptcha_size'] ) ? $attributes['recaptcha_size'] : '', |
|
86 | - 'recaptcha_data_callback' => isset( $attributes['recaptcha_verify_callback'] ) ? $attributes['recaptcha_verify_callback'] : '', |
|
87 | - 'recaptcha_expired_callback' => isset( $attributes['recaptcha_expired_callback'] ) ? $attributes['recaptcha_expired_callback'] : '', |
|
88 | - 'inline' => isset( $attributes['inline'] ) && true === $attributes['inline'] ? '1' : '0', |
|
74 | + 'form' => $attributes[ 'form_id' ], |
|
75 | + 'submit' => isset( $attributes[ 'submit_button_text' ] ) && ! empty( $attributes[ 'submit_button_text' ] ) ? $attributes[ 'submit_button_text' ] : '', |
|
76 | + 'title' => isset( $attributes[ 'show_title' ] ) && true === $attributes[ 'show_title' ] ? '1' : '0', |
|
77 | + 'custom_title' => isset( $attributes[ 'form_title' ] ) ? $attributes[ 'form_title' ] : '', |
|
78 | + 'description' => isset( $attributes[ 'show_description' ] ) && true === $attributes[ 'show_description' ] ? '1' : '0', |
|
79 | + 'custom_description' => isset( $attributes[ 'form_description' ] ) ? $attributes[ 'form_description' ] : '', |
|
80 | + 'ajax' => isset( $attributes[ 'is_ajax' ] ) && true === $attributes[ 'is_ajax' ] ? '1' : '0', |
|
81 | + 'recaptcha' => ! isset( $attributes[ 'recaptcha' ] ) || isset( $attributes[ 'recaptcha' ] ) && false === $attributes[ 'recaptcha' ] ? '0' : '', |
|
82 | + 'recaptcha_lang' => isset( $attributes[ 'recaptcha_lang' ] ) ? $attributes[ 'recaptcha_lang' ] : '', |
|
83 | + 'recaptcha_type' => isset( $attributes[ 'recaptcha_type' ] ) ? $attributes[ 'recaptcha_type' ] : '', |
|
84 | + 'recaptcha_theme' => isset( $attributes[ 'recaptcha_theme' ] ) ? $attributes[ 'recaptcha_theme' ] : '', |
|
85 | + 'recaptcha_size' => isset( $attributes[ 'recaptcha_size' ] ) ? $attributes[ 'recaptcha_size' ] : '', |
|
86 | + 'recaptcha_data_callback' => isset( $attributes[ 'recaptcha_verify_callback' ] ) ? $attributes[ 'recaptcha_verify_callback' ] : '', |
|
87 | + 'recaptcha_expired_callback' => isset( $attributes[ 'recaptcha_expired_callback' ] ) ? $attributes[ 'recaptcha_expired_callback' ] : '', |
|
88 | + 'inline' => isset( $attributes[ 'inline' ] ) && true === $attributes[ 'inline' ] ? '1' : '0', |
|
89 | 89 | ); |
90 | 90 | |
91 | 91 | // We want to run process_mailchimp_shortcode() but we need to return the plaintext shortcode or Gutenberg will autop() the shortcode content. |
92 | 92 | return sprintf( |
93 | 93 | '[yikes-mailchimp form="%s" submit="%s" title="%s" custom_title="%s" description="%s" custom_description="%s" ajax="%s" recaptcha="%s" recaptcha_lang="%s" recaptcha_type="%s" recaptcha_theme="%s" recaptcha_size="%s" recaptcha_data_callback="%s" recaptcha_expired_callback="%s" inline="%s"]', |
94 | - $shortcode_attributes['form'], |
|
95 | - $shortcode_attributes['submit'], |
|
96 | - $shortcode_attributes['title'], |
|
97 | - $shortcode_attributes['custom_title'], |
|
98 | - $shortcode_attributes['description'], |
|
99 | - $shortcode_attributes['custom_description'], |
|
100 | - $shortcode_attributes['ajax'], |
|
101 | - $shortcode_attributes['recaptcha'], |
|
102 | - $shortcode_attributes['recaptcha_lang'], |
|
103 | - $shortcode_attributes['recaptcha_type'], |
|
104 | - $shortcode_attributes['recaptcha_theme'], |
|
105 | - $shortcode_attributes['recaptcha_size'], |
|
106 | - $shortcode_attributes['recaptcha_data_callback'], |
|
107 | - $shortcode_attributes['recaptcha_expired_callback'], |
|
108 | - $shortcode_attributes['inline'] |
|
94 | + $shortcode_attributes[ 'form' ], |
|
95 | + $shortcode_attributes[ 'submit' ], |
|
96 | + $shortcode_attributes[ 'title' ], |
|
97 | + $shortcode_attributes[ 'custom_title' ], |
|
98 | + $shortcode_attributes[ 'description' ], |
|
99 | + $shortcode_attributes[ 'custom_description' ], |
|
100 | + $shortcode_attributes[ 'ajax' ], |
|
101 | + $shortcode_attributes[ 'recaptcha' ], |
|
102 | + $shortcode_attributes[ 'recaptcha_lang' ], |
|
103 | + $shortcode_attributes[ 'recaptcha_type' ], |
|
104 | + $shortcode_attributes[ 'recaptcha_theme' ], |
|
105 | + $shortcode_attributes[ 'recaptcha_size' ], |
|
106 | + $shortcode_attributes[ 'recaptcha_data_callback' ], |
|
107 | + $shortcode_attributes[ 'recaptcha_expired_callback' ], |
|
108 | + $shortcode_attributes[ 'inline' ] |
|
109 | 109 | ); |
110 | 110 | } |
111 | 111 | } |
@@ -3,15 +3,15 @@ discard block |
||
3 | 3 | $form_interface = yikes_easy_mailchimp_extender_get_form_interface(); |
4 | 4 | $all_forms = $form_interface->get_all_forms(); |
5 | 5 | ?> |
6 | -<h3><span><?php _e( 'Import/Export Forms & Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
6 | +<h3><span><?php _e( 'Import/Export Forms & Settings', 'yikes-inc-easy-mailchimp-extender' ); ?></span></h3> |
|
7 | 7 | |
8 | 8 | <div class="inside"> |
9 | 9 | |
10 | 10 | <!-- Export Form --> |
11 | - <form action="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-export-forms' , 'nonce' => wp_create_nonce( 'export-forms' ) ) ) ); ?>" method="post"> |
|
12 | - <p><strong><?php _e( "Export Forms" , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p> |
|
11 | + <form action="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-export-forms', 'nonce' => wp_create_nonce( 'export-forms' ) ) ) ); ?>" method="post"> |
|
12 | + <p><strong><?php _e( "Export Forms", 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p> |
|
13 | 13 | <p class="description"> |
14 | - <?php _e( "Select the forms you would like to export. When you click the download button below, Easy Forms for Mailchimp will create a CSV file for you to save to your computer. Once you've saved the download file, you can use the Import tool to import the forms to this or any other site." , "yikes-inc-easy-mailchimp-extender" ); ?> |
|
14 | + <?php _e( "Select the forms you would like to export. When you click the download button below, Easy Forms for Mailchimp will create a CSV file for you to save to your computer. Once you've saved the download file, you can use the Import tool to import the forms to this or any other site.", "yikes-inc-easy-mailchimp-extender" ); ?> |
|
15 | 15 | </p> |
16 | 16 | |
17 | 17 | <?php if ( empty( $all_forms ) ) { ?> |
@@ -20,44 +20,44 @@ discard block |
||
20 | 20 | </p> |
21 | 21 | <?php } else { ?> |
22 | 22 | <!-- custom list so users can export specific forms --> |
23 | - <a class="toggle-custom-lists button-secondary" onclick="jQuery(this).next().slideToggle();return false;"><?php _e( 'Select Forms' , 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
23 | + <a class="toggle-custom-lists button-secondary" onclick="jQuery(this).next().slideToggle();return false;"><?php _e( 'Select Forms', 'yikes-inc-easy-mailchimp-extender' ); ?></a> |
|
24 | 24 | <ul class="export-custom-forms-list"> |
25 | - <p class="description"><?php _e( 'Select which forms to export. Leave all checkboxes unchecked to export all of your forms.' , 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
26 | - <?php foreach( $all_forms as $id => $form ) { ?> |
|
27 | - <li><label><input type="checkbox" name="yikes_export_forms[]" value="<?php echo (int) $id; ?>"><?php echo esc_html( $form['form_name'] ); ?></label></li> |
|
25 | + <p class="description"><?php _e( 'Select which forms to export. Leave all checkboxes unchecked to export all of your forms.', 'yikes-inc-easy-mailchimp-extender' ); ?></p> |
|
26 | + <?php foreach ( $all_forms as $id => $form ) { ?> |
|
27 | + <li><label><input type="checkbox" name="yikes_export_forms[]" value="<?php echo (int) $id; ?>"><?php echo esc_html( $form[ 'form_name' ] ); ?></label></li> |
|
28 | 28 | <?php } ?> |
29 | 29 | </ul> |
30 | 30 | <?php } ?> |
31 | 31 | <!-- check if any of our transients contain data --> |
32 | - <p><input type="submit" class="button-primary" value="<?php _e( 'Export Opt-in Forms' , 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p> |
|
32 | + <p><input type="submit" class="button-primary" value="<?php _e( 'Export Opt-in Forms', 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p> |
|
33 | 33 | </form> |
34 | 34 | |
35 | 35 | <hr /> |
36 | 36 | |
37 | 37 | <!-- Export Form --> |
38 | - <form action="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-export-settings' , 'nonce' => wp_create_nonce( 'export-settings' ) ) ) ); ?>" method="post"> |
|
39 | - <p><strong><?php _e( "Export Settings" , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p> |
|
38 | + <form action="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-export-settings', 'nonce' => wp_create_nonce( 'export-settings' ) ) ) ); ?>" method="post"> |
|
39 | + <p><strong><?php _e( "Export Settings", 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p> |
|
40 | 40 | <p class="description"> |
41 | - <?php _e( "Export YIKES Easy Forms for Mailchimp plugin settings." , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
41 | + <?php _e( "Export YIKES Easy Forms for Mailchimp plugin settings.", 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
42 | 42 | </p> |
43 | 43 | |
44 | 44 | <!-- check if any of our transients contain data --> |
45 | - <p><input type="submit" class="button-primary" value="<?php _e( 'Export Plugin Settings' , 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p> |
|
45 | + <p><input type="submit" class="button-primary" value="<?php _e( 'Export Plugin Settings', 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p> |
|
46 | 46 | </form> |
47 | 47 | |
48 | 48 | <hr /> |
49 | 49 | |
50 | 50 | <!-- Import Form --> |
51 | - <form action="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-import-forms' , 'nonce' => wp_create_nonce( 'import-forms' ) ) ) ); ?>" method="post" enctype="multipart/form-data"> |
|
52 | - <p><strong><?php _e( "Import" , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p> |
|
51 | + <form action="<?php echo esc_url_raw( add_query_arg( array( 'action' => 'yikes-easy-mc-import-forms', 'nonce' => wp_create_nonce( 'import-forms' ) ) ) ); ?>" method="post" enctype="multipart/form-data"> |
|
52 | + <p><strong><?php _e( "Import", 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p> |
|
53 | 53 | <p class="description"> |
54 | - <?php _e( "Select the Easy Forms for Mailchimp export file you would like to import. You can use this field to import your opt-in forms or settings. " , 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
54 | + <?php _e( "Select the Easy Forms for Mailchimp export file you would like to import. You can use this field to import your opt-in forms or settings. ", 'yikes-inc-easy-mailchimp-extender' ); ?> |
|
55 | 55 | </p> |
56 | 56 | <label> |
57 | 57 | <input type="file" name="csv" id="forms_to_import"> |
58 | 58 | </label> |
59 | 59 | <!-- check if any of our transients contain data --> |
60 | - <p><input type="submit" class="button-primary" value="<?php _e( 'Import' , 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p> |
|
60 | + <p><input type="submit" class="button-primary" value="<?php _e( 'Import', 'yikes-inc-easy-mailchimp-extender' ); ?>" /></p> |
|
61 | 61 | </form> |
62 | 62 | |
63 | 63 | </div> <!-- .inside --> |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | // Construction |
10 | 10 | public function __construct() { |
11 | 11 | |
12 | - if ( apply_filters( 'yikes-mailchimp-dashboard-widgets-enabled', true ) === true && yikes_get_mc_api_key() != '' && get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'valid_api_key' ) { |
|
12 | + if ( apply_filters( 'yikes-mailchimp-dashboard-widgets-enabled', true ) === true && yikes_get_mc_api_key() != '' && get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'valid_api_key' ) { |
|
13 | 13 | |
14 | 14 | // hook in and display our list stats dashboard widget |
15 | 15 | add_action( 'wp_dashboard_setup', array( $this, 'yks_mc_add_dashboard_widget' ), 10 ); |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | |
55 | 55 | /* List Stats Dashboard Widget */ |
56 | 56 | wp_add_dashboard_widget( |
57 | - 'yikes_easy_mc_list_stats_widget', // Widget slug. |
|
58 | - __( 'Mailchimp List Stats', 'yikes-inc-easy-mailchimp-extender' ), // Title. |
|
57 | + 'yikes_easy_mc_list_stats_widget', // Widget slug. |
|
58 | + __( 'Mailchimp List Stats', 'yikes-inc-easy-mailchimp-extender' ), // Title. |
|
59 | 59 | array( $this, 'list_stats_dashboard_widget' ) // Display function. |
60 | 60 | ); |
61 | 61 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | <?php |
88 | 88 | foreach ( $list_data as $list ) { |
89 | 89 | ?> |
90 | - <option value="<?php echo $list['id']; ?>"><?php echo $list['name']; ?></option> |
|
90 | + <option value="<?php echo $list[ 'id' ]; ?>"><?php echo $list[ 'name' ]; ?></option> |
|
91 | 91 | <?php |
92 | 92 | } |
93 | 93 | ?> |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | // Widget name will appear in UI |
26 | 26 | __( 'Easy Mailchimp Forms', 'yikes-inc-easy-mailchimp-extender' ), |
27 | 27 | // Widget description |
28 | - array( 'description' => __( 'Mailchimp opt-in widget for your sidebar.', 'yikes-inc-easy-mailchimp-extender' ), ) |
|
28 | + array( 'description' => __( 'Mailchimp opt-in widget for your sidebar.', 'yikes-inc-easy-mailchimp-extender' ),) |
|
29 | 29 | ); |
30 | 30 | } |
31 | 31 | |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | // Get all form IDs so we can use the first one as a default. |
40 | 40 | $form_ids = $this->form_interface->get_form_ids(); |
41 | 41 | |
42 | - $title = isset( $instance['title'] ) ? apply_filters( 'widget_title', $instance['title'] ) : __( 'Mailchimp Signup Form', 'yikes-inc-easy-mailchimp-extender' ); |
|
43 | - $form_id = isset( $instance['form_id'] ) ? $instance['form_id'] : $form_ids[0]; |
|
44 | - $form_description = isset( $instance['form_description'] ) ? $instance['form_description'] : ''; |
|
45 | - $submit_button_text = isset( $instance['submit_text'] ) ? $instance['submit_text'] : __( 'Submit', 'yikes-inc-easy-mailchimp-extender' ); |
|
42 | + $title = isset( $instance[ 'title' ] ) ? apply_filters( 'widget_title', $instance[ 'title' ] ) : __( 'Mailchimp Signup Form', 'yikes-inc-easy-mailchimp-extender' ); |
|
43 | + $form_id = isset( $instance[ 'form_id' ] ) ? $instance[ 'form_id' ] : $form_ids[ 0 ]; |
|
44 | + $form_description = isset( $instance[ 'form_description' ] ) ? $instance[ 'form_description' ] : ''; |
|
45 | + $submit_button_text = isset( $instance[ 'submit_text' ] ) ? $instance[ 'submit_text' ] : __( 'Submit', 'yikes-inc-easy-mailchimp-extender' ); |
|
46 | 46 | |
47 | 47 | // Build our array based on settings chosen |
48 | 48 | $shortcode_attributes = array( |
@@ -54,10 +54,10 @@ discard block |
||
54 | 54 | $shortcode_attributes = apply_filters( 'yikes_mailchimp_widget_shortcode_attributes', $shortcode_attributes, $instance ); |
55 | 55 | |
56 | 56 | // before and after widget arguments are defined by themes |
57 | - echo $args['before_widget']; |
|
57 | + echo $args[ 'before_widget' ]; |
|
58 | 58 | |
59 | 59 | if ( ! empty( $title ) ) { |
60 | - echo $args['before_title'] . $title . $args['after_title']; |
|
60 | + echo $args[ 'before_title' ] . $title . $args[ 'after_title' ]; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | // Custom action hooks to place content in the widget before the form |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | do_action( 'yikes-mailchimp-after-form-' . $form_id ); |
74 | 74 | do_action( 'yikes-mailchimp-after-form' ); |
75 | 75 | |
76 | - echo $args['after_widget']; |
|
76 | + echo $args[ 'after_widget' ]; |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | // Widget Backend |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | if ( empty( $all_forms ) ) { |
84 | 84 | ?> |
85 | 85 | <section class="no-forms-widget"> |
86 | - <strong><span class="dashicons dashicons-no-alt no-forms-found-icon"></span><?php echo sprintf( __( 'No forms found. It looks like you need to <a href="%s" title="%s">%s</a>.', 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ), __( 'Create a form' , 'yikes-inc-easy-mailchimp-extender' ), __( 'create a form' , 'yikes-inc-easy-mailchimp-extender' ) ); ?></strong> |
|
86 | + <strong><span class="dashicons dashicons-no-alt no-forms-found-icon"></span><?php echo sprintf( __( 'No forms found. It looks like you need to <a href="%s" title="%s">%s</a>.', 'yikes-inc-easy-mailchimp-extender' ), esc_url_raw( admin_url( 'admin.php?page=yikes-inc-easy-mailchimp' ) ), __( 'Create a form', 'yikes-inc-easy-mailchimp-extender' ), __( 'create a form', 'yikes-inc-easy-mailchimp-extender' ) ); ?></strong> |
|
87 | 87 | </section> |
88 | 88 | <?php |
89 | 89 | return; |
@@ -110,9 +110,9 @@ discard block |
||
110 | 110 | $submit_text = __( 'Submit', 'yikes-inc-easy-mailchimp-extender' ); |
111 | 111 | } |
112 | 112 | |
113 | - if( get_option( 'yikes-mc-api-validation' , 'invalid_api_key' ) == 'invalid_api_key' ) { |
|
113 | + if ( get_option( 'yikes-mc-api-validation', 'invalid_api_key' ) == 'invalid_api_key' ) { |
|
114 | 114 | ?> |
115 | - <p class="enter-valid-api-error-widget"><strong><?php _e( 'Please enter a valid Mailchimp API key to connect your site to Mailchimp.' , 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p> |
|
115 | + <p class="enter-valid-api-error-widget"><strong><?php _e( 'Please enter a valid Mailchimp API key to connect your site to Mailchimp.', 'yikes-inc-easy-mailchimp-extender' ); ?></strong></p> |
|
116 | 116 | <?php |
117 | 117 | return; |
118 | 118 | } |
@@ -129,9 +129,9 @@ discard block |
||
129 | 129 | <select id="<?php echo $this->get_field_id( 'form_id' ); ?>" name="<?php echo $this->get_field_name( 'form_id' ); ?>" class="widefat"> |
130 | 130 | <?php |
131 | 131 | // build our array |
132 | - foreach( $all_forms as $id => $form ) { |
|
132 | + foreach ( $all_forms as $id => $form ) { |
|
133 | 133 | ?> |
134 | - <option <?php selected( $selected_form , $id ); ?> name="<?php echo $this->get_field_name( 'form_id' ); ?>" value="<?php echo $id; ?>"><?php echo stripslashes( $form['form_name'] ); ?></option> |
|
134 | + <option <?php selected( $selected_form, $id ); ?> name="<?php echo $this->get_field_name( 'form_id' ); ?>" value="<?php echo $id; ?>"><?php echo stripslashes( $form[ 'form_name' ] ); ?></option> |
|
135 | 135 | <?php |
136 | 136 | } |
137 | 137 | ?> |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | <p> |
142 | 142 | <label for="<?php echo $this->get_field_id( 'form_description' ); ?>"><?php _e( 'Display Form Description:' ); ?></label> |
143 | - <input class="widefat" id="<?php echo $this->get_field_id( 'form_description' ); ?>" name="<?php echo $this->get_field_name( 'form_description' ); ?>" type="checkbox" value="1" <?php if( isset( $instance['form_description'] ) ) { checked( $instance['form_description'] , 1 ); } ?> /> |
|
143 | + <input class="widefat" id="<?php echo $this->get_field_id( 'form_description' ); ?>" name="<?php echo $this->get_field_name( 'form_description' ); ?>" type="checkbox" value="1" <?php if ( isset( $instance[ 'form_description' ] ) ) { checked( $instance[ 'form_description' ], 1 ); } ?> /> |
|
144 | 144 | </p> |
145 | 145 | |
146 | 146 | <p> |
@@ -153,10 +153,10 @@ discard block |
||
153 | 153 | // Updating widget replacing old instances with new |
154 | 154 | public function update( $new_instance, $old_instance ) { |
155 | 155 | $instance = array(); |
156 | - $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : ''; |
|
157 | - $instance['form_id'] = $new_instance['form_id']; |
|
158 | - $instance['form_description'] = isset( $new_instance['form_description'] ) ? '1' : ''; |
|
159 | - $instance['submit_text'] = ( ! empty( $new_instance['submit_text'] ) ) ? strip_tags( $new_instance['submit_text'] ) : 'Submit'; |
|
156 | + $instance[ 'title' ] = ( ! empty( $new_instance[ 'title' ] ) ) ? strip_tags( $new_instance[ 'title' ] ) : ''; |
|
157 | + $instance[ 'form_id' ] = $new_instance[ 'form_id' ]; |
|
158 | + $instance[ 'form_description' ] = isset( $new_instance[ 'form_description' ] ) ? '1' : ''; |
|
159 | + $instance[ 'submit_text' ] = ( ! empty( $new_instance[ 'submit_text' ] ) ) ? strip_tags( $new_instance[ 'submit_text' ] ) : 'Submit'; |
|
160 | 160 | return $instance; |
161 | 161 | } |
162 | 162 |