@@ -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,12 +80,12 @@ 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 | 85 | |
| 86 | 86 | <hr class="wp-header-end"> |
| 87 | - <form id="give-donors-search-filter" method="get" action="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-donors' ); ?>"> |
|
| 88 | - <?php $donors_table->search_box( __( 'Search Donors', 'give' ), 'give-donors' ); ?> |
|
| 87 | + <form id="give-donors-search-filter" method="get" action="<?php echo admin_url('edit.php?post_type=give_forms&page=give-donors'); ?>"> |
|
| 88 | + <?php $donors_table->search_box(__('Search Donors', 'give'), 'give-donors'); ?> |
|
| 89 | 89 | <input type="hidden" name="post_type" value="give_forms" /> |
| 90 | 90 | <input type="hidden" name="page" value="give-donors" /> |
| 91 | 91 | <input type="hidden" name="view" value="donors" /> |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | * |
| 103 | 103 | * @since 1.0 |
| 104 | 104 | */ |
| 105 | - do_action( 'give_donors_table_bottom' ); |
|
| 105 | + do_action('give_donors_table_bottom'); |
|
| 106 | 106 | ?> |
| 107 | 107 | </div> |
| 108 | 108 | <?php |
@@ -118,33 +118,33 @@ discard block |
||
| 118 | 118 | * |
| 119 | 119 | * @return void |
| 120 | 120 | */ |
| 121 | -function give_render_donor_view( $view, $callbacks ) { |
|
| 121 | +function give_render_donor_view($view, $callbacks) { |
|
| 122 | 122 | |
| 123 | 123 | $render = true; |
| 124 | 124 | |
| 125 | - $donor_view_role = apply_filters( 'give_view_donors_role', 'view_give_reports' ); |
|
| 125 | + $donor_view_role = apply_filters('give_view_donors_role', 'view_give_reports'); |
|
| 126 | 126 | |
| 127 | - if ( ! current_user_can( $donor_view_role ) ) { |
|
| 128 | - give_set_error( 'give-no-access', __( 'You are not permitted to view this data.', 'give' ) ); |
|
| 127 | + if ( ! current_user_can($donor_view_role)) { |
|
| 128 | + give_set_error('give-no-access', __('You are not permitted to view this data.', 'give')); |
|
| 129 | 129 | $render = false; |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - if ( ! isset( $_GET['id'] ) || ! is_numeric( $_GET['id'] ) ) { |
|
| 133 | - give_set_error( 'give-invalid_donor', __( 'Invalid Donor ID.', 'give' ) ); |
|
| 132 | + if ( ! isset($_GET['id']) || ! is_numeric($_GET['id'])) { |
|
| 133 | + give_set_error('give-invalid_donor', __('Invalid Donor ID.', 'give')); |
|
| 134 | 134 | $render = false; |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | $donor_id = (int) $_GET['id']; |
| 138 | - $reconnect_user_id = ! empty( $_GET['user_id'] ) ? (int) $_GET['user_id'] : ''; |
|
| 139 | - $donor = new Give_Donor( $donor_id ); |
|
| 138 | + $reconnect_user_id = ! empty($_GET['user_id']) ? (int) $_GET['user_id'] : ''; |
|
| 139 | + $donor = new Give_Donor($donor_id); |
|
| 140 | 140 | |
| 141 | 141 | // Reconnect User with Donor profile. |
| 142 | - if( $reconnect_user_id ) { |
|
| 143 | - give_connect_user_donor_profile( $donor, array( 'user_id' => $reconnect_user_id ), array() ); |
|
| 142 | + if ($reconnect_user_id) { |
|
| 143 | + give_connect_user_donor_profile($donor, array('user_id' => $reconnect_user_id), array()); |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - if ( empty( $donor->id ) ) { |
|
| 147 | - give_set_error( 'give-invalid_donor', __( 'Invalid Donor ID.', 'give' ) ); |
|
| 146 | + if (empty($donor->id)) { |
|
| 147 | + give_set_error('give-invalid_donor', __('Invalid Donor ID.', 'give')); |
|
| 148 | 148 | $render = false; |
| 149 | 149 | } |
| 150 | 150 | |
@@ -153,9 +153,9 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | <div class='wrap'> |
| 155 | 155 | |
| 156 | - <?php if ( give_get_errors() ) : ?> |
|
| 156 | + <?php if (give_get_errors()) : ?> |
|
| 157 | 157 | <div class="error settings-error"> |
| 158 | - <?php Give()->notices->render_frontend_notices( 0 ); ?> |
|
| 158 | + <?php Give()->notices->render_frontend_notices(0); ?> |
|
| 159 | 159 | </div> |
| 160 | 160 | <?php endif; ?> |
| 161 | 161 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | <?php |
| 164 | 164 | printf( |
| 165 | 165 | /* translators: %s: donor number */ |
| 166 | - esc_html__( 'Donor %s', 'give' ), |
|
| 166 | + esc_html__('Donor %s', 'give'), |
|
| 167 | 167 | $donor_id |
| 168 | 168 | ); |
| 169 | 169 | ?> |
@@ -171,26 +171,26 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | <hr class="wp-header-end"> |
| 173 | 173 | |
| 174 | - <?php if ( $donor && $render ) : ?> |
|
| 174 | + <?php if ($donor && $render) : ?> |
|
| 175 | 175 | |
| 176 | 176 | <h2 class="nav-tab-wrapper"> |
| 177 | 177 | <?php |
| 178 | - foreach ( $donor_tabs as $key => $tab ) : |
|
| 178 | + foreach ($donor_tabs as $key => $tab) : |
|
| 179 | 179 | $active = $key === $view ? true : false; |
| 180 | 180 | $class = $active ? 'nav-tab nav-tab-active' : 'nav-tab'; |
| 181 | 181 | printf( |
| 182 | - '<a href="%1$s" class="%2$s"><span class="dashicons %3$s"></span>%4$s</a>' . "\n", |
|
| 183 | - esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=' . $key . '&id=' . $donor->id ) ), |
|
| 184 | - esc_attr( $class ), |
|
| 185 | - sanitize_html_class( $tab['dashicon'] ), |
|
| 186 | - esc_html( $tab['title'] ) |
|
| 182 | + '<a href="%1$s" class="%2$s"><span class="dashicons %3$s"></span>%4$s</a>'."\n", |
|
| 183 | + esc_url(admin_url('edit.php?post_type=give_forms&page=give-donors&view='.$key.'&id='.$donor->id)), |
|
| 184 | + esc_attr($class), |
|
| 185 | + sanitize_html_class($tab['dashicon']), |
|
| 186 | + esc_html($tab['title']) |
|
| 187 | 187 | ); |
| 188 | 188 | endforeach; |
| 189 | 189 | ?> |
| 190 | 190 | </h2> |
| 191 | 191 | |
| 192 | 192 | <div id="give-donor-card-wrapper"> |
| 193 | - <?php $callbacks[ $view ]( $donor ) ?> |
|
| 193 | + <?php $callbacks[$view]($donor) ?> |
|
| 194 | 194 | </div> |
| 195 | 195 | |
| 196 | 196 | <?php endif; ?> |
@@ -210,9 +210,9 @@ discard block |
||
| 210 | 210 | * |
| 211 | 211 | * @return void |
| 212 | 212 | */ |
| 213 | -function give_donor_view( $donor ) { |
|
| 213 | +function give_donor_view($donor) { |
|
| 214 | 214 | |
| 215 | - $donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' ); |
|
| 215 | + $donor_edit_role = apply_filters('give_edit_donors_role', 'edit_give_payments'); |
|
| 216 | 216 | |
| 217 | 217 | /** |
| 218 | 218 | * Fires in donor profile screen, above the donor card. |
@@ -221,32 +221,32 @@ discard block |
||
| 221 | 221 | * |
| 222 | 222 | * @param object $donor The donor object being displayed. |
| 223 | 223 | */ |
| 224 | - do_action( 'give_donor_card_top', $donor ); |
|
| 224 | + do_action('give_donor_card_top', $donor); |
|
| 225 | 225 | ?> |
| 226 | 226 | |
| 227 | 227 | <div id="donor-summary" class="info-wrapper donor-section postbox"> |
| 228 | 228 | |
| 229 | - <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 ); ?>"> |
|
| 229 | + <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); ?>"> |
|
| 230 | 230 | |
| 231 | 231 | <div class="donor-info"> |
| 232 | 232 | |
| 233 | 233 | <div class="donor-bio-header clearfix"> |
| 234 | 234 | |
| 235 | 235 | <div class="avatar-wrap left" id="donor-avatar"> |
| 236 | - <?php echo get_avatar( $donor->email ); ?> |
|
| 236 | + <?php echo get_avatar($donor->email); ?> |
|
| 237 | 237 | </div> |
| 238 | 238 | |
| 239 | 239 | <div id="donor-name-wrap" class="left"> |
| 240 | 240 | <span class="donor-id">#<?php echo $donor->id; ?></span> |
| 241 | - <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 _e( 'Donor Name', 'give' ); ?>" /></span> |
|
| 241 | + <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 _e('Donor Name', 'give'); ?>" /></span> |
|
| 242 | 242 | <span class="donor-name info-item editable"><span data-key="name"><?php echo $donor->name; ?></span></span> |
| 243 | 243 | </div> |
| 244 | 244 | <p class="donor-since info-item"> |
| 245 | - <?php _e( 'Donor since', 'give' ); ?> |
|
| 246 | - <?php echo date_i18n( give_date_format(), strtotime( $donor->date_created ) ) ?> |
|
| 245 | + <?php _e('Donor since', 'give'); ?> |
|
| 246 | + <?php echo date_i18n(give_date_format(), strtotime($donor->date_created)) ?> |
|
| 247 | 247 | </p> |
| 248 | - <?php if ( current_user_can( $donor_edit_role ) ) : ?> |
|
| 249 | - <a href="#" id="edit-donor" class="button info-item editable donor-edit-link"><?php _e( 'Edit Donor', 'give' ); ?></a> |
|
| 248 | + <?php if (current_user_can($donor_edit_role)) : ?> |
|
| 249 | + <a href="#" id="edit-donor" class="button info-item editable donor-edit-link"><?php _e('Edit Donor', 'give'); ?></a> |
|
| 250 | 250 | <?php endif; ?> |
| 251 | 251 | </div> |
| 252 | 252 | <!-- /donor-bio-header --> |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | <table class="widefat"> |
| 257 | 257 | <tbody> |
| 258 | 258 | <tr class="alternate"> |
| 259 | - <th scope="col"><label for="tablecell"><?php _e( 'User:', 'give' ); ?></label></th> |
|
| 259 | + <th scope="col"><label for="tablecell"><?php _e('User:', 'give'); ?></label></th> |
|
| 260 | 260 | <td> |
| 261 | 261 | <span class="donor-user-id info-item edit-item"> |
| 262 | 262 | <?php |
@@ -273,48 +273,48 @@ discard block |
||
| 273 | 273 | 'data' => $data_atts, |
| 274 | 274 | ); |
| 275 | 275 | |
| 276 | - if ( ! empty( $user_id ) ) { |
|
| 277 | - $userdata = get_userdata( $user_id ); |
|
| 276 | + if ( ! empty($user_id)) { |
|
| 277 | + $userdata = get_userdata($user_id); |
|
| 278 | 278 | $user_args['selected'] = $user_id; |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | - echo Give()->html->ajax_user_search( $user_args ); |
|
| 281 | + echo Give()->html->ajax_user_search($user_args); |
|
| 282 | 282 | ?> |
| 283 | 283 | </span> |
| 284 | 284 | |
| 285 | 285 | <span class="donor-user-id info-item editable"> |
| 286 | - <?php if ( ! empty( $userdata ) ) { ?> |
|
| 287 | - <span data-key="user_id">#<?php echo $donor->user_id . ' - ' . $userdata->display_name; ?></span> |
|
| 286 | + <?php if ( ! empty($userdata)) { ?> |
|
| 287 | + <span data-key="user_id">#<?php echo $donor->user_id.' - '.$userdata->display_name; ?></span> |
|
| 288 | 288 | <?php } else { ?> |
| 289 | - <span data-key="user_id"><?php _e( 'None', 'give' ); ?></span> |
|
| 289 | + <span data-key="user_id"><?php _e('None', 'give'); ?></span> |
|
| 290 | 290 | <?php } ?> |
| 291 | - <?php if ( current_user_can( $donor_edit_role ) && intval( $donor->user_id ) > 0 ) { ?> |
|
| 291 | + <?php if (current_user_can($donor_edit_role) && intval($donor->user_id) > 0) { ?> |
|
| 292 | 292 | <span class="disconnect-user"> |
| 293 | 293 | - |
| 294 | - <a id="disconnect-donor" href="#disconnect" aria-label="<?php _e( 'Disconnects the current user ID from this donor record.', 'give' ); ?>"> |
|
| 295 | - <?php _e( 'Disconnect User', 'give' ); ?> |
|
| 294 | + <a id="disconnect-donor" href="#disconnect" aria-label="<?php _e('Disconnects the current user ID from this donor record.', 'give'); ?>"> |
|
| 295 | + <?php _e('Disconnect User', 'give'); ?> |
|
| 296 | 296 | </a> |
| 297 | 297 | </span> |
| 298 | 298 | <span class="view-user-profile"> |
| 299 | 299 | | |
| 300 | - <a id="view-user-profile" href="<?php echo 'user-edit.php?user_id=' . $donor->user_id; ?>" aria-label="<?php _e( 'View User Profile of current user ID.', 'give' ); ?>"> |
|
| 301 | - <?php _e( 'View User Profile', 'give' ); ?> |
|
| 300 | + <a id="view-user-profile" href="<?php echo 'user-edit.php?user_id='.$donor->user_id; ?>" aria-label="<?php _e('View User Profile of current user ID.', 'give'); ?>"> |
|
| 301 | + <?php _e('View User Profile', 'give'); ?> |
|
| 302 | 302 | </a> |
| 303 | 303 | </span> |
| 304 | 304 | <?php } ?> |
| 305 | 305 | </span> |
| 306 | 306 | </td> |
| 307 | 307 | </tr> |
| 308 | - <?php if ( isset( $donor->user_id ) && $donor->user_id > 0 ) : ?> |
|
| 308 | + <?php if (isset($donor->user_id) && $donor->user_id > 0) : ?> |
|
| 309 | 309 | |
| 310 | 310 | <tr> |
| 311 | - <th scope="col"><?php _e( 'Address:', 'give' ); ?></th> |
|
| 311 | + <th scope="col"><?php _e('Address:', 'give'); ?></th> |
|
| 312 | 312 | <td class="row-title"> |
| 313 | 313 | |
| 314 | 314 | <div class="donor-address-wrapper"> |
| 315 | 315 | |
| 316 | 316 | <?php |
| 317 | - $address = get_user_meta( $donor->user_id, '_give_user_address', true ); |
|
| 317 | + $address = get_user_meta($donor->user_id, '_give_user_address', true); |
|
| 318 | 318 | $defaults = array( |
| 319 | 319 | 'line1' => '', |
| 320 | 320 | 'line2' => '', |
@@ -324,10 +324,10 @@ discard block |
||
| 324 | 324 | 'zip' => '', |
| 325 | 325 | ); |
| 326 | 326 | |
| 327 | - $address = wp_parse_args( $address, $defaults ); |
|
| 327 | + $address = wp_parse_args($address, $defaults); |
|
| 328 | 328 | ?> |
| 329 | 329 | |
| 330 | - <?php if ( ! empty( $address ) ) { ?> |
|
| 330 | + <?php if ( ! empty($address)) { ?> |
|
| 331 | 331 | <span class="donor-address info-item editable"> |
| 332 | 332 | <span class="info-item" data-key="line1"><?php echo $address['line1']; ?></span> |
| 333 | 333 | <span class="info-item" data-key="line2"><?php echo $address['line2']; ?></span> |
@@ -344,8 +344,8 @@ discard block |
||
| 344 | 344 | |
| 345 | 345 | // For State. |
| 346 | 346 | $selected_state = give_get_state(); |
| 347 | - $states = give_get_states( $selected_country ); |
|
| 348 | - $selected_state = ( isset( $address['state'] ) ? $address['state'] : $selected_state ); |
|
| 347 | + $states = give_get_states($selected_country); |
|
| 348 | + $selected_state = (isset($address['state']) ? $address['state'] : $selected_state); |
|
| 349 | 349 | |
| 350 | 350 | // Get the country list that does not have any states init. |
| 351 | 351 | $no_states_country = give_no_states_country_list(); |
@@ -353,32 +353,32 @@ discard block |
||
| 353 | 353 | <span class="donor-address info-item edit-item"> |
| 354 | 354 | <select data-key="country" name="customerinfo[country]" id="billing_country" class="billing_country give-select edit-item"> |
| 355 | 355 | <?php |
| 356 | - foreach ( $countries as $country_code => $country ) { |
|
| 357 | - echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>'; |
|
| 356 | + foreach ($countries as $country_code => $country) { |
|
| 357 | + echo '<option value="'.esc_attr($country_code).'"'.selected($country_code, $selected_country, false).'>'.$country.'</option>'; |
|
| 358 | 358 | } |
| 359 | 359 | ?> |
| 360 | 360 | </select> |
| 361 | - <input class="info-item" type="text" data-key="line1" name="customerinfo[line1]" placeholder="<?php _e( 'Address 1', 'give' ); ?>" value="<?php echo $address['line1']; ?>" /> |
|
| 362 | - <input class="info-item" type="text" data-key="line2" name="customerinfo[line2]" placeholder="<?php _e( 'Address 2', 'give' ); ?>" value="<?php echo $address['line2']; ?>" /> |
|
| 363 | - <input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php _e( 'City', 'give' ); ?>" value="<?php echo $address['city']; ?>" /> |
|
| 361 | + <input class="info-item" type="text" data-key="line1" name="customerinfo[line1]" placeholder="<?php _e('Address 1', 'give'); ?>" value="<?php echo $address['line1']; ?>" /> |
|
| 362 | + <input class="info-item" type="text" data-key="line2" name="customerinfo[line2]" placeholder="<?php _e('Address 2', 'give'); ?>" value="<?php echo $address['line2']; ?>" /> |
|
| 363 | + <input class="info-item" type="text" data-key="city" name="customerinfo[city]" placeholder="<?php _e('City', 'give'); ?>" value="<?php echo $address['city']; ?>" /> |
|
| 364 | 364 | <?php |
| 365 | - if ( ! empty( $states ) ) { |
|
| 365 | + if ( ! empty($states)) { |
|
| 366 | 366 | ?> |
| 367 | 367 | <select data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-select info-item"> |
| 368 | 368 | <?php |
| 369 | - foreach ( $states as $state_code => $state ) { |
|
| 370 | - echo '<option value="' . $state_code . '"' . selected( $state_code, $selected_state, false ) . '>' . $state . '</option>'; |
|
| 369 | + foreach ($states as $state_code => $state) { |
|
| 370 | + echo '<option value="'.$state_code.'"'.selected($state_code, $selected_state, false).'>'.$state.'</option>'; |
|
| 371 | 371 | } |
| 372 | 372 | ?> |
| 373 | 373 | </select> |
| 374 | 374 | <?php |
| 375 | 375 | } else { |
| 376 | 376 | ?> |
| 377 | - <input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item <?php echo ( ! empty( $selected_country ) && array_key_exists( $selected_country, $no_states_country ) ? 'give-hidden' : '' ); ?>" placeholder="<?php _e( 'State / Province / County', 'give' ); ?>" /> |
|
| 377 | + <input type="text" size="6" data-key="state" name="customerinfo[state]" id="card_state" class="card_state give-input info-item <?php echo ( ! empty($selected_country) && array_key_exists($selected_country, $no_states_country) ? 'give-hidden' : ''); ?>" placeholder="<?php _e('State / Province / County', 'give'); ?>" /> |
|
| 378 | 378 | <?php |
| 379 | 379 | } |
| 380 | 380 | ?> |
| 381 | - <input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php _e( 'Zip / Postal Code', 'give' ); ?>" value="<?php echo $address['zip']; ?>" /> |
|
| 381 | + <input class="info-item" type="text" data-key="zip" name="customerinfo[zip]" placeholder="<?php _e('Zip / Postal Code', 'give'); ?>" value="<?php echo $address['zip']; ?>" /> |
|
| 382 | 382 | </span> |
| 383 | 383 | |
| 384 | 384 | </div> |
@@ -394,10 +394,10 @@ discard block |
||
| 394 | 394 | |
| 395 | 395 | <span id="donor-edit-actions" class="edit-item"> |
| 396 | 396 | <input type="hidden" data-key="id" name="customerinfo[id]" value="<?php echo $donor->id; ?>" /> |
| 397 | - <?php wp_nonce_field( 'edit-donor', '_wpnonce', false, true ); ?> |
|
| 397 | + <?php wp_nonce_field('edit-donor', '_wpnonce', false, true); ?> |
|
| 398 | 398 | <input type="hidden" name="give_action" value="edit-donor" /> |
| 399 | - <input type="submit" id="give-edit-donor-save" class="button-secondary" value="<?php _e( 'Update Donor', 'give' ); ?>" /> |
|
| 400 | - <a id="give-edit-donor-cancel" href="" class="delete"><?php _e( 'Cancel', 'give' ); ?></a> |
|
| 399 | + <input type="submit" id="give-edit-donor-save" class="button-secondary" value="<?php _e('Update Donor', 'give'); ?>" /> |
|
| 400 | + <a id="give-edit-donor-cancel" href="" class="delete"><?php _e('Cancel', 'give'); ?></a> |
|
| 401 | 401 | </span> |
| 402 | 402 | |
| 403 | 403 | </form> |
@@ -412,24 +412,24 @@ discard block |
||
| 412 | 412 | * |
| 413 | 413 | * @param object $donor The donor object being displayed. |
| 414 | 414 | */ |
| 415 | - do_action( 'give_donor_before_stats', $donor ); |
|
| 415 | + do_action('give_donor_before_stats', $donor); |
|
| 416 | 416 | ?> |
| 417 | 417 | |
| 418 | 418 | <div id="donor-stats-wrapper" class="donor-section postbox clear"> |
| 419 | 419 | <ul> |
| 420 | 420 | <li> |
| 421 | - <a href="<?php echo admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&donor=' . absint( $donor->id ) ); ?>"> |
|
| 421 | + <a href="<?php echo admin_url('edit.php?post_type=give_forms&page=give-payment-history&donor='.absint($donor->id)); ?>"> |
|
| 422 | 422 | <span class="dashicons dashicons-heart"></span> |
| 423 | 423 | <?php |
| 424 | 424 | // Completed Donations. |
| 425 | - $completed_donations_text = sprintf( _n( '%d Completed Donation', '%d Completed Donations', $donor->purchase_count, 'give' ), $donor->purchase_count ); |
|
| 426 | - echo apply_filters( 'give_donor_completed_donations', $completed_donations_text, $donor ); |
|
| 425 | + $completed_donations_text = sprintf(_n('%d Completed Donation', '%d Completed Donations', $donor->purchase_count, 'give'), $donor->purchase_count); |
|
| 426 | + echo apply_filters('give_donor_completed_donations', $completed_donations_text, $donor); |
|
| 427 | 427 | ?> |
| 428 | 428 | </a> |
| 429 | 429 | </li> |
| 430 | 430 | <li> |
| 431 | 431 | <span class="dashicons dashicons-chart-area"></span> |
| 432 | - <?php echo give_currency_filter( give_format_amount( $donor->get_total_donation_amount(), array( 'sanitize' => false ) ) ); ?> <?php _e( 'Lifetime Donations', 'give' ); ?> |
|
| 432 | + <?php echo give_currency_filter(give_format_amount($donor->get_total_donation_amount(), array('sanitize' => false))); ?> <?php _e('Lifetime Donations', 'give'); ?> |
|
| 433 | 433 | </li> |
| 434 | 434 | <?php |
| 435 | 435 | /** |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | * |
| 442 | 442 | * @param object $donor The donor object being displayed. |
| 443 | 443 | */ |
| 444 | - do_action( 'give_donor_stats_list', $donor ); |
|
| 444 | + do_action('give_donor_stats_list', $donor); |
|
| 445 | 445 | ?> |
| 446 | 446 | </ul> |
| 447 | 447 | </div> |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | * |
| 455 | 455 | * @param object $donor The donor object being displayed. |
| 456 | 456 | */ |
| 457 | - do_action( 'give_donor_before_tables_wrapper', $donor ); |
|
| 457 | + do_action('give_donor_before_tables_wrapper', $donor); |
|
| 458 | 458 | ?> |
| 459 | 459 | |
| 460 | 460 | <div id="donor-tables-wrapper" class="donor-section"> |
@@ -467,46 +467,46 @@ discard block |
||
| 467 | 467 | * |
| 468 | 468 | * @param object $donor The donor object being displayed. |
| 469 | 469 | */ |
| 470 | - do_action( 'give_donor_before_tables', $donor ); |
|
| 470 | + do_action('give_donor_before_tables', $donor); |
|
| 471 | 471 | ?> |
| 472 | 472 | |
| 473 | - <h3><?php _e( 'Donor Emails', 'give' ); ?></h3> |
|
| 473 | + <h3><?php _e('Donor Emails', 'give'); ?></h3> |
|
| 474 | 474 | |
| 475 | 475 | <table class="wp-list-table widefat striped emails"> |
| 476 | 476 | <thead> |
| 477 | 477 | <tr> |
| 478 | - <th><?php _e( 'Email', 'give' ); ?></th> |
|
| 479 | - <th><?php _e( 'Actions', 'give' ); ?></th> |
|
| 478 | + <th><?php _e('Email', 'give'); ?></th> |
|
| 479 | + <th><?php _e('Actions', 'give'); ?></th> |
|
| 480 | 480 | </tr> |
| 481 | 481 | </thead> |
| 482 | 482 | |
| 483 | 483 | <tbody> |
| 484 | - <?php if ( ! empty( $donor->emails ) ) { ?> |
|
| 484 | + <?php if ( ! empty($donor->emails)) { ?> |
|
| 485 | 485 | |
| 486 | - <?php foreach ( $donor->emails as $key => $email ) : ?> |
|
| 486 | + <?php foreach ($donor->emails as $key => $email) : ?> |
|
| 487 | 487 | <tr data-key="<?php echo $key; ?>"> |
| 488 | 488 | <td> |
| 489 | 489 | <?php echo $email; ?> |
| 490 | - <?php if ( 'primary' === $key ) : ?> |
|
| 490 | + <?php if ('primary' === $key) : ?> |
|
| 491 | 491 | <span class="dashicons dashicons-star-filled primary-email-icon"></span> |
| 492 | 492 | <?php endif; ?> |
| 493 | 493 | </td> |
| 494 | 494 | <td> |
| 495 | - <?php if ( 'primary' !== $key ) : ?> |
|
| 495 | + <?php if ('primary' !== $key) : ?> |
|
| 496 | 496 | <?php |
| 497 | - $base_url = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor->id ); |
|
| 498 | - $promote_url = wp_nonce_url( add_query_arg( array( |
|
| 499 | - 'email' => rawurlencode( $email ), |
|
| 497 | + $base_url = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor->id); |
|
| 498 | + $promote_url = wp_nonce_url(add_query_arg(array( |
|
| 499 | + 'email' => rawurlencode($email), |
|
| 500 | 500 | 'give_action' => 'set_donor_primary_email', |
| 501 | - ), $base_url ), 'give-set-donor-primary-email' ); |
|
| 502 | - $remove_url = wp_nonce_url( add_query_arg( array( |
|
| 503 | - 'email' => rawurlencode( $email ), |
|
| 501 | + ), $base_url), 'give-set-donor-primary-email'); |
|
| 502 | + $remove_url = wp_nonce_url(add_query_arg(array( |
|
| 503 | + 'email' => rawurlencode($email), |
|
| 504 | 504 | 'give_action' => 'remove_donor_email', |
| 505 | - ), $base_url ), 'give-remove-donor-email' ); |
|
| 505 | + ), $base_url), 'give-remove-donor-email'); |
|
| 506 | 506 | ?> |
| 507 | - <a href="<?php echo $promote_url; ?>"><?php _e( 'Make Primary', 'give' ); ?></a> |
|
| 507 | + <a href="<?php echo $promote_url; ?>"><?php _e('Make Primary', 'give'); ?></a> |
|
| 508 | 508 | | |
| 509 | - <a href="<?php echo $remove_url; ?>" class="delete"><?php _e( 'Remove', 'give' ); ?></a> |
|
| 509 | + <a href="<?php echo $remove_url; ?>" class="delete"><?php _e('Remove', 'give'); ?></a> |
|
| 510 | 510 | <?php endif; ?> |
| 511 | 511 | </td> |
| 512 | 512 | </tr> |
@@ -516,59 +516,59 @@ discard block |
||
| 516 | 516 | <td colspan="2" class="add-donor-email-td"> |
| 517 | 517 | <div class="add-donor-email-wrapper"> |
| 518 | 518 | <input type="hidden" name="donor-id" value="<?php echo $donor->id; ?>" /> |
| 519 | - <?php wp_nonce_field( 'give_add_donor_email', 'add_email_nonce', false, true ); ?> |
|
| 520 | - <input type="email" name="additional-email" value="" placeholder="<?php _e( 'Email Address', 'give' ); ?>" /> |
|
| 521 | - <input type="checkbox" name="make-additional-primary" value="1" id="make-additional-primary" /> <label for="make-additional-primary"><?php _e( 'Make Primary', 'give' ); ?></label> |
|
| 522 | - <button class="button-secondary give-add-donor-email" id="add-donor-email"><?php _e( 'Add Email', 'give' ); ?></button> |
|
| 519 | + <?php wp_nonce_field('give_add_donor_email', 'add_email_nonce', false, true); ?> |
|
| 520 | + <input type="email" name="additional-email" value="" placeholder="<?php _e('Email Address', 'give'); ?>" /> |
|
| 521 | + <input type="checkbox" name="make-additional-primary" value="1" id="make-additional-primary" /> <label for="make-additional-primary"><?php _e('Make Primary', 'give'); ?></label> |
|
| 522 | + <button class="button-secondary give-add-donor-email" id="add-donor-email"><?php _e('Add Email', 'give'); ?></button> |
|
| 523 | 523 | <span class="spinner"></span> |
| 524 | 524 | </div> |
| 525 | 525 | <div class="notice-wrap"></div> |
| 526 | 526 | </td> |
| 527 | 527 | </tr> |
| 528 | 528 | <?php } else { ?> |
| 529 | - <tr><td colspan="2"><?php _e( 'No Emails Found', 'give' ); ?></td></tr> |
|
| 529 | + <tr><td colspan="2"><?php _e('No Emails Found', 'give'); ?></td></tr> |
|
| 530 | 530 | <?php }// End if(). |
| 531 | 531 | ?> |
| 532 | 532 | </tbody> |
| 533 | 533 | </table> |
| 534 | 534 | |
| 535 | - <h3><?php _e( 'Recent Donations', 'give' ); ?></h3> |
|
| 535 | + <h3><?php _e('Recent Donations', 'give'); ?></h3> |
|
| 536 | 536 | <?php |
| 537 | - $payment_ids = explode( ',', $donor->payment_ids ); |
|
| 538 | - $payments = give_get_payments( array( |
|
| 537 | + $payment_ids = explode(',', $donor->payment_ids); |
|
| 538 | + $payments = give_get_payments(array( |
|
| 539 | 539 | 'post__in' => $payment_ids, |
| 540 | - ) ); |
|
| 541 | - $payments = array_slice( $payments, 0, 10 ); |
|
| 540 | + )); |
|
| 541 | + $payments = array_slice($payments, 0, 10); |
|
| 542 | 542 | ?> |
| 543 | 543 | <table class="wp-list-table widefat striped payments"> |
| 544 | 544 | <thead> |
| 545 | 545 | <tr> |
| 546 | - <th scope="col"><?php _e( 'ID', 'give' ); ?></th> |
|
| 547 | - <th scope="col"><?php _e( 'Amount', 'give' ); ?></th> |
|
| 548 | - <th scope="col"><?php _e( 'Date', 'give' ); ?></th> |
|
| 549 | - <th scope="col"><?php _e( 'Status', 'give' ); ?></th> |
|
| 550 | - <th scope="col"><?php _e( 'Actions', 'give' ); ?></th> |
|
| 546 | + <th scope="col"><?php _e('ID', 'give'); ?></th> |
|
| 547 | + <th scope="col"><?php _e('Amount', 'give'); ?></th> |
|
| 548 | + <th scope="col"><?php _e('Date', 'give'); ?></th> |
|
| 549 | + <th scope="col"><?php _e('Status', 'give'); ?></th> |
|
| 550 | + <th scope="col"><?php _e('Actions', 'give'); ?></th> |
|
| 551 | 551 | </tr> |
| 552 | 552 | </thead> |
| 553 | 553 | <tbody> |
| 554 | - <?php if ( ! empty( $payments ) ) { ?> |
|
| 555 | - <?php foreach ( $payments as $payment ) : ?> |
|
| 554 | + <?php if ( ! empty($payments)) { ?> |
|
| 555 | + <?php foreach ($payments as $payment) : ?> |
|
| 556 | 556 | <tr> |
| 557 | 557 | <td><?php echo $payment->ID; ?></td> |
| 558 | - <td><?php echo give_donation_amount( $payment->ID ); ?></td> |
|
| 559 | - <td><?php echo date_i18n( give_date_format(), strtotime( $payment->post_date ) ); ?></td> |
|
| 560 | - <td><?php echo give_get_payment_status( $payment, true ); ?></td> |
|
| 558 | + <td><?php echo give_donation_amount($payment->ID); ?></td> |
|
| 559 | + <td><?php echo date_i18n(give_date_format(), strtotime($payment->post_date)); ?></td> |
|
| 560 | + <td><?php echo give_get_payment_status($payment, true); ?></td> |
|
| 561 | 561 | <td> |
| 562 | 562 | <?php |
| 563 | 563 | printf( |
| 564 | 564 | '<a href="%1$s" aria-label="%2$s">%3$s</a>', |
| 565 | - admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id=' . $payment->ID ), |
|
| 565 | + admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-payment-details&id='.$payment->ID), |
|
| 566 | 566 | sprintf( |
| 567 | 567 | /* translators: %s: Donation ID */ |
| 568 | - esc_attr__( 'View Donation %s.', 'give' ), |
|
| 568 | + esc_attr__('View Donation %s.', 'give'), |
|
| 569 | 569 | $payment->ID |
| 570 | 570 | ), |
| 571 | - __( 'View Donation', 'give' ) |
|
| 571 | + __('View Donation', 'give') |
|
| 572 | 572 | ); |
| 573 | 573 | ?> |
| 574 | 574 | |
@@ -583,47 +583,47 @@ discard block |
||
| 583 | 583 | * @param object $donor The donor object being displayed. |
| 584 | 584 | * @param object $payment The payment object being displayed. |
| 585 | 585 | */ |
| 586 | - do_action( 'give_donor_recent_purchases_actions', $donor, $payment ); |
|
| 586 | + do_action('give_donor_recent_purchases_actions', $donor, $payment); |
|
| 587 | 587 | ?> |
| 588 | 588 | </td> |
| 589 | 589 | </tr> |
| 590 | 590 | <?php endforeach; ?> |
| 591 | 591 | <?php } else { ?> |
| 592 | 592 | <tr> |
| 593 | - <td colspan="5"><?php _e( 'No donations found.', 'give' ); ?></td> |
|
| 593 | + <td colspan="5"><?php _e('No donations found.', 'give'); ?></td> |
|
| 594 | 594 | </tr> |
| 595 | 595 | <?php }// End if(). |
| 596 | 596 | ?> |
| 597 | 597 | </tbody> |
| 598 | 598 | </table> |
| 599 | 599 | |
| 600 | - <h3><?php _e( 'Completed Forms', 'give' ); ?></h3> |
|
| 600 | + <h3><?php _e('Completed Forms', 'give'); ?></h3> |
|
| 601 | 601 | <?php |
| 602 | - $donations = give_get_users_completed_donations( $donor->email ); |
|
| 602 | + $donations = give_get_users_completed_donations($donor->email); |
|
| 603 | 603 | ?> |
| 604 | 604 | <table class="wp-list-table widefat striped donations"> |
| 605 | 605 | <thead> |
| 606 | 606 | <tr> |
| 607 | - <th scope="col"><?php _e( 'Form', 'give' ); ?></th> |
|
| 608 | - <th scope="col" width="120px"><?php _e( 'Actions', 'give' ); ?></th> |
|
| 607 | + <th scope="col"><?php _e('Form', 'give'); ?></th> |
|
| 608 | + <th scope="col" width="120px"><?php _e('Actions', 'give'); ?></th> |
|
| 609 | 609 | </tr> |
| 610 | 610 | </thead> |
| 611 | 611 | <tbody> |
| 612 | - <?php if ( ! empty( $donations ) ) { ?> |
|
| 613 | - <?php foreach ( $donations as $donation ) : ?> |
|
| 612 | + <?php if ( ! empty($donations)) { ?> |
|
| 613 | + <?php foreach ($donations as $donation) : ?> |
|
| 614 | 614 | <tr> |
| 615 | 615 | <td><?php echo $donation->post_title; ?></td> |
| 616 | 616 | <td> |
| 617 | 617 | <?php |
| 618 | 618 | printf( |
| 619 | 619 | '<a href="%1$s" aria-label="%2$s">%3$s</a>', |
| 620 | - esc_url( admin_url( 'post.php?action=edit&post=' . $donation->ID ) ), |
|
| 620 | + esc_url(admin_url('post.php?action=edit&post='.$donation->ID)), |
|
| 621 | 621 | sprintf( |
| 622 | 622 | /* translators: %s: form name */ |
| 623 | - esc_attr__( 'View Form %s.', 'give' ), |
|
| 623 | + esc_attr__('View Form %s.', 'give'), |
|
| 624 | 624 | $donation->post_title |
| 625 | 625 | ), |
| 626 | - __( 'View Form', 'give' ) |
|
| 626 | + __('View Form', 'give') |
|
| 627 | 627 | ); |
| 628 | 628 | ?> |
| 629 | 629 | </td> |
@@ -631,7 +631,7 @@ discard block |
||
| 631 | 631 | <?php endforeach; ?> |
| 632 | 632 | <?php } else { ?> |
| 633 | 633 | <tr> |
| 634 | - <td colspan="2"><?php _e( 'No completed donations found.', 'give' ); ?></td> |
|
| 634 | + <td colspan="2"><?php _e('No completed donations found.', 'give'); ?></td> |
|
| 635 | 635 | </tr> |
| 636 | 636 | <?php } ?> |
| 637 | 637 | </tbody> |
@@ -645,7 +645,7 @@ discard block |
||
| 645 | 645 | * |
| 646 | 646 | * @param object $donor The donor object being displayed. |
| 647 | 647 | */ |
| 648 | - do_action( 'give_donor_after_tables', $donor ); |
|
| 648 | + do_action('give_donor_after_tables', $donor); |
|
| 649 | 649 | ?> |
| 650 | 650 | |
| 651 | 651 | </div> |
@@ -658,7 +658,7 @@ discard block |
||
| 658 | 658 | * |
| 659 | 659 | * @param object $donor The donor object being displayed. |
| 660 | 660 | */ |
| 661 | - do_action( 'give_donor_card_bottom', $donor ); |
|
| 661 | + do_action('give_donor_card_bottom', $donor); |
|
| 662 | 662 | |
| 663 | 663 | } |
| 664 | 664 | |
@@ -671,30 +671,30 @@ discard block |
||
| 671 | 671 | * |
| 672 | 672 | * @return void |
| 673 | 673 | */ |
| 674 | -function give_donor_notes_view( $donor ) { |
|
| 674 | +function give_donor_notes_view($donor) { |
|
| 675 | 675 | |
| 676 | - $paged = isset( $_GET['paged'] ) && is_numeric( $_GET['paged'] ) ? $_GET['paged'] : 1; |
|
| 677 | - $paged = absint( $paged ); |
|
| 676 | + $paged = isset($_GET['paged']) && is_numeric($_GET['paged']) ? $_GET['paged'] : 1; |
|
| 677 | + $paged = absint($paged); |
|
| 678 | 678 | $note_count = $donor->get_notes_count(); |
| 679 | - $per_page = apply_filters( 'give_donor_notes_per_page', 20 ); |
|
| 680 | - $total_pages = ceil( $note_count / $per_page ); |
|
| 681 | - $donor_notes = $donor->get_notes( $per_page, $paged ); |
|
| 679 | + $per_page = apply_filters('give_donor_notes_per_page', 20); |
|
| 680 | + $total_pages = ceil($note_count / $per_page); |
|
| 681 | + $donor_notes = $donor->get_notes($per_page, $paged); |
|
| 682 | 682 | ?> |
| 683 | 683 | |
| 684 | 684 | <div id="donor-notes-wrapper"> |
| 685 | 685 | <div class="donor-notes-header"> |
| 686 | - <?php echo get_avatar( $donor->email, 30 ); ?> <span><?php echo $donor->name; ?></span> |
|
| 686 | + <?php echo get_avatar($donor->email, 30); ?> <span><?php echo $donor->name; ?></span> |
|
| 687 | 687 | </div> |
| 688 | - <h3><?php _e( 'Notes', 'give' ); ?></h3> |
|
| 688 | + <h3><?php _e('Notes', 'give'); ?></h3> |
|
| 689 | 689 | |
| 690 | - <?php if ( 1 == $paged ) : ?> |
|
| 690 | + <?php if (1 == $paged) : ?> |
|
| 691 | 691 | <div style="display: block; margin-bottom: 55px;"> |
| 692 | - <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 ); ?>"> |
|
| 692 | + <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); ?>"> |
|
| 693 | 693 | <textarea id="donor-note" name="donor_note" class="donor-note-input" rows="10"></textarea> |
| 694 | 694 | <br /> |
| 695 | 695 | <input type="hidden" id="donor-id" name="customer_id" value="<?php echo $donor->id; ?>" /> |
| 696 | 696 | <input type="hidden" name="give_action" value="add-donor-note" /> |
| 697 | - <?php wp_nonce_field( 'add-donor-note', 'add_donor_note_nonce', true, true ); ?> |
|
| 697 | + <?php wp_nonce_field('add-donor-note', 'add_donor_note_nonce', true, true); ?> |
|
| 698 | 698 | <input id="add-donor-note" class="right button-primary" type="submit" value="Add Note" /> |
| 699 | 699 | </form> |
| 700 | 700 | </div> |
@@ -709,26 +709,26 @@ discard block |
||
| 709 | 709 | 'show_all' => true, |
| 710 | 710 | ); |
| 711 | 711 | |
| 712 | - echo paginate_links( $pagination_args ); |
|
| 712 | + echo paginate_links($pagination_args); |
|
| 713 | 713 | ?> |
| 714 | 714 | |
| 715 | 715 | <div id="give-donor-notes" class="postbox"> |
| 716 | - <?php if ( count( $donor_notes ) > 0 ) { ?> |
|
| 717 | - <?php foreach ( $donor_notes as $key => $note ) : ?> |
|
| 716 | + <?php if (count($donor_notes) > 0) { ?> |
|
| 717 | + <?php foreach ($donor_notes as $key => $note) : ?> |
|
| 718 | 718 | <div class="donor-note-wrapper dashboard-comment-wrap comment-item"> |
| 719 | 719 | <span class="note-content-wrap"> |
| 720 | - <?php echo stripslashes( $note ); ?> |
|
| 720 | + <?php echo stripslashes($note); ?> |
|
| 721 | 721 | </span> |
| 722 | 722 | </div> |
| 723 | 723 | <?php endforeach; ?> |
| 724 | 724 | <?php } else { ?> |
| 725 | 725 | <div class="give-no-donor-notes"> |
| 726 | - <?php _e( 'No donor notes found.', 'give' ); ?> |
|
| 726 | + <?php _e('No donor notes found.', 'give'); ?> |
|
| 727 | 727 | </div> |
| 728 | 728 | <?php } ?> |
| 729 | 729 | </div> |
| 730 | 730 | |
| 731 | - <?php echo paginate_links( $pagination_args ); ?> |
|
| 731 | + <?php echo paginate_links($pagination_args); ?> |
|
| 732 | 732 | |
| 733 | 733 | </div> |
| 734 | 734 | |
@@ -744,9 +744,9 @@ discard block |
||
| 744 | 744 | * |
| 745 | 745 | * @return void |
| 746 | 746 | */ |
| 747 | -function give_donor_delete_view( $donor ) { |
|
| 747 | +function give_donor_delete_view($donor) { |
|
| 748 | 748 | |
| 749 | - $donor_edit_role = apply_filters( 'give_edit_donors_role', 'edit_give_payments' ); |
|
| 749 | + $donor_edit_role = apply_filters('give_edit_donors_role', 'edit_give_payments'); |
|
| 750 | 750 | |
| 751 | 751 | /** |
| 752 | 752 | * Fires in donor delete screen, above the content. |
@@ -755,15 +755,15 @@ discard block |
||
| 755 | 755 | * |
| 756 | 756 | * @param object $donor The donor object being displayed. |
| 757 | 757 | */ |
| 758 | - do_action( 'give_donor_delete_top', $donor ); |
|
| 758 | + do_action('give_donor_delete_top', $donor); |
|
| 759 | 759 | ?> |
| 760 | 760 | |
| 761 | 761 | <div class="info-wrapper donor-section"> |
| 762 | 762 | |
| 763 | - <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 ); ?>"> |
|
| 763 | + <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); ?>"> |
|
| 764 | 764 | |
| 765 | 765 | <div class="donor-notes-header"> |
| 766 | - <?php echo get_avatar( $donor->email, 30 ); ?> <span><?php echo $donor->name; ?></span> |
|
| 766 | + <?php echo get_avatar($donor->email, 30); ?> <span><?php echo $donor->name; ?></span> |
|
| 767 | 767 | </div> |
| 768 | 768 | |
| 769 | 769 | |
@@ -771,20 +771,20 @@ discard block |
||
| 771 | 771 | |
| 772 | 772 | <span class="delete-donor-options"> |
| 773 | 773 | <p> |
| 774 | - <?php echo Give()->html->checkbox( array( |
|
| 774 | + <?php echo Give()->html->checkbox(array( |
|
| 775 | 775 | 'name' => 'give-donor-delete-confirm', |
| 776 | - ) ); ?> |
|
| 777 | - <label for="give-donor-delete-confirm"><?php _e( 'Are you sure you want to delete this donor?', 'give' ); ?></label> |
|
| 776 | + )); ?> |
|
| 777 | + <label for="give-donor-delete-confirm"><?php _e('Are you sure you want to delete this donor?', 'give'); ?></label> |
|
| 778 | 778 | </p> |
| 779 | 779 | |
| 780 | 780 | <p> |
| 781 | - <?php echo Give()->html->checkbox( array( |
|
| 781 | + <?php echo Give()->html->checkbox(array( |
|
| 782 | 782 | 'name' => 'give-donor-delete-records', |
| 783 | 783 | 'options' => array( |
| 784 | 784 | 'disabled' => true, |
| 785 | 785 | ), |
| 786 | - ) ); ?> |
|
| 787 | - <label for="give-donor-delete-records"><?php _e( 'Delete all associated donations and records?', 'give' ); ?></label> |
|
| 786 | + )); ?> |
|
| 787 | + <label for="give-donor-delete-records"><?php _e('Delete all associated donations and records?', 'give'); ?></label> |
|
| 788 | 788 | </p> |
| 789 | 789 | |
| 790 | 790 | <?php |
@@ -797,16 +797,16 @@ discard block |
||
| 797 | 797 | * |
| 798 | 798 | * @param object $donor The donor object being displayed. |
| 799 | 799 | */ |
| 800 | - do_action( 'give_donor_delete_inputs', $donor ); |
|
| 800 | + do_action('give_donor_delete_inputs', $donor); |
|
| 801 | 801 | ?> |
| 802 | 802 | </span> |
| 803 | 803 | |
| 804 | 804 | <span id="donor-edit-actions"> |
| 805 | 805 | <input type="hidden" name="customer_id" value="<?php echo $donor->id; ?>" /> |
| 806 | - <?php wp_nonce_field( 'delete-donor', '_wpnonce', false, true ); ?> |
|
| 806 | + <?php wp_nonce_field('delete-donor', '_wpnonce', false, true); ?> |
|
| 807 | 807 | <input type="hidden" name="give_action" value="delete-donor" /> |
| 808 | - <input type="submit" disabled="disabled" id="give-delete-donor" class="button-primary" value="<?php _e( 'Delete Donor', 'give' ); ?>" /> |
|
| 809 | - <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 _e( 'Cancel', 'give' ); ?></a> |
|
| 808 | + <input type="submit" disabled="disabled" id="give-delete-donor" class="button-primary" value="<?php _e('Delete Donor', 'give'); ?>" /> |
|
| 809 | + <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 _e('Cancel', 'give'); ?></a> |
|
| 810 | 810 | </span> |
| 811 | 811 | |
| 812 | 812 | </div> |
@@ -822,5 +822,5 @@ discard block |
||
| 822 | 822 | * |
| 823 | 823 | * @param object $donor The donor object being displayed. |
| 824 | 824 | */ |
| 825 | - do_action( 'give_donor_delete_bottom', $donor ); |
|
| 825 | + do_action('give_donor_delete_bottom', $donor); |
|
| 826 | 826 | } |
@@ -6,25 +6,25 @@ discard block |
||
| 6 | 6 | global $give_receipt_args, $payment; |
| 7 | 7 | |
| 8 | 8 | // Validation: Ensure $payment var is set. |
| 9 | -if ( empty( $payment ) ) { |
|
| 10 | - $payment = ! empty( $give_receipt_args['id'] ) ? get_post( $give_receipt_args['id'] ) : 0; |
|
| 9 | +if (empty($payment)) { |
|
| 10 | + $payment = ! empty($give_receipt_args['id']) ? get_post($give_receipt_args['id']) : 0; |
|
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | // Double-Validation: Check for $payment global. |
| 14 | -if ( empty( $payment ) ) { |
|
| 15 | - Give()->notices->print_frontend_notice( __( 'The specified receipt ID appears to be invalid.', 'give' ) ); |
|
| 14 | +if (empty($payment)) { |
|
| 15 | + Give()->notices->print_frontend_notice(__('The specified receipt ID appears to be invalid.', 'give')); |
|
| 16 | 16 | |
| 17 | 17 | return; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | $donation_id = $payment->ID; |
| 21 | -$form_id = give_get_payment_meta( $donation_id, '_give_payment_form_id', true ); |
|
| 22 | -$meta = give_get_payment_meta( $donation_id ); |
|
| 23 | -$donation = give_get_payment_form_title( $meta ); |
|
| 24 | -$user = give_get_payment_meta_user_info( $donation_id ); |
|
| 25 | -$email = give_get_payment_user_email( $donation_id ); |
|
| 21 | +$form_id = give_get_payment_meta($donation_id, '_give_payment_form_id', true); |
|
| 22 | +$meta = give_get_payment_meta($donation_id); |
|
| 23 | +$donation = give_get_payment_form_title($meta); |
|
| 24 | +$user = give_get_payment_meta_user_info($donation_id); |
|
| 25 | +$email = give_get_payment_user_email($donation_id); |
|
| 26 | 26 | $status = $payment->post_status; |
| 27 | -$status_label = give_get_payment_status( $payment, true ); |
|
| 27 | +$status_label = give_get_payment_status($payment, true); |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * Generate Donation Receipt Arguments. |
@@ -35,50 +35,50 @@ discard block |
||
| 35 | 35 | * @since 1.8.8 |
| 36 | 36 | */ |
| 37 | 37 | $give_receipt_args['donation_receipt']['donor'] = array( |
| 38 | - 'name' => __( 'Donor', 'give' ), |
|
| 39 | - 'value' => $user['first_name'] . ' ' . $user['last_name'], |
|
| 38 | + 'name' => __('Donor', 'give'), |
|
| 39 | + 'value' => $user['first_name'].' '.$user['last_name'], |
|
| 40 | 40 | 'display' => $give_receipt_args['donor'], |
| 41 | 41 | ); |
| 42 | 42 | |
| 43 | 43 | $give_receipt_args['donation_receipt']['date'] = array( |
| 44 | - 'name' => __( 'Date', 'give' ), |
|
| 45 | - 'value' => date_i18n( give_date_format(), strtotime( $meta['date'] ) ), |
|
| 44 | + 'name' => __('Date', 'give'), |
|
| 45 | + 'value' => date_i18n(give_date_format(), strtotime($meta['date'])), |
|
| 46 | 46 | 'display' => $give_receipt_args['date'], |
| 47 | 47 | ); |
| 48 | 48 | |
| 49 | 49 | $give_receipt_args['donation_receipt']['total_donation'] = array( |
| 50 | - 'name' => __( 'Total Donation', 'give' ), |
|
| 51 | - 'value' => give_donation_amount( $donation_id ), |
|
| 50 | + 'name' => __('Total Donation', 'give'), |
|
| 51 | + 'value' => give_donation_amount($donation_id), |
|
| 52 | 52 | 'display' => $give_receipt_args['price'], |
| 53 | 53 | ); |
| 54 | 54 | |
| 55 | 55 | $give_receipt_args['donation_receipt']['donation'] = array( |
| 56 | - 'name' => __( 'Donation', 'give' ), |
|
| 56 | + 'name' => __('Donation', 'give'), |
|
| 57 | 57 | 'value' => $donation, |
| 58 | 58 | 'display' => true, |
| 59 | 59 | ); |
| 60 | 60 | |
| 61 | 61 | $give_receipt_args['donation_receipt']['donation_status'] = array( |
| 62 | - 'name' => __( 'Donation Status', 'give' ), |
|
| 63 | - 'value' => esc_attr( $status_label ), |
|
| 62 | + 'name' => __('Donation Status', 'give'), |
|
| 63 | + 'value' => esc_attr($status_label), |
|
| 64 | 64 | 'display' => $give_receipt_args['payment_status'], |
| 65 | 65 | ); |
| 66 | 66 | |
| 67 | 67 | $give_receipt_args['donation_receipt']['donation_id'] = array( |
| 68 | - 'name' => __( 'Donation ID', 'give' ), |
|
| 68 | + 'name' => __('Donation ID', 'give'), |
|
| 69 | 69 | 'value' => $donation_id, |
| 70 | 70 | 'display' => $give_receipt_args['payment_id'], |
| 71 | 71 | ); |
| 72 | 72 | |
| 73 | 73 | $give_receipt_args['donation_receipt']['payment_key'] = array( |
| 74 | - 'name' => __( 'Payment Key', 'give' ), |
|
| 75 | - 'value' => get_post_meta( $donation_id, '_give_payment_purchase_key', true ), |
|
| 74 | + 'name' => __('Payment Key', 'give'), |
|
| 75 | + 'value' => get_post_meta($donation_id, '_give_payment_purchase_key', true), |
|
| 76 | 76 | 'display' => $give_receipt_args['payment_key'], |
| 77 | 77 | ); |
| 78 | 78 | |
| 79 | 79 | $give_receipt_args['donation_receipt']['payment_method'] = array( |
| 80 | - 'name' => __( 'Payment Method', 'give' ), |
|
| 81 | - 'value' => give_get_gateway_checkout_label( give_get_payment_gateway( $donation_id ) ), |
|
| 80 | + 'name' => __('Payment Method', 'give'), |
|
| 81 | + 'value' => give_get_gateway_checkout_label(give_get_payment_gateway($donation_id)), |
|
| 82 | 82 | 'display' => $give_receipt_args['payment_method'], |
| 83 | 83 | ); |
| 84 | 84 | |
@@ -93,10 +93,10 @@ discard block |
||
| 93 | 93 | * |
| 94 | 94 | * @since 1.8.8 |
| 95 | 95 | */ |
| 96 | -$give_receipt_args['donation_receipt'] = apply_filters( 'give_donation_receipt_args', $give_receipt_args['donation_receipt'], $donation_id, $form_id ); |
|
| 96 | +$give_receipt_args['donation_receipt'] = apply_filters('give_donation_receipt_args', $give_receipt_args['donation_receipt'], $donation_id, $form_id); |
|
| 97 | 97 | |
| 98 | 98 | // When the donation were made through offline donation, We won't show receipt and payment status though. |
| 99 | -if ( 'offline' === give_get_payment_gateway( $payment->ID ) && 'pending' === $status ) { |
|
| 99 | +if ('offline' === give_get_payment_gateway($payment->ID) && 'pending' === $status) { |
|
| 100 | 100 | |
| 101 | 101 | /** |
| 102 | 102 | * Before the offline donation receipt content starts. |
@@ -106,13 +106,13 @@ discard block |
||
| 106 | 106 | * @param Give_Payment $payment Donation payment object. |
| 107 | 107 | * @param array $give_receipt_args Receipt Arguments. |
| 108 | 108 | */ |
| 109 | - do_action( 'give_receipt_before_offline_payment', $payment, $give_receipt_args ); |
|
| 109 | + do_action('give_receipt_before_offline_payment', $payment, $give_receipt_args); |
|
| 110 | 110 | ?> |
| 111 | - <h2><?php echo apply_filters( 'give_receipt_offline_payment_heading', __( 'Your Donation is Almost Complete!', 'give' ) ); ?></h2> |
|
| 112 | - <div id="give_donation_receipt" class="<?php echo esc_attr( apply_filters( 'give_receipt_offline_payment_classes', 'give_receipt_offline_payment' ) ); ?>"> |
|
| 111 | + <h2><?php echo apply_filters('give_receipt_offline_payment_heading', __('Your Donation is Almost Complete!', 'give')); ?></h2> |
|
| 112 | + <div id="give_donation_receipt" class="<?php echo esc_attr(apply_filters('give_receipt_offline_payment_classes', 'give_receipt_offline_payment')); ?>"> |
|
| 113 | 113 | <?php |
| 114 | 114 | // Instruction for offline donation. |
| 115 | - $offline_instruction = give_get_offline_payment_instruction( $form_id, true ); |
|
| 115 | + $offline_instruction = give_get_offline_payment_instruction($form_id, true); |
|
| 116 | 116 | |
| 117 | 117 | /** |
| 118 | 118 | * Instruction for the offline donation. |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | * @param Give_Payment $payment Payment object. |
| 124 | 124 | * @param integer $form_id Donation form id. |
| 125 | 125 | */ |
| 126 | - echo apply_filters( 'give_receipt_offline_payment_instruction', $offline_instruction, $payment, $form_id ); |
|
| 126 | + echo apply_filters('give_receipt_offline_payment_instruction', $offline_instruction, $payment, $form_id); |
|
| 127 | 127 | ?> |
| 128 | 128 | </div> |
| 129 | 129 | <?php |
@@ -135,52 +135,52 @@ discard block |
||
| 135 | 135 | * @param Give_Payment $payment Donation payment object. |
| 136 | 136 | * @param array $give_receipt_args Receipt Arguments. |
| 137 | 137 | */ |
| 138 | - do_action( 'give_receipt_after_offline_payment', $payment, $give_receipt_args ); |
|
| 138 | + do_action('give_receipt_after_offline_payment', $payment, $give_receipt_args); |
|
| 139 | 139 | |
| 140 | 140 | return; |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | // Show payment status notice based on shortcode attribute. |
| 144 | -if ( filter_var( $give_receipt_args['status_notice'], FILTER_VALIDATE_BOOLEAN ) ) { |
|
| 144 | +if (filter_var($give_receipt_args['status_notice'], FILTER_VALIDATE_BOOLEAN)) { |
|
| 145 | 145 | $notice_message = ''; |
| 146 | 146 | $notice_type = 'warning'; |
| 147 | 147 | |
| 148 | - switch ( $status ) { |
|
| 148 | + switch ($status) { |
|
| 149 | 149 | case 'publish': |
| 150 | - $notice_message = __( 'Payment Complete: Thank you for your donation.', 'give' ); |
|
| 150 | + $notice_message = __('Payment Complete: Thank you for your donation.', 'give'); |
|
| 151 | 151 | $notice_type = 'success'; |
| 152 | 152 | break; |
| 153 | 153 | case 'pending': |
| 154 | - $notice_message = __( 'Payment Pending: Your donation is currently processing.', 'give' ); |
|
| 154 | + $notice_message = __('Payment Pending: Your donation is currently processing.', 'give'); |
|
| 155 | 155 | $notice_type = 'warning'; |
| 156 | 156 | break; |
| 157 | 157 | case 'refunded': |
| 158 | - $notice_message = __( 'Payment Refunded: Your donation has been refunded.', 'give' ); |
|
| 158 | + $notice_message = __('Payment Refunded: Your donation has been refunded.', 'give'); |
|
| 159 | 159 | $notice_type = 'warning'; |
| 160 | 160 | break; |
| 161 | 161 | case 'preapproval': |
| 162 | - $notice_message = __( 'Payment Preapproved: Thank you for your donation.', 'give' ); |
|
| 162 | + $notice_message = __('Payment Preapproved: Thank you for your donation.', 'give'); |
|
| 163 | 163 | $notice_type = 'warning'; |
| 164 | 164 | break; |
| 165 | 165 | case 'failed': |
| 166 | - $notice_message = __( 'Payment Failed: Please contact the site owner for assistance.', 'give' ); |
|
| 166 | + $notice_message = __('Payment Failed: Please contact the site owner for assistance.', 'give'); |
|
| 167 | 167 | $notice_type = 'error'; |
| 168 | 168 | break; |
| 169 | 169 | case 'cancelled': |
| 170 | - $notice_message = __( 'Payment Cancelled: Your donation has been cancelled.', 'give' ); |
|
| 170 | + $notice_message = __('Payment Cancelled: Your donation has been cancelled.', 'give'); |
|
| 171 | 171 | $notice_type = 'error'; |
| 172 | 172 | break; |
| 173 | 173 | case 'abandoned': |
| 174 | - $notice_message = __( 'Payment Abandoned: This donation has not been completed.', 'give' ); |
|
| 174 | + $notice_message = __('Payment Abandoned: This donation has not been completed.', 'give'); |
|
| 175 | 175 | $notice_type = 'error'; |
| 176 | 176 | break; |
| 177 | 177 | case 'revoked': |
| 178 | - $notice_message = __( 'Payment Revoked: Please contact the site owner for assistance.', 'give' ); |
|
| 178 | + $notice_message = __('Payment Revoked: Please contact the site owner for assistance.', 'give'); |
|
| 179 | 179 | $notice_type = 'error'; |
| 180 | 180 | break; |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - if ( ! empty( $notice_message ) ) { |
|
| 183 | + if ( ! empty($notice_message)) { |
|
| 184 | 184 | /** |
| 185 | 185 | * Filters payment status notice for receipts. |
| 186 | 186 | * |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | * @param string $status Payment status. |
| 196 | 196 | * @param array $meta Array of meta data related to the payment. |
| 197 | 197 | */ |
| 198 | - echo apply_filters( 'give_receipt_status_notice', Give()->notices->print_frontend_notice( $notice_message, false, $notice_type ), $id, $status, $meta ); |
|
| 198 | + echo apply_filters('give_receipt_status_notice', Give()->notices->print_frontend_notice($notice_message, false, $notice_type), $id, $status, $meta); |
|
| 199 | 199 | } |
| 200 | 200 | }// End if(). |
| 201 | 201 | |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | * @param object $payment The payment object. |
| 210 | 210 | * @param array $give_receipt_args Receipt_argument. |
| 211 | 211 | */ |
| 212 | -do_action( 'give_payment_receipt_before_table', $payment, $give_receipt_args ); |
|
| 212 | +do_action('give_payment_receipt_before_table', $payment, $give_receipt_args); |
|
| 213 | 213 | ?> |
| 214 | 214 | |
| 215 | 215 | <table id="give_donation_receipt" class="give-table"> |
@@ -225,11 +225,11 @@ discard block |
||
| 225 | 225 | * @param object $payment The payment object. |
| 226 | 226 | * @param array $give_receipt_args Receipt_argument. |
| 227 | 227 | */ |
| 228 | - do_action( 'give_payment_receipt_header_before', $payment, $give_receipt_args ); |
|
| 228 | + do_action('give_payment_receipt_header_before', $payment, $give_receipt_args); |
|
| 229 | 229 | ?> |
| 230 | 230 | <tr> |
| 231 | 231 | <th scope="colgroup" colspan="2"> |
| 232 | - <span class="give-receipt-thead-text"><?php esc_html_e( 'Donation Receipt', 'give' ) ?></span> |
|
| 232 | + <span class="give-receipt-thead-text"><?php esc_html_e('Donation Receipt', 'give') ?></span> |
|
| 233 | 233 | </th> |
| 234 | 234 | </tr> |
| 235 | 235 | <?php |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | * @param object $payment The payment object. |
| 244 | 244 | * @param array $give_receipt_args Receipt_argument. |
| 245 | 245 | */ |
| 246 | - do_action( 'give_payment_receipt_header_after', $payment, $give_receipt_args ); |
|
| 246 | + do_action('give_payment_receipt_header_after', $payment, $give_receipt_args); |
|
| 247 | 247 | ?> |
| 248 | 248 | </thead> |
| 249 | 249 | |
@@ -259,11 +259,11 @@ discard block |
||
| 259 | 259 | * @param object $payment The payment object. |
| 260 | 260 | * @param array $give_receipt_args Receipt_argument. |
| 261 | 261 | */ |
| 262 | - do_action( 'give_payment_receipt_before', $payment, $give_receipt_args ); |
|
| 262 | + do_action('give_payment_receipt_before', $payment, $give_receipt_args); |
|
| 263 | 263 | ?> |
| 264 | 264 | |
| 265 | - <?php foreach ( $give_receipt_args['donation_receipt'] as $receipt_item ) { ?> |
|
| 266 | - <?php if ( filter_var( $receipt_item['display'], FILTER_VALIDATE_BOOLEAN ) ) : ?> |
|
| 265 | + <?php foreach ($give_receipt_args['donation_receipt'] as $receipt_item) { ?> |
|
| 266 | + <?php if (filter_var($receipt_item['display'], FILTER_VALIDATE_BOOLEAN)) : ?> |
|
| 267 | 267 | <tr> |
| 268 | 268 | <td scope="row"><strong><?php echo $receipt_item['name']; ?></strong></td> |
| 269 | 269 | <td><?php echo $receipt_item['value']; ?></td> |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | * @param object $payment The payment object. |
| 283 | 283 | * @param array $give_receipt_args Receipt_argument. |
| 284 | 284 | */ |
| 285 | - do_action( 'give_payment_receipt_after', $payment, $give_receipt_args ); |
|
| 285 | + do_action('give_payment_receipt_after', $payment, $give_receipt_args); |
|
| 286 | 286 | ?> |
| 287 | 287 | </tbody> |
| 288 | 288 | </table> |
@@ -298,5 +298,5 @@ discard block |
||
| 298 | 298 | * @param object $payment The payment object. |
| 299 | 299 | * @param array $give_receipt_args Receipt_argument. |
| 300 | 300 | */ |
| 301 | -do_action( 'give_payment_receipt_after_table', $payment, $give_receipt_args ); |
|
| 301 | +do_action('give_payment_receipt_after_table', $payment, $give_receipt_args); |
|
| 302 | 302 | ?> |