@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly. |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | */ |
25 | 25 | function give_donors_page() { |
26 | 26 | $default_views = give_donor_views(); |
27 | - $requested_view = isset( $_GET['view'] ) ? sanitize_text_field( $_GET['view'] ) : 'donors'; |
|
28 | - if ( array_key_exists( $requested_view, $default_views ) && function_exists( $default_views[ $requested_view ] ) ) { |
|
29 | - give_render_donor_view( $requested_view, $default_views ); |
|
27 | + $requested_view = isset($_GET['view']) ? sanitize_text_field($_GET['view']) : 'donors'; |
|
28 | + if (array_key_exists($requested_view, $default_views) && function_exists($default_views[$requested_view])) { |
|
29 | + give_render_donor_view($requested_view, $default_views); |
|
30 | 30 | } else { |
31 | 31 | give_donors_list(); |
32 | 32 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | $views = array(); |
44 | 44 | |
45 | - return apply_filters( 'give_donor_views', $views ); |
|
45 | + return apply_filters('give_donor_views', $views); |
|
46 | 46 | |
47 | 47 | } |
48 | 48 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | $tabs = array(); |
58 | 58 | |
59 | - return apply_filters( 'give_donor_tabs', $tabs ); |
|
59 | + return apply_filters('give_donor_tabs', $tabs); |
|
60 | 60 | |
61 | 61 | } |
62 | 62 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * @return void |
68 | 68 | */ |
69 | 69 | function give_donors_list() { |
70 | - include dirname( __FILE__ ) . '/class-donor-table.php'; |
|
70 | + include dirname(__FILE__).'/class-donor-table.php'; |
|
71 | 71 | |
72 | 72 | $donors_table = new Give_Donor_List_Table(); |
73 | 73 | $donors_table->prepare_items(); |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @since 1.0 |
82 | 82 | */ |
83 | - do_action( 'give_donors_table_top' ); |
|
83 | + do_action('give_donors_table_top'); |
|
84 | 84 | ?> |
85 | - <form id="give-donors-filter" method="get" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors' ); ?>"> |
|
85 | + <form id="give-donors-filter" method="get" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors'); ?>"> |
|
86 | 86 | <?php |
87 | - $donors_table->search_box( esc_html__( 'Search Donors', 'give' ), 'give-donors' ); |
|
87 | + $donors_table->search_box(esc_html__('Search Donors', 'give'), 'give-donors'); |
|
88 | 88 | $donors_table->display(); |
89 | 89 | ?> |
90 | 90 | <input type="hidden" name="post_type" value="give_forms" /> |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @since 1.0 |
99 | 99 | */ |
100 | - do_action( 'give_donors_table_bottom' ); |
|
100 | + do_action('give_donors_table_bottom'); |
|
101 | 101 | ?> |
102 | 102 | </div> |
103 | 103 | <?php |
@@ -113,27 +113,27 @@ discard block |
||
113 | 113 | * |
114 | 114 | * @return void |
115 | 115 | */ |
116 | -function give_render_donor_view( $view, $callbacks ) { |
|
116 | +function give_render_donor_view($view, $callbacks) { |
|
117 | 117 | |
118 | 118 | $render = true; |
119 | 119 | |
120 | - $donor_view_role = apply_filters( 'give_view_donors_role', 'view_give_reports' ); |
|
120 | + $donor_view_role = apply_filters('give_view_donors_role', 'view_give_reports'); |
|
121 | 121 | |
122 | - if ( ! current_user_can( $donor_view_role ) ) { |
|
123 | - give_set_error( 'give-no-access', __( 'You are not permitted to view this data.', 'give' ) ); |
|
122 | + if ( ! current_user_can($donor_view_role)) { |
|
123 | + give_set_error('give-no-access', __('You are not permitted to view this data.', 'give')); |
|
124 | 124 | $render = false; |
125 | 125 | } |
126 | 126 | |
127 | - if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) { |
|
128 | - give_set_error( 'give-invalid_donor', __( 'Invalid Donor ID.', 'give' ) ); |
|
127 | + if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) { |
|
128 | + give_set_error('give-invalid_donor', __('Invalid Donor ID.', 'give')); |
|
129 | 129 | $render = false; |
130 | 130 | } |
131 | 131 | |
132 | 132 | $donor_id = (int) $_GET['id']; |
133 | - $donor = new Give_Donor( $donor_id ); |
|
133 | + $donor = new Give_Donor($donor_id); |
|
134 | 134 | |
135 | - if ( empty( $donor->id ) ) { |
|
136 | - give_set_error( 'give-invalid_donor', __( 'Invalid Donor ID.', 'give' ) ); |
|
135 | + if (empty($donor->id)) { |
|
136 | + give_set_error('give-invalid_donor', __('Invalid Donor ID.', 'give')); |
|
137 | 137 | $render = false; |
138 | 138 | } |
139 | 139 | |
@@ -142,34 +142,34 @@ discard block |
||
142 | 142 | |
143 | 143 | <div class='wrap'> |
144 | 144 | |
145 | - <?php if ( give_get_errors() ) : ?> |
|
145 | + <?php if (give_get_errors()) : ?> |
|
146 | 146 | <div class="error settings-error"> |
147 | - <?php Give()->notices->render_frontend_notices( 0 ); ?> |
|
147 | + <?php Give()->notices->render_frontend_notices(0); ?> |
|
148 | 148 | </div> |
149 | 149 | <?php endif; ?> |
150 | 150 | |
151 | - <h1 class="screen-reader-text"><?php esc_html_e( 'Donor', 'give' ); ?></h1> |
|
151 | + <h1 class="screen-reader-text"><?php esc_html_e('Donor', 'give'); ?></h1> |
|
152 | 152 | |
153 | - <?php if ( $donor && $render ) : ?> |
|
153 | + <?php if ($donor && $render) : ?> |
|
154 | 154 | |
155 | 155 | <h2 class="nav-tab-wrapper"> |
156 | 156 | <?php |
157 | - foreach ( $donor_tabs as $key => $tab ) : |
|
157 | + foreach ($donor_tabs as $key => $tab) : |
|
158 | 158 | $active = $key === $view ? true : false; |
159 | 159 | $class = $active ? 'nav-tab nav-tab-active' : 'nav-tab'; |
160 | 160 | printf( |
161 | - '<a href="%1$s" class="%2$s"><span class="dashicons %3$s"></span>%4$s</a>' . "\n", |
|
162 | - esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=' . $key . '&id=' . $donor->id ) ), |
|
163 | - esc_attr( $class ), |
|
164 | - sanitize_html_class( $tab['dashicon'] ), |
|
165 | - esc_html( $tab['title'] ) |
|
161 | + '<a href="%1$s" class="%2$s"><span class="dashicons %3$s"></span>%4$s</a>'."\n", |
|
162 | + esc_url(admin_url('edit.php?post_type=give_forms&page=give-donors&view='.$key.'&id='.$donor->id)), |
|
163 | + esc_attr($class), |
|
164 | + sanitize_html_class($tab['dashicon']), |
|
165 | + esc_html($tab['title']) |
|
166 | 166 | ); |
167 | 167 | endforeach; |
168 | 168 | ?> |
169 | 169 | </h2> |
170 | 170 | |
171 | 171 | <div id="give-donor-card-wrapper"> |
172 | - <?php $callbacks[ $view ]( $donor ) ?> |
|
172 | + <?php $callbacks[$view]($donor) ?> |
|
173 | 173 | </div> |
174 | 174 | |
175 | 175 | <?php endif; ?> |
@@ -189,9 +189,9 @@ discard block |
||
189 | 189 | * |
190 | 190 | * @return void |
191 | 191 | */ |
192 | -function give_donor_view( $donor ) { |
|
192 | +function give_donor_view($donor) { |
|
193 | 193 | |
194 | - $donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' ); |
|
194 | + $donor_edit_role = apply_filters('give_edit_donors_role', 'edit_give_payments'); |
|
195 | 195 | |
196 | 196 | /** |
197 | 197 | * Fires in donor profile screen, above the donor card. |
@@ -200,32 +200,32 @@ discard block |
||
200 | 200 | * |
201 | 201 | * @param object $donor The donor object being displayed. |
202 | 202 | */ |
203 | - do_action( 'give_donor_card_top', $donor ); |
|
203 | + do_action('give_donor_card_top', $donor); |
|
204 | 204 | ?> |
205 | 205 | |
206 | 206 | <div id="donor-summary" class="info-wrapper donor-section postbox"> |
207 | 207 | |
208 | - <form id="edit-donor-info" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ); ?>"> |
|
208 | + <form id="edit-donor-info" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id); ?>"> |
|
209 | 209 | |
210 | 210 | <div class="donor-info"> |
211 | 211 | |
212 | 212 | <div class="donor-bio-header clearfix"> |
213 | 213 | |
214 | 214 | <div class="avatar-wrap left" id="donor-avatar"> |
215 | - <?php echo get_avatar( $donor->email ); ?> |
|
215 | + <?php echo get_avatar($donor->email); ?> |
|
216 | 216 | </div> |
217 | 217 | |
218 | 218 | <div id="donor-name-wrap" class="left"> |
219 | 219 | <span class="donor-id">#<?php echo $donor->id; ?></span> |
220 | - <span class="donor-name info-item edit-item"><input size="15" data-key="name" name="customerinfo[name]" type="text" value="<?php echo esc_attr( $donor->name ); ?>" placeholder="<?php esc_attr_e( 'Donor Name', 'give' ); ?>" /></span> |
|
220 | + <span class="donor-name info-item edit-item"><input size="15" data-key="name" name="customerinfo[name]" type="text" value="<?php echo esc_attr($donor->name); ?>" placeholder="<?php esc_attr_e('Donor Name', 'give'); ?>" /></span> |
|
221 | 221 | <span class="donor-name info-item editable"><span data-key="name"><?php echo $donor->name; ?></span></span> |
222 | 222 | </div> |
223 | 223 | <p class="donor-since info-item"> |
224 | - <?php esc_html_e( 'Donor since', 'give' ); ?> |
|
225 | - <?php echo date_i18n( give_date_format(), strtotime( $donor->date_created ) ) ?> |
|
224 | + <?php esc_html_e('Donor since', 'give'); ?> |
|
225 | + <?php echo date_i18n(give_date_format(), strtotime($donor->date_created)) ?> |
|
226 | 226 | </p> |
227 | - <?php if ( current_user_can( $donor_edit_role ) ) : ?> |
|
228 | - <a href="#" id="edit-donor" class="button info-item editable donor-edit-link"><?php esc_html_e( 'Edit Donor', 'give' ); ?></a> |
|
227 | + <?php if (current_user_can($donor_edit_role)) : ?> |
|
228 | + <a href="#" id="edit-donor" class="button info-item editable donor-edit-link"><?php esc_html_e('Edit Donor', 'give'); ?></a> |
|
229 | 229 | <?php endif; ?> |
230 | 230 | </div> |
231 | 231 | <!-- /donor-bio-header --> |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | <table class="widefat"> |
236 | 236 | <tbody> |
237 | 237 | <tr class="alternate"> |
238 | - <th scope="col"><label for="tablecell"><?php esc_html_e( 'User:', 'give' ); ?></label></th> |
|
238 | + <th scope="col"><label for="tablecell"><?php esc_html_e('User:', 'give'); ?></label></th> |
|
239 | 239 | <td> |
240 | 240 | <span class="donor-user-id info-item edit-item"> |
241 | 241 | <?php |
@@ -252,37 +252,37 @@ discard block |
||
252 | 252 | 'data' => $data_atts, |
253 | 253 | ); |
254 | 254 | |
255 | - if ( ! empty( $user_id ) ) { |
|
256 | - $userdata = get_userdata( $user_id ); |
|
255 | + if ( ! empty($user_id)) { |
|
256 | + $userdata = get_userdata($user_id); |
|
257 | 257 | $user_args['selected'] = $user_id; |
258 | 258 | } |
259 | 259 | |
260 | - echo Give()->html->ajax_user_search( $user_args ); |
|
260 | + echo Give()->html->ajax_user_search($user_args); |
|
261 | 261 | ?> |
262 | 262 | </span> |
263 | 263 | |
264 | 264 | <span class="donor-user-id info-item editable"> |
265 | - <?php if ( ! empty( $userdata ) ) { ?> |
|
266 | - <span data-key="user_id">#<?php echo $donor->user_id . ' - ' . $userdata->display_name; ?></span> |
|
265 | + <?php if ( ! empty($userdata)) { ?> |
|
266 | + <span data-key="user_id">#<?php echo $donor->user_id.' - '.$userdata->display_name; ?></span> |
|
267 | 267 | <?php } else { ?> |
268 | - <span data-key="user_id"><?php esc_html_e( 'None', 'give' ); ?></span> |
|
268 | + <span data-key="user_id"><?php esc_html_e('None', 'give'); ?></span> |
|
269 | 269 | <?php } ?> |
270 | - <?php if ( current_user_can( $donor_edit_role ) && intval( $donor->user_id ) > 0 ) { ?> |
|
271 | - <span class="disconnect-user"> - <a id="disconnect-donor" href="#disconnect" aria-label="<?php esc_attr_e( 'Disconnects the current user ID from this donor record.', 'give' ); ?>"><?php esc_html_e( 'Disconnect User', 'give' ); ?></a></span> |
|
270 | + <?php if (current_user_can($donor_edit_role) && intval($donor->user_id) > 0) { ?> |
|
271 | + <span class="disconnect-user"> - <a id="disconnect-donor" href="#disconnect" aria-label="<?php esc_attr_e('Disconnects the current user ID from this donor record.', 'give'); ?>"><?php esc_html_e('Disconnect User', 'give'); ?></a></span> |
|
272 | 272 | <?php } ?> |
273 | 273 | </span> |
274 | 274 | </td> |
275 | 275 | </tr> |
276 | - <?php if ( isset( $donor->user_id ) && $donor->user_id > 0 ) : ?> |
|
276 | + <?php if (isset($donor->user_id) && $donor->user_id > 0) : ?> |
|
277 | 277 | |
278 | 278 | <tr> |
279 | - <th scope="col"><?php esc_html_e( 'Address:', 'give' ); ?></th> |
|
279 | + <th scope="col"><?php esc_html_e('Address:', 'give'); ?></th> |
|
280 | 280 | <td class="row-title"> |
281 | 281 | |
282 | 282 | <div class="donor-address-wrapper"> |
283 | 283 | |
284 | 284 | <?php |
285 | - $address = get_user_meta( $donor->user_id, '_give_user_address', true ); |
|
285 | + $address = get_user_meta($donor->user_id, '_give_user_address', true); |
|
286 | 286 | $defaults = array( |
287 | 287 | 'line1' => '', |
288 | 288 | 'line2' => '', |
@@ -292,10 +292,10 @@ discard block |
||
292 | 292 | 'zip' => '', |
293 | 293 | ); |
294 | 294 | |
295 | - $address = wp_parse_args( $address, $defaults ); |
|
295 | + $address = wp_parse_args($address, $defaults); |
|
296 | 296 | ?> |
297 | 297 | |
298 | - <?php if ( ! empty( $address ) ) { ?> |
|
298 | + <?php if ( ! empty($address)) { ?> |
|
299 | 299 | <span class="donor-address info-item editable"> |
300 | 300 | <span class="info-item" data-key="line1"><?php echo $address['line1']; ?></span> |
301 | 301 | <span class="info-item" data-key="line2"><?php echo $address['line2']; ?></span> |
@@ -306,43 +306,43 @@ discard block |
||
306 | 306 | </span> |
307 | 307 | <?php } ?> |
308 | 308 | <span class="donor-address info-item edit-item"> |
309 | - <input class="info-item" type="text" data-key="line1" name="customerinfo[line1]" placeholder="<?php esc_attr_e( 'Address 1', 'give' ); ?>" value="<?php echo $address['line1']; ?>" /> |
|
310 | - <input class="info-item" type="text" data-key="line2" name="customerinfo[line2]" placeholder="<?php esc_attr_e( 'Address 2', 'give' ); ?>" value="<?php echo $address['line2']; ?>" /> |
|
311 | - <input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php esc_attr_e( 'City', 'give' ); ?>" value="<?php echo $address['city']; ?>" /> |
|
309 | + <input class="info-item" type="text" data-key="line1" name="customerinfo[line1]" placeholder="<?php esc_attr_e('Address 1', 'give'); ?>" value="<?php echo $address['line1']; ?>" /> |
|
310 | + <input class="info-item" type="text" data-key="line2" name="customerinfo[line2]" placeholder="<?php esc_attr_e('Address 2', 'give'); ?>" value="<?php echo $address['line2']; ?>" /> |
|
311 | + <input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php esc_attr_e('City', 'give'); ?>" value="<?php echo $address['city']; ?>" /> |
|
312 | 312 | <select data-key="country" name="customerinfo[country]" id="billing_country" class="billing_country give-select edit-item"> |
313 | 313 | <?php |
314 | 314 | |
315 | 315 | $selected_country = $address['country']; |
316 | 316 | |
317 | 317 | $countries = give_get_country_list(); |
318 | - foreach ( $countries as $country_code => $country ) { |
|
319 | - echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>'; |
|
318 | + foreach ($countries as $country_code => $country) { |
|
319 | + echo '<option value="'.esc_attr($country_code).'"'.selected($country_code, $selected_country, false).'>'.$country.'</option>'; |
|
320 | 320 | } |
321 | 321 | ?> |
322 | 322 | </select> |
323 | 323 | <?php |
324 | 324 | $selected_state = give_get_state(); |
325 | - $states = give_get_states( $selected_country ); |
|
325 | + $states = give_get_states($selected_country); |
|
326 | 326 | |
327 | - $selected_state = isset( $address['state'] ) ? $address['state'] : $selected_state; |
|
327 | + $selected_state = isset($address['state']) ? $address['state'] : $selected_state; |
|
328 | 328 | |
329 | - if ( ! empty( $states ) ) { |
|
329 | + if ( ! empty($states)) { |
|
330 | 330 | ?> |
331 | 331 | <select data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-select info-item"> |
332 | 332 | <?php |
333 | - foreach ( $states as $state_code => $state ) { |
|
334 | - echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>'; |
|
333 | + foreach ($states as $state_code => $state) { |
|
334 | + echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>'; |
|
335 | 335 | } |
336 | 336 | ?> |
337 | 337 | </select> |
338 | 338 | <?php |
339 | 339 | } else { |
340 | 340 | ?> |
341 | - <input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item" placeholder="<?php esc_attr_e( 'State / Province / County', 'give' ); ?>" /> |
|
341 | + <input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item" placeholder="<?php esc_attr_e('State / Province / County', 'give'); ?>" /> |
|
342 | 342 | <?php |
343 | 343 | } |
344 | 344 | ?> |
345 | - <input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php esc_attr_e( 'Zip / Postal Code', 'give' ); ?>" value="<?php echo $address['zip']; ?>" /> |
|
345 | + <input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php esc_attr_e('Zip / Postal Code', 'give'); ?>" value="<?php echo $address['zip']; ?>" /> |
|
346 | 346 | </span> |
347 | 347 | |
348 | 348 | </div> |
@@ -358,10 +358,10 @@ discard block |
||
358 | 358 | |
359 | 359 | <span id="donor-edit-actions" class="edit-item"> |
360 | 360 | <input type="hidden" data-key="id" name="customerinfo[id]" value="<?php echo $donor->id; ?>" /> |
361 | - <?php wp_nonce_field( 'edit-donor', '_wpnonce', false, true ); ?> |
|
361 | + <?php wp_nonce_field('edit-donor', '_wpnonce', false, true); ?> |
|
362 | 362 | <input type="hidden" name="give_action" value="edit-donor" /> |
363 | - <input type="submit" id="give-edit-donor-save" class="button-secondary" value="<?php esc_attr_e( 'Update Donor', 'give' ); ?>" /> |
|
364 | - <a id="give-edit-donor-cancel" href="" class="delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a> |
|
363 | + <input type="submit" id="give-edit-donor-save" class="button-secondary" value="<?php esc_attr_e('Update Donor', 'give'); ?>" /> |
|
364 | + <a id="give-edit-donor-cancel" href="" class="delete"><?php esc_html_e('Cancel', 'give'); ?></a> |
|
365 | 365 | </span> |
366 | 366 | |
367 | 367 | </form> |
@@ -376,24 +376,24 @@ discard block |
||
376 | 376 | * |
377 | 377 | * @param object $donor The donor object being displayed. |
378 | 378 | */ |
379 | - do_action( 'give_donor_before_stats', $donor ); |
|
379 | + do_action('give_donor_before_stats', $donor); |
|
380 | 380 | ?> |
381 | 381 | |
382 | 382 | <div id="donor-stats-wrapper" class="donor-section postbox clear"> |
383 | 383 | <ul> |
384 | 384 | <li> |
385 | - <a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( $donor->email ) ); ?>"> |
|
385 | + <a href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history&user='.urlencode($donor->email)); ?>"> |
|
386 | 386 | <span class="dashicons dashicons-heart"></span> |
387 | 387 | <?php |
388 | 388 | // Completed Donations |
389 | - $completed_donations_text = sprintf( _n( '%d Completed Donation', '%d Completed Donations', $donor->purchase_count, 'give' ), $donor->purchase_count ); |
|
390 | - echo apply_filters( 'give_donor_completed_donations', $completed_donations_text, $donor ); |
|
389 | + $completed_donations_text = sprintf(_n('%d Completed Donation', '%d Completed Donations', $donor->purchase_count, 'give'), $donor->purchase_count); |
|
390 | + echo apply_filters('give_donor_completed_donations', $completed_donations_text, $donor); |
|
391 | 391 | ?> |
392 | 392 | </a> |
393 | 393 | </li> |
394 | 394 | <li> |
395 | 395 | <span class="dashicons dashicons-chart-area"></span> |
396 | - <?php echo give_currency_filter( give_format_amount( $donor->purchase_value, array( 'sanitize' => false ) ) ); ?> <?php esc_html_e( 'Lifetime Donations', 'give' ); ?> |
|
396 | + <?php echo give_currency_filter(give_format_amount($donor->purchase_value, array('sanitize' => false))); ?> <?php esc_html_e('Lifetime Donations', 'give'); ?> |
|
397 | 397 | </li> |
398 | 398 | <?php |
399 | 399 | /** |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | * |
406 | 406 | * @param object $donor The donor object being displayed. |
407 | 407 | */ |
408 | - do_action( 'give_donor_stats_list', $donor ); |
|
408 | + do_action('give_donor_stats_list', $donor); |
|
409 | 409 | ?> |
410 | 410 | </ul> |
411 | 411 | </div> |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | * |
419 | 419 | * @param object $donor The donor object being displayed. |
420 | 420 | */ |
421 | - do_action( 'give_donor_before_tables_wrapper', $donor ); |
|
421 | + do_action('give_donor_before_tables_wrapper', $donor); |
|
422 | 422 | ?> |
423 | 423 | |
424 | 424 | <div id="donor-tables-wrapper" class="donor-section"> |
@@ -431,46 +431,46 @@ discard block |
||
431 | 431 | * |
432 | 432 | * @param object $donor The donor object being displayed. |
433 | 433 | */ |
434 | - do_action( 'give_donor_before_tables', $donor ); |
|
434 | + do_action('give_donor_before_tables', $donor); |
|
435 | 435 | ?> |
436 | 436 | |
437 | - <h3><?php _e( 'Donor Emails', 'give' ); ?></h3> |
|
437 | + <h3><?php _e('Donor Emails', 'give'); ?></h3> |
|
438 | 438 | |
439 | 439 | <table class="wp-list-table widefat striped emails"> |
440 | 440 | <thead> |
441 | 441 | <tr> |
442 | - <th><?php _e( 'Email', 'give' ); ?></th> |
|
443 | - <th><?php _e( 'Actions', 'give' ); ?></th> |
|
442 | + <th><?php _e('Email', 'give'); ?></th> |
|
443 | + <th><?php _e('Actions', 'give'); ?></th> |
|
444 | 444 | </tr> |
445 | 445 | </thead> |
446 | 446 | |
447 | 447 | <tbody> |
448 | - <?php if ( ! empty( $donor->emails ) ) { ?> |
|
448 | + <?php if ( ! empty($donor->emails)) { ?> |
|
449 | 449 | |
450 | - <?php foreach ( $donor->emails as $key => $email ) : ?> |
|
450 | + <?php foreach ($donor->emails as $key => $email) : ?> |
|
451 | 451 | <tr data-key="<?php echo $key; ?>"> |
452 | 452 | <td> |
453 | 453 | <?php echo $email; ?> |
454 | - <?php if ( 'primary' === $key ) : ?> |
|
454 | + <?php if ('primary' === $key) : ?> |
|
455 | 455 | <span class="dashicons dashicons-star-filled primary-email-icon"></span> |
456 | 456 | <?php endif; ?> |
457 | 457 | </td> |
458 | 458 | <td> |
459 | - <?php if ( 'primary' !== $key ) : ?> |
|
459 | + <?php if ('primary' !== $key) : ?> |
|
460 | 460 | <?php |
461 | - $base_url = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ); |
|
462 | - $promote_url = wp_nonce_url( add_query_arg( array( |
|
463 | - 'email' => rawurlencode( $email ), |
|
461 | + $base_url = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id); |
|
462 | + $promote_url = wp_nonce_url(add_query_arg(array( |
|
463 | + 'email' => rawurlencode($email), |
|
464 | 464 | 'give_action' => 'set_donor_primary_email', |
465 | - ), $base_url ), 'give-set-donor-primary-email' ); |
|
466 | - $remove_url = wp_nonce_url( add_query_arg( array( |
|
467 | - 'email' => rawurlencode( $email ), |
|
465 | + ), $base_url), 'give-set-donor-primary-email'); |
|
466 | + $remove_url = wp_nonce_url(add_query_arg(array( |
|
467 | + 'email' => rawurlencode($email), |
|
468 | 468 | 'give_action' => 'remove_donor_email', |
469 | - ), $base_url ), 'give-remove-donor-email' ); |
|
469 | + ), $base_url), 'give-remove-donor-email'); |
|
470 | 470 | ?> |
471 | - <a href="<?php echo $promote_url; ?>"><?php _e( 'Make Primary', 'give' ); ?></a> |
|
471 | + <a href="<?php echo $promote_url; ?>"><?php _e('Make Primary', 'give'); ?></a> |
|
472 | 472 | | |
473 | - <a href="<?php echo $remove_url; ?>" class="delete"><?php _e( 'Remove', 'give' ); ?></a> |
|
473 | + <a href="<?php echo $remove_url; ?>" class="delete"><?php _e('Remove', 'give'); ?></a> |
|
474 | 474 | <?php endif; ?> |
475 | 475 | </td> |
476 | 476 | </tr> |
@@ -480,59 +480,59 @@ discard block |
||
480 | 480 | <td colspan="2" class="add-donor-email-td"> |
481 | 481 | <div class="add-donor-email-wrapper"> |
482 | 482 | <input type="hidden" name="donor-id" value="<?php echo $donor->id; ?>" /> |
483 | - <?php wp_nonce_field( 'give_add_donor_email', 'add_email_nonce', false, true ); ?> |
|
484 | - <input type="email" name="additional-email" value="" placeholder="<?php _e( 'Email Address', 'give' ); ?>" /> |
|
485 | - <input type="checkbox" name="make-additional-primary" value="1" id="make-additional-primary" /> <label for="make-additional-primary"><?php _e( 'Make Primary', 'give' ); ?></label> |
|
486 | - <button class="button-secondary give-add-donor-email" id="add-donor-email"><?php _e( 'Add Email', 'give' ); ?></button> |
|
483 | + <?php wp_nonce_field('give_add_donor_email', 'add_email_nonce', false, true); ?> |
|
484 | + <input type="email" name="additional-email" value="" placeholder="<?php _e('Email Address', 'give'); ?>" /> |
|
485 | + <input type="checkbox" name="make-additional-primary" value="1" id="make-additional-primary" /> <label for="make-additional-primary"><?php _e('Make Primary', 'give'); ?></label> |
|
486 | + <button class="button-secondary give-add-donor-email" id="add-donor-email"><?php _e('Add Email', 'give'); ?></button> |
|
487 | 487 | <span class="spinner"></span> |
488 | 488 | </div> |
489 | 489 | <div class="notice-wrap"></div> |
490 | 490 | </td> |
491 | 491 | </tr> |
492 | 492 | <?php } else { ?> |
493 | - <tr><td colspan="2"><?php _e( 'No Emails Found', 'give' ); ?></td></tr> |
|
493 | + <tr><td colspan="2"><?php _e('No Emails Found', 'give'); ?></td></tr> |
|
494 | 494 | <?php }// End if(). |
495 | 495 | ?> |
496 | 496 | </tbody> |
497 | 497 | </table> |
498 | 498 | |
499 | - <h3><?php esc_html_e( 'Recent Donations', 'give' ); ?></h3> |
|
499 | + <h3><?php esc_html_e('Recent Donations', 'give'); ?></h3> |
|
500 | 500 | <?php |
501 | - $payment_ids = explode( ',', $donor->payment_ids ); |
|
502 | - $payments = give_get_payments( array( |
|
501 | + $payment_ids = explode(',', $donor->payment_ids); |
|
502 | + $payments = give_get_payments(array( |
|
503 | 503 | 'post__in' => $payment_ids, |
504 | - ) ); |
|
505 | - $payments = array_slice( $payments, 0, 10 ); |
|
504 | + )); |
|
505 | + $payments = array_slice($payments, 0, 10); |
|
506 | 506 | ?> |
507 | 507 | <table class="wp-list-table widefat striped payments"> |
508 | 508 | <thead> |
509 | 509 | <tr> |
510 | - <th scope="col"><?php esc_html_e( 'ID', 'give' ); ?></th> |
|
511 | - <th scope="col"><?php esc_html_e( 'Amount', 'give' ); ?></th> |
|
512 | - <th scope="col"><?php esc_html_e( 'Date', 'give' ); ?></th> |
|
513 | - <th scope="col"><?php esc_html_e( 'Status', 'give' ); ?></th> |
|
514 | - <th scope="col"><?php esc_html_e( 'Actions', 'give' ); ?></th> |
|
510 | + <th scope="col"><?php esc_html_e('ID', 'give'); ?></th> |
|
511 | + <th scope="col"><?php esc_html_e('Amount', 'give'); ?></th> |
|
512 | + <th scope="col"><?php esc_html_e('Date', 'give'); ?></th> |
|
513 | + <th scope="col"><?php esc_html_e('Status', 'give'); ?></th> |
|
514 | + <th scope="col"><?php esc_html_e('Actions', 'give'); ?></th> |
|
515 | 515 | </tr> |
516 | 516 | </thead> |
517 | 517 | <tbody> |
518 | - <?php if ( ! empty( $payments ) ) { ?> |
|
519 | - <?php foreach ( $payments as $payment ) : ?> |
|
518 | + <?php if ( ! empty($payments)) { ?> |
|
519 | + <?php foreach ($payments as $payment) : ?> |
|
520 | 520 | <tr> |
521 | 521 | <td><?php echo $payment->ID; ?></td> |
522 | - <td><?php echo give_payment_amount( $payment->ID ); ?></td> |
|
523 | - <td><?php echo date_i18n( give_date_format(), strtotime( $payment->post_date ) ); ?></td> |
|
524 | - <td><?php echo give_get_payment_status( $payment, true ); ?></td> |
|
522 | + <td><?php echo give_payment_amount($payment->ID); ?></td> |
|
523 | + <td><?php echo date_i18n(give_date_format(), strtotime($payment->post_date)); ?></td> |
|
524 | + <td><?php echo give_get_payment_status($payment, true); ?></td> |
|
525 | 525 | <td> |
526 | 526 | <?php |
527 | 527 | printf( |
528 | 528 | '<a href="%1$s" aria-label="%2$s">%3$s</a>', |
529 | - admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id=' . $payment->ID ), |
|
529 | + admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id='.$payment->ID), |
|
530 | 530 | sprintf( |
531 | 531 | /* translators: %s: Donation ID */ |
532 | - esc_attr__( 'View Donation %s.', 'give' ), |
|
532 | + esc_attr__('View Donation %s.', 'give'), |
|
533 | 533 | $payment->ID |
534 | 534 | ), |
535 | - esc_html__( 'View Donation', 'give' ) |
|
535 | + esc_html__('View Donation', 'give') |
|
536 | 536 | ); |
537 | 537 | ?> |
538 | 538 | |
@@ -547,47 +547,47 @@ discard block |
||
547 | 547 | * @param object $donor The donor object being displayed. |
548 | 548 | * @param object $payment The payment object being displayed. |
549 | 549 | */ |
550 | - do_action( 'give_donor_recent_purchases_actions', $donor, $payment ); |
|
550 | + do_action('give_donor_recent_purchases_actions', $donor, $payment); |
|
551 | 551 | ?> |
552 | 552 | </td> |
553 | 553 | </tr> |
554 | 554 | <?php endforeach; ?> |
555 | 555 | <?php } else { ?> |
556 | 556 | <tr> |
557 | - <td colspan="5"><?php esc_html_e( 'No donations found.', 'give' ); ?></td> |
|
557 | + <td colspan="5"><?php esc_html_e('No donations found.', 'give'); ?></td> |
|
558 | 558 | </tr> |
559 | 559 | <?php }// End if(). |
560 | 560 | ?> |
561 | 561 | </tbody> |
562 | 562 | </table> |
563 | 563 | |
564 | - <h3><?php esc_html_e( 'Completed Forms', 'give' ); ?></h3> |
|
564 | + <h3><?php esc_html_e('Completed Forms', 'give'); ?></h3> |
|
565 | 565 | <?php |
566 | - $donations = give_get_users_completed_donations( $donor->email ); |
|
566 | + $donations = give_get_users_completed_donations($donor->email); |
|
567 | 567 | ?> |
568 | 568 | <table class="wp-list-table widefat striped donations"> |
569 | 569 | <thead> |
570 | 570 | <tr> |
571 | - <th scope="col"><?php esc_html_e( 'Form', 'give' ); ?></th> |
|
572 | - <th scope="col" width="120px"><?php esc_html_e( 'Actions', 'give' ); ?></th> |
|
571 | + <th scope="col"><?php esc_html_e('Form', 'give'); ?></th> |
|
572 | + <th scope="col" width="120px"><?php esc_html_e('Actions', 'give'); ?></th> |
|
573 | 573 | </tr> |
574 | 574 | </thead> |
575 | 575 | <tbody> |
576 | - <?php if ( ! empty( $donations ) ) { ?> |
|
577 | - <?php foreach ( $donations as $donation ) : ?> |
|
576 | + <?php if ( ! empty($donations)) { ?> |
|
577 | + <?php foreach ($donations as $donation) : ?> |
|
578 | 578 | <tr> |
579 | 579 | <td><?php echo $donation->post_title; ?></td> |
580 | 580 | <td> |
581 | 581 | <?php |
582 | 582 | printf( |
583 | 583 | '<a href="%1$s" aria-label="%2$s">%3$s</a>', |
584 | - esc_url( admin_url( 'post.php?action=edit&post=' . $donation->ID ) ), |
|
584 | + esc_url(admin_url('post.php?action=edit&post='.$donation->ID)), |
|
585 | 585 | sprintf( |
586 | 586 | /* translators: %s: form name */ |
587 | - esc_attr__( 'View Form %s.', 'give' ), |
|
587 | + esc_attr__('View Form %s.', 'give'), |
|
588 | 588 | $donation->post_title |
589 | 589 | ), |
590 | - esc_html__( 'View Form', 'give' ) |
|
590 | + esc_html__('View Form', 'give') |
|
591 | 591 | ); |
592 | 592 | ?> |
593 | 593 | </td> |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | <?php endforeach; ?> |
596 | 596 | <?php } else { ?> |
597 | 597 | <tr> |
598 | - <td colspan="2"><?php esc_html_e( 'No completed donations found.', 'give' ); ?></td> |
|
598 | + <td colspan="2"><?php esc_html_e('No completed donations found.', 'give'); ?></td> |
|
599 | 599 | </tr> |
600 | 600 | <?php } ?> |
601 | 601 | </tbody> |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | * |
610 | 610 | * @param object $donor The donor object being displayed. |
611 | 611 | */ |
612 | - do_action( 'give_donor_after_tables', $donor ); |
|
612 | + do_action('give_donor_after_tables', $donor); |
|
613 | 613 | ?> |
614 | 614 | |
615 | 615 | </div> |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | * |
623 | 623 | * @param object $donor The donor object being displayed. |
624 | 624 | */ |
625 | - do_action( 'give_donor_card_bottom', $donor ); |
|
625 | + do_action('give_donor_card_bottom', $donor); |
|
626 | 626 | |
627 | 627 | } |
628 | 628 | |
@@ -635,30 +635,30 @@ discard block |
||
635 | 635 | * |
636 | 636 | * @return void |
637 | 637 | */ |
638 | -function give_donor_notes_view( $donor ) { |
|
638 | +function give_donor_notes_view($donor) { |
|
639 | 639 | |
640 | - $paged = isset( $_GET['paged'] ) && is_numeric( $_GET['paged'] ) ? $_GET['paged'] : 1; |
|
641 | - $paged = absint( $paged ); |
|
640 | + $paged = isset($_GET['paged']) && is_numeric($_GET['paged']) ? $_GET['paged'] : 1; |
|
641 | + $paged = absint($paged); |
|
642 | 642 | $note_count = $donor->get_notes_count(); |
643 | - $per_page = apply_filters( 'give_donor_notes_per_page', 20 ); |
|
644 | - $total_pages = ceil( $note_count / $per_page ); |
|
645 | - $donor_notes = $donor->get_notes( $per_page, $paged ); |
|
643 | + $per_page = apply_filters('give_donor_notes_per_page', 20); |
|
644 | + $total_pages = ceil($note_count / $per_page); |
|
645 | + $donor_notes = $donor->get_notes($per_page, $paged); |
|
646 | 646 | ?> |
647 | 647 | |
648 | 648 | <div id="donor-notes-wrapper"> |
649 | 649 | <div class="donor-notes-header"> |
650 | - <?php echo get_avatar( $donor->email, 30 ); ?> <span><?php echo $donor->name; ?></span> |
|
650 | + <?php echo get_avatar($donor->email, 30); ?> <span><?php echo $donor->name; ?></span> |
|
651 | 651 | </div> |
652 | - <h3><?php esc_html_e( 'Notes', 'give' ); ?></h3> |
|
652 | + <h3><?php esc_html_e('Notes', 'give'); ?></h3> |
|
653 | 653 | |
654 | - <?php if ( 1 == $paged ) : ?> |
|
654 | + <?php if (1 == $paged) : ?> |
|
655 | 655 | <div style="display: block; margin-bottom: 55px;"> |
656 | - <form id="give-add-donor-note" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=notes&id=' . $donor->id ); ?>"> |
|
656 | + <form id="give-add-donor-note" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=notes&id='.$donor->id); ?>"> |
|
657 | 657 | <textarea id="donor-note" name="donor_note" class="donor-note-input" rows="10"></textarea> |
658 | 658 | <br /> |
659 | 659 | <input type="hidden" id="donor-id" name="customer_id" value="<?php echo $donor->id; ?>" /> |
660 | 660 | <input type="hidden" name="give_action" value="add-donor-note" /> |
661 | - <?php wp_nonce_field( 'add-donor-note', 'add_donor_note_nonce', true, true ); ?> |
|
661 | + <?php wp_nonce_field('add-donor-note', 'add_donor_note_nonce', true, true); ?> |
|
662 | 662 | <input id="add-donor-note" class="right button-primary" type="submit" value="Add Note" /> |
663 | 663 | </form> |
664 | 664 | </div> |
@@ -673,26 +673,26 @@ discard block |
||
673 | 673 | 'show_all' => true, |
674 | 674 | ); |
675 | 675 | |
676 | - echo paginate_links( $pagination_args ); |
|
676 | + echo paginate_links($pagination_args); |
|
677 | 677 | ?> |
678 | 678 | |
679 | 679 | <div id="give-donor-notes" class="postbox"> |
680 | - <?php if ( count( $donor_notes ) > 0 ) { ?> |
|
681 | - <?php foreach ( $donor_notes as $key => $note ) : ?> |
|
680 | + <?php if (count($donor_notes) > 0) { ?> |
|
681 | + <?php foreach ($donor_notes as $key => $note) : ?> |
|
682 | 682 | <div class="donor-note-wrapper dashboard-comment-wrap comment-item"> |
683 | 683 | <span class="note-content-wrap"> |
684 | - <?php echo stripslashes( $note ); ?> |
|
684 | + <?php echo stripslashes($note); ?> |
|
685 | 685 | </span> |
686 | 686 | </div> |
687 | 687 | <?php endforeach; ?> |
688 | 688 | <?php } else { ?> |
689 | 689 | <div class="give-no-donor-notes"> |
690 | - <?php esc_html_e( 'No donor notes found.', 'give' ); ?> |
|
690 | + <?php esc_html_e('No donor notes found.', 'give'); ?> |
|
691 | 691 | </div> |
692 | 692 | <?php } ?> |
693 | 693 | </div> |
694 | 694 | |
695 | - <?php echo paginate_links( $pagination_args ); ?> |
|
695 | + <?php echo paginate_links($pagination_args); ?> |
|
696 | 696 | |
697 | 697 | </div> |
698 | 698 | |
@@ -708,9 +708,9 @@ discard block |
||
708 | 708 | * |
709 | 709 | * @return void |
710 | 710 | */ |
711 | -function give_donor_delete_view( $donor ) { |
|
711 | +function give_donor_delete_view($donor) { |
|
712 | 712 | |
713 | - $donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' ); |
|
713 | + $donor_edit_role = apply_filters('give_edit_donors_role', 'edit_give_payments'); |
|
714 | 714 | |
715 | 715 | /** |
716 | 716 | * Fires in donor delete screen, above the content. |
@@ -719,15 +719,15 @@ discard block |
||
719 | 719 | * |
720 | 720 | * @param object $donor The donor object being displayed. |
721 | 721 | */ |
722 | - do_action( 'give_donor_delete_top', $donor ); |
|
722 | + do_action('give_donor_delete_top', $donor); |
|
723 | 723 | ?> |
724 | 724 | |
725 | 725 | <div class="info-wrapper donor-section"> |
726 | 726 | |
727 | - <form id="delete-donor" method="post" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=delete&id=' . $donor->id ); ?>"> |
|
727 | + <form id="delete-donor" method="post" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=delete&id='.$donor->id); ?>"> |
|
728 | 728 | |
729 | 729 | <div class="donor-notes-header"> |
730 | - <?php echo get_avatar( $donor->email, 30 ); ?> <span><?php echo $donor->name; ?></span> |
|
730 | + <?php echo get_avatar($donor->email, 30); ?> <span><?php echo $donor->name; ?></span> |
|
731 | 731 | </div> |
732 | 732 | |
733 | 733 | |
@@ -735,20 +735,20 @@ discard block |
||
735 | 735 | |
736 | 736 | <span class="delete-donor-options"> |
737 | 737 | <p> |
738 | - <?php echo Give()->html->checkbox( array( |
|
738 | + <?php echo Give()->html->checkbox(array( |
|
739 | 739 | 'name' => 'give-donor-delete-confirm', |
740 | - ) ); ?> |
|
741 | - <label for="give-donor-delete-confirm"><?php esc_html_e( 'Are you sure you want to delete this donor?', 'give' ); ?></label> |
|
740 | + )); ?> |
|
741 | + <label for="give-donor-delete-confirm"><?php esc_html_e('Are you sure you want to delete this donor?', 'give'); ?></label> |
|
742 | 742 | </p> |
743 | 743 | |
744 | 744 | <p> |
745 | - <?php echo Give()->html->checkbox( array( |
|
745 | + <?php echo Give()->html->checkbox(array( |
|
746 | 746 | 'name' => 'give-donor-delete-records', |
747 | 747 | 'options' => array( |
748 | 748 | 'disabled' => true, |
749 | 749 | ), |
750 | - ) ); ?> |
|
751 | - <label for="give-donor-delete-records"><?php esc_html_e( 'Delete all associated donations and records?', 'give' ); ?></label> |
|
750 | + )); ?> |
|
751 | + <label for="give-donor-delete-records"><?php esc_html_e('Delete all associated donations and records?', 'give'); ?></label> |
|
752 | 752 | </p> |
753 | 753 | |
754 | 754 | <?php |
@@ -761,16 +761,16 @@ discard block |
||
761 | 761 | * |
762 | 762 | * @param object $donor The donor object being displayed. |
763 | 763 | */ |
764 | - do_action( 'give_donor_delete_inputs', $donor ); |
|
764 | + do_action('give_donor_delete_inputs', $donor); |
|
765 | 765 | ?> |
766 | 766 | </span> |
767 | 767 | |
768 | 768 | <span id="donor-edit-actions"> |
769 | 769 | <input type="hidden" name="customer_id" value="<?php echo $donor->id; ?>" /> |
770 | - <?php wp_nonce_field( 'delete-donor', '_wpnonce', false, true ); ?> |
|
770 | + <?php wp_nonce_field('delete-donor', '_wpnonce', false, true); ?> |
|
771 | 771 | <input type="hidden" name="give_action" value="delete-donor" /> |
772 | - <input type="submit" disabled="disabled" id="give-delete-donor" class="button-primary" value="<?php esc_attr_e( 'Delete Donor', 'give' ); ?>" /> |
|
773 | - <a id="give-delete-donor-cancel" href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ); ?>" class="delete"><?php esc_html_e( 'Cancel', 'give' ); ?></a> |
|
772 | + <input type="submit" disabled="disabled" id="give-delete-donor" class="button-primary" value="<?php esc_attr_e('Delete Donor', 'give'); ?>" /> |
|
773 | + <a id="give-delete-donor-cancel" href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id); ?>" class="delete"><?php esc_html_e('Cancel', 'give'); ?></a> |
|
774 | 774 | </span> |
775 | 775 | |
776 | 776 | </div> |
@@ -786,5 +786,5 @@ discard block |
||
786 | 786 | * |
787 | 787 | * @param object $donor The donor object being displayed. |
788 | 788 | */ |
789 | - do_action( 'give_donor_delete_bottom', $donor ); |
|
789 | + do_action('give_donor_delete_bottom', $donor); |
|
790 | 790 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly. |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -27,34 +27,34 @@ discard block |
||
27 | 27 | * @return array $form_columns Updated array of forms columns |
28 | 28 | * Post Type List Table |
29 | 29 | */ |
30 | -function give_form_columns( $give_form_columns ) { |
|
30 | +function give_form_columns($give_form_columns) { |
|
31 | 31 | |
32 | 32 | // Standard columns |
33 | 33 | $give_form_columns = array( |
34 | 34 | 'cb' => '<input type="checkbox"/>', |
35 | - 'title' => __( 'Name', 'give' ), |
|
36 | - 'form_category' => __( 'Categories', 'give' ), |
|
37 | - 'form_tag' => __( 'Tags', 'give' ), |
|
38 | - 'price' => __( 'Amount', 'give' ), |
|
39 | - 'goal' => __( 'Goal', 'give' ), |
|
40 | - 'donations' => __( 'Donations', 'give' ), |
|
41 | - 'earnings' => __( 'Income', 'give' ), |
|
42 | - 'shortcode' => __( 'Shortcode', 'give' ), |
|
43 | - 'date' => __( 'Date', 'give' ), |
|
35 | + 'title' => __('Name', 'give'), |
|
36 | + 'form_category' => __('Categories', 'give'), |
|
37 | + 'form_tag' => __('Tags', 'give'), |
|
38 | + 'price' => __('Amount', 'give'), |
|
39 | + 'goal' => __('Goal', 'give'), |
|
40 | + 'donations' => __('Donations', 'give'), |
|
41 | + 'earnings' => __('Income', 'give'), |
|
42 | + 'shortcode' => __('Shortcode', 'give'), |
|
43 | + 'date' => __('Date', 'give'), |
|
44 | 44 | ); |
45 | 45 | |
46 | 46 | // Does the user want categories / tags? |
47 | - if ( ! give_is_setting_enabled( give_get_option( 'categories', 'disabled' ) ) ) { |
|
48 | - unset( $give_form_columns['form_category'] ); |
|
47 | + if ( ! give_is_setting_enabled(give_get_option('categories', 'disabled'))) { |
|
48 | + unset($give_form_columns['form_category']); |
|
49 | 49 | } |
50 | - if ( ! give_is_setting_enabled( give_get_option( 'tags', 'disabled' ) ) ) { |
|
51 | - unset( $give_form_columns['form_tag'] ); |
|
50 | + if ( ! give_is_setting_enabled(give_get_option('tags', 'disabled'))) { |
|
51 | + unset($give_form_columns['form_tag']); |
|
52 | 52 | } |
53 | 53 | |
54 | - return apply_filters( 'give_forms_columns', $give_form_columns ); |
|
54 | + return apply_filters('give_forms_columns', $give_form_columns); |
|
55 | 55 | } |
56 | 56 | |
57 | -add_filter( 'manage_edit-give_forms_columns', 'give_form_columns' ); |
|
57 | +add_filter('manage_edit-give_forms_columns', 'give_form_columns'); |
|
58 | 58 | |
59 | 59 | /** |
60 | 60 | * Render Give Form Columns |
@@ -66,59 +66,59 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @return void |
68 | 68 | */ |
69 | -function give_render_form_columns( $column_name, $post_id ) { |
|
70 | - if ( get_post_type( $post_id ) == 'give_forms' ) { |
|
69 | +function give_render_form_columns($column_name, $post_id) { |
|
70 | + if (get_post_type($post_id) == 'give_forms') { |
|
71 | 71 | |
72 | - switch ( $column_name ) { |
|
72 | + switch ($column_name) { |
|
73 | 73 | case 'form_category': |
74 | - echo get_the_term_list( $post_id, 'give_forms_category', '', ', ', '' ); |
|
74 | + echo get_the_term_list($post_id, 'give_forms_category', '', ', ', ''); |
|
75 | 75 | break; |
76 | 76 | case 'form_tag': |
77 | - echo get_the_term_list( $post_id, 'give_forms_tag', '', ', ', '' ); |
|
77 | + echo get_the_term_list($post_id, 'give_forms_tag', '', ', ', ''); |
|
78 | 78 | break; |
79 | 79 | case 'price': |
80 | - if ( give_has_variable_prices( $post_id ) ) { |
|
81 | - echo give_price_range( $post_id ); |
|
80 | + if (give_has_variable_prices($post_id)) { |
|
81 | + echo give_price_range($post_id); |
|
82 | 82 | } else { |
83 | - echo give_price( $post_id, false ); |
|
84 | - echo '<input type="hidden" class="formprice-' . $post_id . '" value="' . give_get_form_price( $post_id ) . '" />'; |
|
83 | + echo give_price($post_id, false); |
|
84 | + echo '<input type="hidden" class="formprice-'.$post_id.'" value="'.give_get_form_price($post_id).'" />'; |
|
85 | 85 | } |
86 | 86 | break; |
87 | 87 | case 'goal': |
88 | - if ( give_is_setting_enabled( give_get_meta( $post_id, '_give_goal_option', true ) ) ) { |
|
89 | - echo give_goal( $post_id, false ); |
|
88 | + if (give_is_setting_enabled(give_get_meta($post_id, '_give_goal_option', true))) { |
|
89 | + echo give_goal($post_id, false); |
|
90 | 90 | } else { |
91 | - esc_html_e( 'No Goal Set', 'give' ); |
|
91 | + esc_html_e('No Goal Set', 'give'); |
|
92 | 92 | } |
93 | 93 | |
94 | - echo '<input type="hidden" class="formgoal-' . $post_id . '" value="' . give_get_form_goal( $post_id ) . '" />'; |
|
94 | + echo '<input type="hidden" class="formgoal-'.$post_id.'" value="'.give_get_form_goal($post_id).'" />'; |
|
95 | 95 | break; |
96 | 96 | case 'donations': |
97 | - if ( current_user_can( 'view_give_form_stats', $post_id ) ) { |
|
98 | - echo '<a href="' . esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&form_id=' . $post_id ) ) . '">'; |
|
99 | - echo give_get_form_sales_stats( $post_id ); |
|
97 | + if (current_user_can('view_give_form_stats', $post_id)) { |
|
98 | + echo '<a href="'.esc_url(admin_url('edit.php?post_type=give_forms&page=give-payment-history&form_id='.$post_id)).'">'; |
|
99 | + echo give_get_form_sales_stats($post_id); |
|
100 | 100 | echo '</a>'; |
101 | 101 | } else { |
102 | 102 | echo '-'; |
103 | 103 | } |
104 | 104 | break; |
105 | 105 | case 'earnings': |
106 | - if ( current_user_can( 'view_give_form_stats', $post_id ) ) { |
|
107 | - echo '<a href="' . esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-reports&tab=forms&form-id=' . $post_id ) ) . '">'; |
|
108 | - echo give_currency_filter( give_format_amount( give_get_form_earnings_stats( $post_id ), array( 'sanitize' => false ) ) ); |
|
106 | + if (current_user_can('view_give_form_stats', $post_id)) { |
|
107 | + echo '<a href="'.esc_url(admin_url('edit.php?post_type=give_forms&page=give-reports&tab=forms&form-id='.$post_id)).'">'; |
|
108 | + echo give_currency_filter(give_format_amount(give_get_form_earnings_stats($post_id), array('sanitize' => false))); |
|
109 | 109 | echo '</a>'; |
110 | 110 | } else { |
111 | 111 | echo '-'; |
112 | 112 | } |
113 | 113 | break; |
114 | 114 | case 'shortcode': |
115 | - echo '<input onclick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly="" value="[give_form id="' . absint( $post_id ) . '"]">'; |
|
115 | + echo '<input onclick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly="" value="[give_form id="'.absint($post_id).'"]">'; |
|
116 | 116 | break; |
117 | 117 | }// End switch(). |
118 | 118 | }// End if(). |
119 | 119 | } |
120 | 120 | |
121 | -add_action( 'manage_posts_custom_column', 'give_render_form_columns', 10, 2 ); |
|
121 | +add_action('manage_posts_custom_column', 'give_render_form_columns', 10, 2); |
|
122 | 122 | |
123 | 123 | /** |
124 | 124 | * Registers the sortable columns in the list table |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | * |
130 | 130 | * @return array $columns Array of sortable columns |
131 | 131 | */ |
132 | -function give_sortable_form_columns( $columns ) { |
|
132 | +function give_sortable_form_columns($columns) { |
|
133 | 133 | $columns['price'] = 'amount'; |
134 | 134 | $columns['sales'] = 'sales'; |
135 | 135 | $columns['earnings'] = 'earnings'; |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | return $columns; |
140 | 140 | } |
141 | 141 | |
142 | -add_filter( 'manage_edit-give_forms_sortable_columns', 'give_sortable_form_columns' ); |
|
142 | +add_filter('manage_edit-give_forms_sortable_columns', 'give_sortable_form_columns'); |
|
143 | 143 | |
144 | 144 | /** |
145 | 145 | * Sorts Columns in the Forms List Table |
@@ -150,13 +150,13 @@ discard block |
||
150 | 150 | * |
151 | 151 | * @return array $vars Array of all the sort variables. |
152 | 152 | */ |
153 | -function give_sort_forms( $vars ) { |
|
153 | +function give_sort_forms($vars) { |
|
154 | 154 | // Check if we're viewing the "give_forms" post type. |
155 | - if ( ! isset( $vars['post_type'] ) || ! isset( $vars['orderby'] ) || 'give_forms' !== $vars['post_type'] ) { |
|
155 | + if ( ! isset($vars['post_type']) || ! isset($vars['orderby']) || 'give_forms' !== $vars['post_type']) { |
|
156 | 156 | return $vars; |
157 | 157 | } |
158 | 158 | |
159 | - switch ( $vars['orderby'] ) { |
|
159 | + switch ($vars['orderby']) { |
|
160 | 160 | // Check if 'orderby' is set to "sales". |
161 | 161 | case 'sales': |
162 | 162 | $vars = array_merge( |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | |
182 | 182 | // Check if "orderby" is set to "price/amount". |
183 | 183 | case 'amount': |
184 | - $multi_level_meta_key = ( 'asc' === $vars['order'] ) ? '_give_levels_minimum_amount' : '_give_levels_maximum_amount'; |
|
184 | + $multi_level_meta_key = ('asc' === $vars['order']) ? '_give_levels_minimum_amount' : '_give_levels_maximum_amount'; |
|
185 | 185 | |
186 | 186 | $vars['orderby'] = 'meta_value_num'; |
187 | 187 | $vars['meta_query'] = array( |
@@ -233,17 +233,17 @@ discard block |
||
233 | 233 | * |
234 | 234 | * @return array Array of all sort variables. |
235 | 235 | */ |
236 | -function give_filter_forms( $vars ) { |
|
237 | - if ( isset( $vars['post_type'] ) && 'give_forms' == $vars['post_type'] ) { |
|
236 | +function give_filter_forms($vars) { |
|
237 | + if (isset($vars['post_type']) && 'give_forms' == $vars['post_type']) { |
|
238 | 238 | |
239 | 239 | // If an author ID was passed, use it |
240 | - if ( isset( $_REQUEST['author'] ) && ! current_user_can( 'view_give_reports' ) ) { |
|
240 | + if (isset($_REQUEST['author']) && ! current_user_can('view_give_reports')) { |
|
241 | 241 | |
242 | 242 | $author_id = $_REQUEST['author']; |
243 | - if ( (int) $author_id !== get_current_user_id() ) { |
|
244 | - wp_die( esc_html__( 'You do not have permission to view this data.', 'give' ), esc_html__( 'Error', 'give' ), array( |
|
243 | + if ((int) $author_id !== get_current_user_id()) { |
|
244 | + wp_die(esc_html__('You do not have permission to view this data.', 'give'), esc_html__('Error', 'give'), array( |
|
245 | 245 | 'response' => 403, |
246 | - ) ); |
|
246 | + )); |
|
247 | 247 | } |
248 | 248 | $vars = array_merge( |
249 | 249 | $vars, |
@@ -267,11 +267,11 @@ discard block |
||
267 | 267 | * @return void |
268 | 268 | */ |
269 | 269 | function give_forms_load() { |
270 | - add_filter( 'request', 'give_sort_forms' ); |
|
271 | - add_filter( 'request', 'give_filter_forms' ); |
|
270 | + add_filter('request', 'give_sort_forms'); |
|
271 | + add_filter('request', 'give_filter_forms'); |
|
272 | 272 | } |
273 | 273 | |
274 | -add_action( 'load-edit.php', 'give_forms_load', 9999 ); |
|
274 | +add_action('load-edit.php', 'give_forms_load', 9999); |
|
275 | 275 | |
276 | 276 | /** |
277 | 277 | * Remove Forms Month Filter |
@@ -285,17 +285,17 @@ discard block |
||
285 | 285 | * @global $typenow The post type we are viewing. |
286 | 286 | * @return array Empty array disables the dropdown. |
287 | 287 | */ |
288 | -function give_remove_month_filter( $dates ) { |
|
288 | +function give_remove_month_filter($dates) { |
|
289 | 289 | global $typenow; |
290 | 290 | |
291 | - if ( $typenow == 'give_forms' ) { |
|
291 | + if ($typenow == 'give_forms') { |
|
292 | 292 | $dates = array(); |
293 | 293 | } |
294 | 294 | |
295 | 295 | return $dates; |
296 | 296 | } |
297 | 297 | |
298 | -add_filter( 'months_dropdown_results', 'give_remove_month_filter', 99 ); |
|
298 | +add_filter('months_dropdown_results', 'give_remove_month_filter', 99); |
|
299 | 299 | |
300 | 300 | /** |
301 | 301 | * Updates price when saving post |
@@ -306,23 +306,23 @@ discard block |
||
306 | 306 | * |
307 | 307 | * @return int|null |
308 | 308 | */ |
309 | -function give_price_save_quick_edit( $post_id ) { |
|
310 | - if ( ! isset( $_POST['post_type'] ) || 'give_forms' !== $_POST['post_type'] ) { |
|
309 | +function give_price_save_quick_edit($post_id) { |
|
310 | + if ( ! isset($_POST['post_type']) || 'give_forms' !== $_POST['post_type']) { |
|
311 | 311 | return; |
312 | 312 | } |
313 | - if ( ! current_user_can( 'edit_post', $post_id ) ) { |
|
313 | + if ( ! current_user_can('edit_post', $post_id)) { |
|
314 | 314 | return $post_id; |
315 | 315 | } |
316 | - if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { |
|
316 | + if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { |
|
317 | 317 | return $post_id; |
318 | 318 | } |
319 | 319 | |
320 | - if ( isset( $_REQUEST['_give_regprice'] ) ) { |
|
321 | - give_update_meta( $post_id, '_give_set_price', give_sanitize_amount_for_db( strip_tags( stripslashes( $_REQUEST['_give_regprice'] ) ) ) ); |
|
320 | + if (isset($_REQUEST['_give_regprice'])) { |
|
321 | + give_update_meta($post_id, '_give_set_price', give_sanitize_amount_for_db(strip_tags(stripslashes($_REQUEST['_give_regprice'])))); |
|
322 | 322 | } |
323 | 323 | } |
324 | 324 | |
325 | -add_action( 'save_post', 'give_price_save_quick_edit' ); |
|
325 | +add_action('save_post', 'give_price_save_quick_edit'); |
|
326 | 326 | |
327 | 327 | /** |
328 | 328 | * Process bulk edit actions via AJAX |
@@ -332,18 +332,18 @@ discard block |
||
332 | 332 | */ |
333 | 333 | function give_save_bulk_edit() { |
334 | 334 | |
335 | - $post_ids = ( isset( $_POST['post_ids'] ) && ! empty( $_POST['post_ids'] ) ) ? $_POST['post_ids'] : array(); |
|
335 | + $post_ids = (isset($_POST['post_ids']) && ! empty($_POST['post_ids'])) ? $_POST['post_ids'] : array(); |
|
336 | 336 | |
337 | - if ( ! empty( $post_ids ) && is_array( $post_ids ) ) { |
|
338 | - $price = isset( $_POST['price'] ) ? strip_tags( stripslashes( $_POST['price'] ) ) : 0; |
|
339 | - foreach ( $post_ids as $post_id ) { |
|
337 | + if ( ! empty($post_ids) && is_array($post_ids)) { |
|
338 | + $price = isset($_POST['price']) ? strip_tags(stripslashes($_POST['price'])) : 0; |
|
339 | + foreach ($post_ids as $post_id) { |
|
340 | 340 | |
341 | - if ( ! current_user_can( 'edit_post', $post_id ) ) { |
|
341 | + if ( ! current_user_can('edit_post', $post_id)) { |
|
342 | 342 | continue; |
343 | 343 | } |
344 | 344 | |
345 | - if ( ! empty( $price ) ) { |
|
346 | - give_update_meta( $post_id, '_give_set_price', give_sanitize_amount_for_db( $price ) ); |
|
345 | + if ( ! empty($price)) { |
|
346 | + give_update_meta($post_id, '_give_set_price', give_sanitize_amount_for_db($price)); |
|
347 | 347 | } |
348 | 348 | } |
349 | 349 | } |
@@ -351,4 +351,4 @@ discard block |
||
351 | 351 | die(); |
352 | 352 | } |
353 | 353 | |
354 | -add_action( 'wp_ajax_give_save_bulk_edit', 'give_save_bulk_edit' ); |
|
354 | +add_action('wp_ajax_give_save_bulk_edit', 'give_save_bulk_edit'); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly. |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | * @return void |
22 | 22 | */ |
23 | 23 | function give_register_dashboard_widgets() { |
24 | - if ( current_user_can( apply_filters( 'give_dashboard_stats_cap', 'view_give_reports' ) ) ) { |
|
25 | - wp_add_dashboard_widget( 'give_dashboard_sales', esc_html__( 'Give: Donation Statistics', 'give' ), 'give_dashboard_sales_widget' ); |
|
24 | + if (current_user_can(apply_filters('give_dashboard_stats_cap', 'view_give_reports'))) { |
|
25 | + wp_add_dashboard_widget('give_dashboard_sales', esc_html__('Give: Donation Statistics', 'give'), 'give_dashboard_sales_widget'); |
|
26 | 26 | } |
27 | 27 | } |
28 | 28 | |
29 | -add_action( 'wp_dashboard_setup', 'give_register_dashboard_widgets', 10 ); |
|
29 | +add_action('wp_dashboard_setup', 'give_register_dashboard_widgets', 10); |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Sales Summary Dashboard Widget |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | function give_dashboard_sales_widget() { |
40 | 40 | |
41 | - if ( ! current_user_can( apply_filters( 'give_dashboard_stats_cap', 'view_give_reports' ) ) ) { |
|
41 | + if ( ! current_user_can(apply_filters('give_dashboard_stats_cap', 'view_give_reports'))) { |
|
42 | 42 | return; |
43 | 43 | } |
44 | 44 | $stats = new Give_Payment_Stats; ?> |
@@ -46,27 +46,27 @@ discard block |
||
46 | 46 | <div class="give-dashboard-widget"> |
47 | 47 | |
48 | 48 | <div class="give-dashboard-today give-clearfix"> |
49 | - <h3 class="give-dashboard-date-today"><?php echo date( _x( 'F j, Y', 'dashboard widget', 'give' ) ); ?></h3> |
|
49 | + <h3 class="give-dashboard-date-today"><?php echo date(_x('F j, Y', 'dashboard widget', 'give')); ?></h3> |
|
50 | 50 | |
51 | 51 | <p class="give-dashboard-happy-day"><?php |
52 | 52 | printf( |
53 | 53 | /* translators: %s: day of the week */ |
54 | - esc_html__( 'Happy %s!', 'give' ), |
|
55 | - date( 'l', current_time( 'timestamp' ) ) |
|
54 | + esc_html__('Happy %s!', 'give'), |
|
55 | + date('l', current_time('timestamp')) |
|
56 | 56 | ); |
57 | 57 | ?></p> |
58 | 58 | |
59 | 59 | <p class="give-dashboard-today-earnings"><?php |
60 | - $earnings_today = $stats->get_earnings( 0, 'today', false ); |
|
61 | - echo give_currency_filter( give_format_amount( $earnings_today, array( 'sanitize' => false ) ) ); |
|
60 | + $earnings_today = $stats->get_earnings(0, 'today', false); |
|
61 | + echo give_currency_filter(give_format_amount($earnings_today, array('sanitize' => false))); |
|
62 | 62 | ?></p> |
63 | 63 | |
64 | 64 | <p class="give-orders-today"><?php |
65 | - $donations_today = $stats->get_sales( 0, 'today', false ); |
|
65 | + $donations_today = $stats->get_sales(0, 'today', false); |
|
66 | 66 | printf( |
67 | 67 | /* translators: %s: daily donation count */ |
68 | - esc_html__( '%s donations today', 'give' ), |
|
69 | - give_format_amount( $donations_today, array( 'decimal' => false, 'sanitize' => false ) ) |
|
68 | + esc_html__('%s donations today', 'give'), |
|
69 | + give_format_amount($donations_today, array('decimal' => false, 'sanitize' => false)) |
|
70 | 70 | ); |
71 | 71 | ?></p> |
72 | 72 | |
@@ -76,34 +76,34 @@ discard block |
||
76 | 76 | <table class="give-table-stats"> |
77 | 77 | <thead style="display: none;"> |
78 | 78 | <tr> |
79 | - <th><?php esc_html_e( 'This Week', 'give' ); ?></th> |
|
80 | - <th><?php esc_html_e( 'This Month', 'give' ); ?></th> |
|
81 | - <th><?php esc_html_e( 'Past 30 Days', 'give' ); ?></th> |
|
79 | + <th><?php esc_html_e('This Week', 'give'); ?></th> |
|
80 | + <th><?php esc_html_e('This Month', 'give'); ?></th> |
|
81 | + <th><?php esc_html_e('Past 30 Days', 'give'); ?></th> |
|
82 | 82 | </tr> |
83 | 83 | </thead> |
84 | 84 | <tbody> |
85 | 85 | <tr id="give-table-stats-tr-1"> |
86 | 86 | <td> |
87 | - <p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'this_week' ), array( 'sanitize' => false ) ) ); ?></p> |
|
87 | + <p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_week'), array('sanitize' => false))); ?></p> |
|
88 | 88 | |
89 | - <p class="give-dashboard-stat-total-label"><?php esc_html_e( 'This Week', 'give' ); ?></p> |
|
89 | + <p class="give-dashboard-stat-total-label"><?php esc_html_e('This Week', 'give'); ?></p> |
|
90 | 90 | </td> |
91 | 91 | <td> |
92 | - <p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'this_month' ), array( 'sanitize' => false ) ) ); ?></p> |
|
92 | + <p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_month'), array('sanitize' => false))); ?></p> |
|
93 | 93 | |
94 | - <p class="give-dashboard-stat-total-label"><?php esc_html_e( 'This Month', 'give' ); ?></p> |
|
94 | + <p class="give-dashboard-stat-total-label"><?php esc_html_e('This Month', 'give'); ?></p> |
|
95 | 95 | </td> |
96 | 96 | </tr> |
97 | 97 | <tr id="give-table-stats-tr-2"> |
98 | 98 | <td> |
99 | - <p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'last_month' ), array( 'sanitize' => false ) ) ) ?></p> |
|
99 | + <p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'last_month'), array('sanitize' => false))) ?></p> |
|
100 | 100 | |
101 | - <p class="give-dashboard-stat-total-label"><?php esc_html_e( 'Last Month', 'give' ); ?></p> |
|
101 | + <p class="give-dashboard-stat-total-label"><?php esc_html_e('Last Month', 'give'); ?></p> |
|
102 | 102 | </td> |
103 | 103 | <td> |
104 | - <p class="give-dashboard-stat-total"><?php echo give_currency_filter( give_format_amount( $stats->get_earnings( 0, 'this_year', false ), array( 'decimal' => false, 'sanitize' => false ) ) ) ?></p> |
|
104 | + <p class="give-dashboard-stat-total"><?php echo give_currency_filter(give_format_amount($stats->get_earnings(0, 'this_year', false), array('decimal' => false, 'sanitize' => false))) ?></p> |
|
105 | 105 | |
106 | - <p class="give-dashboard-stat-total-label"><?php esc_html_e( 'This Year', 'give' ); ?></p> |
|
106 | + <p class="give-dashboard-stat-total-label"><?php esc_html_e('This Year', 'give'); ?></p> |
|
107 | 107 | </td> |
108 | 108 | </tr> |
109 | 109 | </tbody> |
@@ -123,23 +123,23 @@ discard block |
||
123 | 123 | * |
124 | 124 | * @return array |
125 | 125 | */ |
126 | -function give_dashboard_at_a_glance_widget( $items ) { |
|
127 | - $num_posts = wp_count_posts( 'give_forms' ); |
|
126 | +function give_dashboard_at_a_glance_widget($items) { |
|
127 | + $num_posts = wp_count_posts('give_forms'); |
|
128 | 128 | |
129 | - if ( $num_posts && $num_posts->publish ) { |
|
129 | + if ($num_posts && $num_posts->publish) { |
|
130 | 130 | |
131 | 131 | $text = sprintf( |
132 | 132 | /* translators: %s: number of posts published */ |
133 | - _n( '%s Give Form', '%s Give Forms', $num_posts->publish, 'give' ), |
|
133 | + _n('%s Give Form', '%s Give Forms', $num_posts->publish, 'give'), |
|
134 | 134 | $num_posts->publish |
135 | 135 | ); |
136 | 136 | |
137 | - $text = sprintf( $text, number_format_i18n( $num_posts->publish ) ); |
|
137 | + $text = sprintf($text, number_format_i18n($num_posts->publish)); |
|
138 | 138 | |
139 | - if ( current_user_can( 'edit_give_forms', get_current_user_id() ) ) { |
|
139 | + if (current_user_can('edit_give_forms', get_current_user_id())) { |
|
140 | 140 | $text = sprintf( |
141 | 141 | '<a class="give-forms-count" href="%1$s">%2$s</a>', |
142 | - admin_url( 'edit.php?post_type=give_forms' ), |
|
142 | + admin_url('edit.php?post_type=give_forms'), |
|
143 | 143 | $text |
144 | 144 | ); |
145 | 145 | } else { |
@@ -155,4 +155,4 @@ discard block |
||
155 | 155 | return $items; |
156 | 156 | } |
157 | 157 | |
158 | -add_filter( 'dashboard_glance_items', 'give_dashboard_at_a_glance_widget', 1, 1 ); |
|
158 | +add_filter('dashboard_glance_items', 'give_dashboard_at_a_glance_widget', 1, 1); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly. |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -27,30 +27,30 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @return mixed |
29 | 29 | */ |
30 | -function __give_sanitize_number_decimals_setting_field( $value ) { |
|
30 | +function __give_sanitize_number_decimals_setting_field($value) { |
|
31 | 31 | $value_changed = false; |
32 | 32 | $old_value = $value; |
33 | 33 | |
34 | - if ( isset( $_POST['decimal_separator'] ) ) { |
|
35 | - $value = ! empty( $_POST['decimal_separator'] ) ? $value : 0; |
|
34 | + if (isset($_POST['decimal_separator'])) { |
|
35 | + $value = ! empty($_POST['decimal_separator']) ? $value : 0; |
|
36 | 36 | $value_changed = true; |
37 | 37 | } |
38 | 38 | |
39 | - if ( $value_changed && ( $old_value != $value ) ) { |
|
40 | - Give_Admin_Settings::add_error( 'give-number-decimal', __( 'The \'Number of Decimals\' option has been automatically set to zero because the \'Decimal Separator\' is not set.', 'give' ) ); |
|
39 | + if ($value_changed && ($old_value != $value)) { |
|
40 | + Give_Admin_Settings::add_error('give-number-decimal', __('The \'Number of Decimals\' option has been automatically set to zero because the \'Decimal Separator\' is not set.', 'give')); |
|
41 | 41 | } |
42 | 42 | |
43 | - $value = absint( $value ); |
|
43 | + $value = absint($value); |
|
44 | 44 | |
45 | - if( 6 <= $value ) { |
|
45 | + if (6 <= $value) { |
|
46 | 46 | $value = 5; |
47 | - Give_Admin_Settings::add_error( 'give-number-decimal', __( 'The \'Number of Decimals\' option has been automatically set to 5 because you entered a number higher than the maximum allowed.', 'give' ) ); |
|
47 | + Give_Admin_Settings::add_error('give-number-decimal', __('The \'Number of Decimals\' option has been automatically set to 5 because you entered a number higher than the maximum allowed.', 'give')); |
|
48 | 48 | } |
49 | 49 | |
50 | - return absint( $value ); |
|
50 | + return absint($value); |
|
51 | 51 | } |
52 | 52 | |
53 | -add_filter( 'give_admin_settings_sanitize_option_number_decimals', '__give_sanitize_number_decimals_setting_field', 10 ); |
|
53 | +add_filter('give_admin_settings_sanitize_option_number_decimals', '__give_sanitize_number_decimals_setting_field', 10); |
|
54 | 54 | |
55 | 55 | |
56 | 56 | /** |
@@ -66,17 +66,17 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @return mixed |
68 | 68 | */ |
69 | -function __give_validate_decimal_separator_setting_field( $value ) { |
|
70 | - $thousand_separator = give_clean( $_POST['thousands_separator'] ); |
|
71 | - $decimal_separator = give_clean( $_POST['decimal_separator'] ); |
|
69 | +function __give_validate_decimal_separator_setting_field($value) { |
|
70 | + $thousand_separator = give_clean($_POST['thousands_separator']); |
|
71 | + $decimal_separator = give_clean($_POST['decimal_separator']); |
|
72 | 72 | |
73 | - if ( $decimal_separator === $thousand_separator ) { |
|
73 | + if ($decimal_separator === $thousand_separator) { |
|
74 | 74 | $value = ''; |
75 | 75 | $_POST['number_decimals'] = 0; |
76 | - Give_Admin_Settings::add_error( 'give-decimal-separator', __( 'The \'Decimal Separator\' option has automatically been set to empty because it can not be equal to the \'Thousand Separator\'', 'give' ) ); |
|
76 | + Give_Admin_Settings::add_error('give-decimal-separator', __('The \'Decimal Separator\' option has automatically been set to empty because it can not be equal to the \'Thousand Separator\'', 'give')); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | return $value; |
80 | 80 | } |
81 | 81 | |
82 | -add_filter( 'give_admin_settings_sanitize_option_decimal_separator', '__give_validate_decimal_separator_setting_field', 10 ); |
|
83 | 82 | \ No newline at end of file |
83 | +add_filter('give_admin_settings_sanitize_option_decimal_separator', '__give_validate_decimal_separator_setting_field', 10); |
|
84 | 84 | \ No newline at end of file |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | */ |
10 | 10 | |
11 | 11 | // Exit if accessed directly. |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; |
14 | 14 | } |
15 | 15 | |
@@ -23,10 +23,10 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public function __construct() { |
25 | 25 | |
26 | - $this->shortcode['title'] = esc_html__( 'Donation Form Goal', 'give' ); |
|
27 | - $this->shortcode['label'] = esc_html__( 'Donation Form Goal', 'give' ); |
|
26 | + $this->shortcode['title'] = esc_html__('Donation Form Goal', 'give'); |
|
27 | + $this->shortcode['label'] = esc_html__('Donation Form Goal', 'give'); |
|
28 | 28 | |
29 | - parent::__construct( 'give_goal' ); |
|
29 | + parent::__construct('give_goal'); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | |
39 | 39 | $create_form_link = sprintf( |
40 | 40 | /* translators: %s: create new form URL */ |
41 | - __( '<a href="%s">Create</a> a new Donation Form.', 'give' ), |
|
42 | - admin_url( 'post-new.php?post_type=give_forms' ) |
|
41 | + __('<a href="%s">Create</a> a new Donation Form.', 'give'), |
|
42 | + admin_url('post-new.php?post_type=give_forms') |
|
43 | 43 | ); |
44 | 44 | |
45 | 45 | return array( |
@@ -51,35 +51,35 @@ discard block |
||
51 | 51 | 'meta_value' => 'enabled', |
52 | 52 | ), |
53 | 53 | 'name' => 'id', |
54 | - 'tooltip' => esc_attr__( 'Select a Donation Form', 'give' ), |
|
55 | - 'placeholder' => '- ' . esc_attr__( 'Select a Donation Form', 'give' ) . ' -', |
|
54 | + 'tooltip' => esc_attr__('Select a Donation Form', 'give'), |
|
55 | + 'placeholder' => '- '.esc_attr__('Select a Donation Form', 'give').' -', |
|
56 | 56 | 'required' => array( |
57 | - 'alert' => esc_html__( 'You must first select a Form!', 'give' ), |
|
58 | - 'error' => sprintf( '<p class="strong">%s</p><p class="no-margin">%s</p>', esc_html__( 'No forms found.', 'give' ), $create_form_link ), |
|
57 | + 'alert' => esc_html__('You must first select a Form!', 'give'), |
|
58 | + 'error' => sprintf('<p class="strong">%s</p><p class="no-margin">%s</p>', esc_html__('No forms found.', 'give'), $create_form_link), |
|
59 | 59 | ), |
60 | 60 | ), |
61 | 61 | array( |
62 | 62 | 'type' => 'container', |
63 | - 'html' => sprintf( '<p class="strong margin-top">%s</p>', esc_html__( 'Optional settings', 'give' ) ), |
|
63 | + 'html' => sprintf('<p class="strong margin-top">%s</p>', esc_html__('Optional settings', 'give')), |
|
64 | 64 | ), |
65 | 65 | array( |
66 | 66 | 'type' => 'listbox', |
67 | 67 | 'name' => 'show_text', |
68 | - 'label' => esc_attr__( 'Show Text:', 'give' ), |
|
69 | - 'tooltip' => esc_attr__( 'This text displays the amount of income raised compared to the goal.', 'give' ), |
|
68 | + 'label' => esc_attr__('Show Text:', 'give'), |
|
69 | + 'tooltip' => esc_attr__('This text displays the amount of income raised compared to the goal.', 'give'), |
|
70 | 70 | 'options' => array( |
71 | - 'true' => esc_html__( 'Show', 'give' ), |
|
72 | - 'false' => esc_html__( 'Hide', 'give' ), |
|
71 | + 'true' => esc_html__('Show', 'give'), |
|
72 | + 'false' => esc_html__('Hide', 'give'), |
|
73 | 73 | ), |
74 | 74 | ), |
75 | 75 | array( |
76 | 76 | 'type' => 'listbox', |
77 | 77 | 'name' => 'show_bar', |
78 | - 'label' => esc_attr__( 'Show Progress Bar:', 'give' ), |
|
79 | - 'tooltip' => esc_attr__( 'Do you want to display the goal\'s progress bar?', 'give' ), |
|
78 | + 'label' => esc_attr__('Show Progress Bar:', 'give'), |
|
79 | + 'tooltip' => esc_attr__('Do you want to display the goal\'s progress bar?', 'give'), |
|
80 | 80 | 'options' => array( |
81 | - 'true' => esc_html__( 'Show', 'give' ), |
|
82 | - 'false' => esc_html__( 'Hide', 'give' ), |
|
81 | + 'true' => esc_html__('Show', 'give'), |
|
82 | + 'false' => esc_html__('Hide', 'give'), |
|
83 | 83 | ), |
84 | 84 | ), |
85 | 85 | ); |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | /** |
3 | 3 | * This template is used to display the registration form with [give_register] |
4 | 4 | */ |
5 | -Give()->notices->render_frontend_notices( 0 ); ?> |
|
5 | +Give()->notices->render_frontend_notices(0); ?> |
|
6 | 6 | |
7 | 7 | <form id="give-register-form" class="give-form" action="" method="post"> |
8 | 8 | <?php |
@@ -13,11 +13,11 @@ discard block |
||
13 | 13 | * |
14 | 14 | * @since 1.0 |
15 | 15 | */ |
16 | - do_action( 'give_register_form_fields_top' ); |
|
16 | + do_action('give_register_form_fields_top'); |
|
17 | 17 | ?> |
18 | 18 | |
19 | 19 | <fieldset> |
20 | - <legend><?php esc_html_e( 'Register a New Account', 'give' ); ?></legend> |
|
20 | + <legend><?php esc_html_e('Register a New Account', 'give'); ?></legend> |
|
21 | 21 | |
22 | 22 | <?php |
23 | 23 | /** |
@@ -27,26 +27,26 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @since 1.0 |
29 | 29 | */ |
30 | - do_action( 'give_register_form_fields_before' ); |
|
30 | + do_action('give_register_form_fields_before'); |
|
31 | 31 | ?> |
32 | 32 | |
33 | 33 | <div class="form-row form-row-first form-row-responsive"> |
34 | - <label for="give-user-login"><?php esc_html_e( 'Username', 'give' ); ?></label> |
|
34 | + <label for="give-user-login"><?php esc_html_e('Username', 'give'); ?></label> |
|
35 | 35 | <input id="give-user-login" class="required give-input" type="text" name="give_user_login" required aria-required="true" /> |
36 | 36 | </div> |
37 | 37 | |
38 | 38 | <div class="form-row form-row-last form-row-responsive"> |
39 | - <label for="give-user-email"><?php esc_html_e( 'Email', 'give' ); ?></label> |
|
39 | + <label for="give-user-email"><?php esc_html_e('Email', 'give'); ?></label> |
|
40 | 40 | <input id="give-user-email" class="required give-input" type="email" name="give_user_email" required aria-required="true" /> |
41 | 41 | </div> |
42 | 42 | |
43 | 43 | <div class="form-row form-row-first form-row-responsive"> |
44 | - <label for="give-user-pass"><?php esc_html_e( 'Password', 'give' ); ?></label> |
|
44 | + <label for="give-user-pass"><?php esc_html_e('Password', 'give'); ?></label> |
|
45 | 45 | <input id="give-user-pass" class="password required give-input" type="password" name="give_user_pass" required aria-required="true" /> |
46 | 46 | </div> |
47 | 47 | |
48 | 48 | <div class="form-row form-row-last form-row-responsive"> |
49 | - <label for="give-user-pass2"><?php esc_html_e( 'Confirm PW', 'give' ); ?></label> |
|
49 | + <label for="give-user-pass2"><?php esc_html_e('Confirm PW', 'give'); ?></label> |
|
50 | 50 | <input id="give-user-pass2" class="password required give-input" type="password" name="give_user_pass2" required aria-required="true" /> |
51 | 51 | </div> |
52 | 52 | |
@@ -58,17 +58,17 @@ discard block |
||
58 | 58 | * |
59 | 59 | * @since 1.0 |
60 | 60 | */ |
61 | - do_action( 'give_register_form_fields_before_submit' ); |
|
61 | + do_action('give_register_form_fields_before_submit'); |
|
62 | 62 | ?> |
63 | 63 | |
64 | 64 | <div class="give-hidden"> |
65 | 65 | <input type="hidden" name="give_honeypot" value="" /> |
66 | 66 | <input type="hidden" name="give_action" value="user_register" /> |
67 | - <input type="hidden" name="give_redirect" value="<?php echo esc_url( $give_register_redirect ); ?>" /> |
|
67 | + <input type="hidden" name="give_redirect" value="<?php echo esc_url($give_register_redirect); ?>" /> |
|
68 | 68 | </div> |
69 | 69 | |
70 | 70 | <div class="form-row"> |
71 | - <input class="button" name="give_register_submit" type="submit" value="<?php esc_attr_e( 'Register', 'give' ); ?>" /> |
|
71 | + <input class="button" name="give_register_submit" type="submit" value="<?php esc_attr_e('Register', 'give'); ?>" /> |
|
72 | 72 | </div> |
73 | 73 | |
74 | 74 | <?php |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * |
80 | 80 | * @since 1.0 |
81 | 81 | */ |
82 | - do_action( 'give_register_form_fields_after' ); |
|
82 | + do_action('give_register_form_fields_after'); |
|
83 | 83 | ?> |
84 | 84 | |
85 | 85 | </fieldset> |
@@ -92,6 +92,6 @@ discard block |
||
92 | 92 | * |
93 | 93 | * @since 1.0 |
94 | 94 | */ |
95 | - do_action( 'give_register_form_fields_bottom' ); |
|
95 | + do_action('give_register_form_fields_bottom'); |
|
96 | 96 | ?> |
97 | 97 | </form> |
@@ -9,13 +9,13 @@ discard block |
||
9 | 9 | * @since 1.0 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; // Exit if accessed directly. |
14 | 14 | } |
15 | 15 | |
16 | -$template = strtolower( get_option( 'template' ) ); |
|
16 | +$template = strtolower(get_option('template')); |
|
17 | 17 | |
18 | -switch ( $template ) { |
|
18 | +switch ($template) { |
|
19 | 19 | case 'twentyeleven' : |
20 | 20 | echo '<div id="primary" class="give-wrap"><div id="content" role="main" class="twentyeleven">'; |
21 | 21 | break; |
@@ -65,6 +65,6 @@ discard block |
||
65 | 65 | echo '<div class="wrapper hentry" style="box-sizing: border-box;">'; |
66 | 66 | break; |
67 | 67 | default : |
68 | - echo apply_filters( 'give_default_wrapper_start', '<div id="container" class="give-wrap container"><div id="content" role="main">' ); |
|
68 | + echo apply_filters('give_default_wrapper_start', '<div id="container" class="give-wrap container"><div id="content" role="main">'); |
|
69 | 69 | break; |
70 | 70 | } |
71 | 71 | \ No newline at end of file |
@@ -9,13 +9,13 @@ discard block |
||
9 | 9 | * @since 1.0 |
10 | 10 | */ |
11 | 11 | |
12 | -if ( ! defined( 'ABSPATH' ) ) { |
|
12 | +if ( ! defined('ABSPATH')) { |
|
13 | 13 | exit; // Exit if accessed directly. |
14 | 14 | } |
15 | 15 | |
16 | -$template = get_option( 'template' ); |
|
16 | +$template = get_option('template'); |
|
17 | 17 | |
18 | -switch ( $template ) { |
|
18 | +switch ($template) { |
|
19 | 19 | case 'twentyeleven' : |
20 | 20 | echo '</div></div>'; |
21 | 21 | break; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | break; |
28 | 28 | case 'twentyfourteen' : |
29 | 29 | echo '</div></div></div>'; |
30 | - get_sidebar( 'content' ); |
|
30 | + get_sidebar('content'); |
|
31 | 31 | break; |
32 | 32 | case 'twentyfifteen' : |
33 | 33 | echo '</div></div>'; |
@@ -57,6 +57,6 @@ discard block |
||
57 | 57 | echo '</div>'; |
58 | 58 | break; |
59 | 59 | default : |
60 | - echo apply_filters( 'give_default_wrapper_end', '</div></div>' ); |
|
60 | + echo apply_filters('give_default_wrapper_end', '</div></div>'); |
|
61 | 61 | break; |
62 | 62 | } |
63 | 63 | \ No newline at end of file |
@@ -2,13 +2,13 @@ discard block |
||
2 | 2 | /** |
3 | 3 | * This template is used to display the login form with [give_login] |
4 | 4 | */ |
5 | -if ( ! is_user_logged_in() ) { |
|
5 | +if ( ! is_user_logged_in()) { |
|
6 | 6 | |
7 | 7 | // Show any error messages after form submission |
8 | - Give()->notices->render_frontend_notices( 0 ); ?> |
|
8 | + Give()->notices->render_frontend_notices(0); ?> |
|
9 | 9 | <form id="give-login-form" class="give-form" action="" method="post"> |
10 | 10 | <fieldset> |
11 | - <legend><?php esc_html_e( 'Log into Your Account', 'give' ); ?></legend> |
|
11 | + <legend><?php esc_html_e('Log into Your Account', 'give'); ?></legend> |
|
12 | 12 | <?php |
13 | 13 | /** |
14 | 14 | * Fires in the login shortcode, before the login fields. |
@@ -17,27 +17,27 @@ discard block |
||
17 | 17 | * |
18 | 18 | * @since 1.0 |
19 | 19 | */ |
20 | - do_action( 'give_login_fields_before' ); |
|
20 | + do_action('give_login_fields_before'); |
|
21 | 21 | ?> |
22 | 22 | <div class="give-login-username give-login"> |
23 | - <label for="give_user_login"><?php esc_html_e( 'Username', 'give' ); ?></label> |
|
23 | + <label for="give_user_login"><?php esc_html_e('Username', 'give'); ?></label> |
|
24 | 24 | <input name="give_user_login" id="give_user_login" class="give-required give-input" type="text" required aria-required="true" /> |
25 | 25 | </div> |
26 | 26 | |
27 | 27 | <div class="give-login-password give-login"> |
28 | - <label for="give_user_pass"><?php esc_html_e( 'Password', 'give' ); ?></label> |
|
28 | + <label for="give_user_pass"><?php esc_html_e('Password', 'give'); ?></label> |
|
29 | 29 | <input name="give_user_pass" id="give_user_pass" class="give-password give-required give-input" type="password" required aria-required="true" /> |
30 | 30 | </div> |
31 | 31 | |
32 | 32 | <div class="give-login-submit give-login"> |
33 | - <input type="hidden" name="give_login_redirect" value="<?php echo esc_url( $give_login_redirect ); ?>" /> |
|
34 | - <input type="hidden" name="give_login_nonce" value="<?php echo wp_create_nonce( 'give-login-nonce' ); ?>" /> |
|
33 | + <input type="hidden" name="give_login_redirect" value="<?php echo esc_url($give_login_redirect); ?>" /> |
|
34 | + <input type="hidden" name="give_login_nonce" value="<?php echo wp_create_nonce('give-login-nonce'); ?>" /> |
|
35 | 35 | <input type="hidden" name="give_action" value="user_login" /> |
36 | - <input id="give_login_submit" type="submit" class="give_submit" value="<?php esc_attr_e( 'Log In', 'give' ); ?>" /> |
|
36 | + <input id="give_login_submit" type="submit" class="give_submit" value="<?php esc_attr_e('Log In', 'give'); ?>" /> |
|
37 | 37 | </div> |
38 | 38 | |
39 | 39 | <div class="give-lost-password give-login"> |
40 | - <a href="<?php echo wp_lostpassword_url(); ?>"><?php esc_html_e( 'Reset Password', 'give' ); ?></a> |
|
40 | + <a href="<?php echo wp_lostpassword_url(); ?>"><?php esc_html_e('Reset Password', 'give'); ?></a> |
|
41 | 41 | </div> |
42 | 42 | <?php |
43 | 43 | /** |
@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | * |
48 | 48 | * @since 1.0 |
49 | 49 | */ |
50 | - do_action( 'give_login_fields_after' ); |
|
50 | + do_action('give_login_fields_after'); |
|
51 | 51 | ?> |
52 | 52 | </fieldset> |
53 | 53 | </form> |
54 | -<?php } elseif( isset( $_GET['give-login-success'] ) && $_GET['give-login-success'] == true ) { ?> |
|
55 | - <?php Give()->notices->print_frontend_notice( apply_filters('give_successful_login_message', esc_html__( 'Login successful. Welcome!', 'give' )), true, 'success' ); ?> |
|
54 | +<?php } elseif (isset($_GET['give-login-success']) && $_GET['give-login-success'] == true) { ?> |
|
55 | + <?php Give()->notices->print_frontend_notice(apply_filters('give_successful_login_message', esc_html__('Login successful. Welcome!', 'give')), true, 'success'); ?> |
|
56 | 56 | <?php } else { ?> |
57 | - <?php Give()->notices->print_frontend_notice( apply_filters('give_already_logged_in_message', sprintf( __( 'You are already logged in to the site. <a href="%s">Click here</a> to logout.', 'give' ), esc_url( $give_logout_redirect ) ) ), true, 'warning' ); ?> |
|
57 | + <?php Give()->notices->print_frontend_notice(apply_filters('give_already_logged_in_message', sprintf(__('You are already logged in to the site. <a href="%s">Click here</a> to logout.', 'give'), esc_url($give_logout_redirect))), true, 'warning'); ?> |
|
58 | 58 | <?php } ?> |
59 | 59 | \ No newline at end of file |