Test Failed
Push — master ( 1a37a7...d665bf )
by Devin
08:39 queued 02:37
created
templates/history-donations.php 2 patches
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -4,56 +4,56 @@  discard block
 block discarded – undo
4 4
  */
5 5
 
6 6
 $donations             = array();
7
-$donation_history_args = Give()->session->get( 'give_donation_history_args' );
7
+$donation_history_args = Give()->session->get('give_donation_history_args');
8 8
 
9 9
 // User's Donations.
10
-if ( is_user_logged_in() ) {
11
-	$donations = give_get_users_donations( get_current_user_id(), 20, true, 'any' );
12
-} elseif ( Give()->email_access->token_exists ) {
10
+if (is_user_logged_in()) {
11
+	$donations = give_get_users_donations(get_current_user_id(), 20, true, 'any');
12
+} elseif (Give()->email_access->token_exists) {
13 13
 	// Email Access Token?
14
-	$donations = give_get_users_donations( 0, 20, true, 'any' );
14
+	$donations = give_get_users_donations(0, 20, true, 'any');
15 15
 } elseif (
16 16
 	false !== Give()->session->get_session_expiration() ||
17 17
 	true === give_get_history_session()
18 18
 ) {
19 19
 	// Session active?
20
-	$email           = Give()->session->get( 'give_email' );
21
-	$donor           = Give()->donors->get_donor_by( 'email', $email );
22
-	$donations_count = count( explode( ',', $donor->payment_ids ) );
20
+	$email           = Give()->session->get('give_email');
21
+	$donor           = Give()->donors->get_donor_by('email', $email);
22
+	$donations_count = count(explode(',', $donor->payment_ids));
23 23
 
24
-	if ( $donations_count > give_get_limit_display_donations() ) {
24
+	if ($donations_count > give_get_limit_display_donations()) {
25 25
 
26 26
 		// Restrict Security Email Access option, if donation count of a donor is less than or equal to limit.
27
-		if ( true !== Give_Cache::get( "give_cache_email_throttle_limit_exhausted_{$donor->id}" ) ) {
28
-			add_action( 'give_donation_history_table_end', 'give_donation_history_table_end' );
27
+		if (true !== Give_Cache::get("give_cache_email_throttle_limit_exhausted_{$donor->id}")) {
28
+			add_action('give_donation_history_table_end', 'give_donation_history_table_end');
29 29
 		} else {
30 30
 			$value = Give()->email_access->verify_throttle / 60;
31 31
 
32
-			give_set_error( 'give-limited-throttle', sprintf(
33
-				__( 'Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give' ),
34
-				sprintf( _n( '%s minute', '%s minutes', $value, 'give' ), $value )
35
-			) );
32
+			give_set_error('give-limited-throttle', sprintf(
33
+				__('Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give'),
34
+				sprintf(_n('%s minute', '%s minutes', $value, 'give'), $value)
35
+			));
36 36
 
37 37
 		}
38 38
 
39
-		$donations = give_get_users_donations( $email, give_get_limit_display_donations(), true, 'any' );
39
+		$donations = give_get_users_donations($email, give_get_limit_display_donations(), true, 'any');
40 40
 	} else {
41
-		$donations = give_get_users_donations( $email, 20, true, 'any' );
41
+		$donations = give_get_users_donations($email, 20, true, 'any');
42 42
 	}
43 43
 }
44 44
 
45
-Give()->notices->render_frontend_notices( 0 );
45
+Give()->notices->render_frontend_notices(0);
46 46
 
47
-if ( $donations ) : ?>
47
+if ($donations) : ?>
48 48
 	<?php
49 49
 	$table_headings = array(
50
-		'id'             => __( 'ID', 'give' ),
51
-		'date'           => __( 'Date', 'give' ),
52
-		'donor'          => __( 'Donor', 'give' ),
53
-		'amount'         => __( 'Amount', 'give' ),
54
-		'status'         => __( 'Status', 'give' ),
55
-		'payment_method' => __( 'Payment Method', 'give' ),
56
-		'details'        => __( 'Details', 'give' ),
50
+		'id'             => __('ID', 'give'),
51
+		'date'           => __('Date', 'give'),
52
+		'donor'          => __('Donor', 'give'),
53
+		'amount'         => __('Amount', 'give'),
54
+		'status'         => __('Status', 'give'),
55
+		'payment_method' => __('Payment Method', 'give'),
56
+		'details'        => __('Details', 'give'),
57 57
 	);
58 58
 	?>
59 59
 	<div class="give_user_history_main" >
@@ -69,14 +69,14 @@  discard block
 block discarded – undo
69 69
 				 *
70 70
 				 * @since 1.7
71 71
 				 */
72
-				do_action( 'give_donation_history_header_before' );
72
+				do_action('give_donation_history_header_before');
73 73
 
74
-				foreach ( $donation_history_args as $index => $value ) {
75
-					if ( filter_var( $donation_history_args[ $index ], FILTER_VALIDATE_BOOLEAN ) ) :
74
+				foreach ($donation_history_args as $index => $value) {
75
+					if (filter_var($donation_history_args[$index], FILTER_VALIDATE_BOOLEAN)) :
76 76
 						echo sprintf(
77 77
 							'<th scope="col" class="give-donation-%1$s>">%2$s</th>',
78 78
 							$index,
79
-							$table_headings[ $index ]
79
+							$table_headings[$index]
80 80
 						);
81 81
 					endif;
82 82
 				}
@@ -88,13 +88,13 @@  discard block
 block discarded – undo
88 88
 				 *
89 89
 				 * @since 1.7
90 90
 				 */
91
-				do_action( 'give_donation_history_header_after' );
91
+				do_action('give_donation_history_header_after');
92 92
 				?>
93 93
 			</tr>
94 94
 			</thead>
95
-			<?php foreach ( $donations as $post ) :
96
-				setup_postdata( $post );
97
-				$donation_data = give_get_payment_meta( $post->ID ); ?>
95
+			<?php foreach ($donations as $post) :
96
+				setup_postdata($post);
97
+				$donation_data = give_get_payment_meta($post->ID); ?>
98 98
 				<tr class="give-donation-row">
99 99
 					<?php
100 100
 					/**
@@ -107,37 +107,37 @@  discard block
 block discarded – undo
107 107
 					 * @param int   $post_id       The ID of the post.
108 108
 					 * @param mixed $donation_data Payment meta data.
109 109
 					 */
110
-					do_action( 'give_donation_history_row_start', $post->ID, $donation_data );
110
+					do_action('give_donation_history_row_start', $post->ID, $donation_data);
111 111
 
112
-					if ( filter_var( $donation_history_args['id'], FILTER_VALIDATE_BOOLEAN ) ) :
112
+					if (filter_var($donation_history_args['id'], FILTER_VALIDATE_BOOLEAN)) :
113 113
 						echo sprintf(
114 114
 							'<td class="give-donation-id"><span class="title-for-mobile">%2$s</span>%1$s</td>',
115
-							give_get_payment_number( $post->ID ), esc_html( $table_headings['id'] )
115
+							give_get_payment_number($post->ID), esc_html($table_headings['id'])
116 116
 						);
117 117
 					endif;
118 118
 
119
-					if ( filter_var( $donation_history_args['date'], FILTER_VALIDATE_BOOLEAN ) ) :
119
+					if (filter_var($donation_history_args['date'], FILTER_VALIDATE_BOOLEAN)) :
120 120
 						echo sprintf(
121 121
 							'<td class="give-donation-date"><span class="title-for-mobile">%2$s</span>%1$s</td>',
122
-							date_i18n( give_date_format(), strtotime( get_post_field( 'post_date', $post->ID ) ) ), esc_html( $table_headings['date'] )
122
+							date_i18n(give_date_format(), strtotime(get_post_field('post_date', $post->ID))), esc_html($table_headings['date'])
123 123
 						);
124 124
 					endif;
125 125
 
126
-					if ( filter_var( $donation_history_args['donor'], FILTER_VALIDATE_BOOLEAN ) ) :
126
+					if (filter_var($donation_history_args['donor'], FILTER_VALIDATE_BOOLEAN)) :
127 127
 						echo sprintf(
128 128
 							'<td class="give-donation-donor"><span class="title-for-mobile">%2$s</span>%1$s</td>',
129
-							give_get_donor_name_by( $post->ID ), $table_headings['donor']
129
+							give_get_donor_name_by($post->ID), $table_headings['donor']
130 130
 						);
131 131
 					endif;
132 132
 					?>
133 133
 
134
-					<?php if ( filter_var( $donation_history_args['amount'], FILTER_VALIDATE_BOOLEAN ) ) : ?>
134
+					<?php if (filter_var($donation_history_args['amount'], FILTER_VALIDATE_BOOLEAN)) : ?>
135 135
 						<td class="give-donation-amount">
136
-						<?php printf( '<span class="title-for-mobile">%1$s</span>', esc_html( $table_headings['amount'] ) ); ?>
136
+						<?php printf('<span class="title-for-mobile">%1$s</span>', esc_html($table_headings['amount'])); ?>
137 137
 						<span class="give-donation-amount">
138 138
 							<?php
139
-							$currency_code   = give_get_payment_currency_code( $post->ID );
140
-							$donation_amount = give_donation_amount( $post->ID, true );
139
+							$currency_code   = give_get_payment_currency_code($post->ID);
140
+							$donation_amount = give_donation_amount($post->ID, true);
141 141
 
142 142
 							/**
143 143
 							 * Filters the donation amount on Donation History Page.
@@ -149,45 +149,45 @@  discard block
 block discarded – undo
149 149
 							 *
150 150
 							 * @return int
151 151
 							 */
152
-							echo apply_filters( 'give_donation_history_row_amount', $donation_amount, $post->ID );
152
+							echo apply_filters('give_donation_history_row_amount', $donation_amount, $post->ID);
153 153
 							?>
154 154
 						</span>
155 155
 						</td>
156 156
 					<?php endif; ?>
157 157
 
158 158
 					<?php
159
-					if ( filter_var( $donation_history_args['status'], FILTER_VALIDATE_BOOLEAN ) ) :
159
+					if (filter_var($donation_history_args['status'], FILTER_VALIDATE_BOOLEAN)) :
160 160
 						echo sprintf(
161 161
 							'<td class="give-donation-status"><span class="title-for-mobile">%2$s</span>%1$s</td>',
162
-							give_get_payment_status( $post, true ),
163
-							esc_html( $table_headings['status'] )
162
+							give_get_payment_status($post, true),
163
+							esc_html($table_headings['status'])
164 164
 						);
165 165
 					endif;
166 166
 
167
-					if ( filter_var( $donation_history_args['payment_method'], FILTER_VALIDATE_BOOLEAN ) ) :
167
+					if (filter_var($donation_history_args['payment_method'], FILTER_VALIDATE_BOOLEAN)) :
168 168
 						echo sprintf(
169 169
 							'<td class="give-donation-payment-method"><span class="title-for-mobile">%2$s</span>%1$s</td>',
170
-							give_get_gateway_checkout_label( give_get_payment_gateway( $post->ID ) ),
171
-							esc_html( $table_headings['payment_method'] )
170
+							give_get_gateway_checkout_label(give_get_payment_gateway($post->ID)),
171
+							esc_html($table_headings['payment_method'])
172 172
 						);
173 173
 					endif;
174 174
 					?>
175 175
 					<td class="give-donation-details">
176 176
 						<?php
177 177
 						// Display View Receipt or.
178
-						if ( 'publish' !== $post->post_status && 'subscription' !== $post->post_status ) :
178
+						if ('publish' !== $post->post_status && 'subscription' !== $post->post_status) :
179 179
 							echo sprintf(
180 180
 								'<span class="title-for-mobile">%4$s</span><a href="%1$s"><span class="give-donation-status %2$s">%3$s</span></a>',
181 181
 								esc_url(
182 182
 									add_query_arg(
183 183
 										'payment_key',
184
-										give_get_payment_key( $post->ID ),
184
+										give_get_payment_key($post->ID),
185 185
 										give_get_history_page_uri()
186 186
 									)
187 187
 								),
188 188
 								$post->post_status,
189
-								__( 'View', 'give' ) . ' ' . give_get_payment_status( $post, true ) . ' &raquo;',
190
-								esc_html( $table_headings['details'] )
189
+								__('View', 'give').' '.give_get_payment_status($post, true).' &raquo;',
190
+								esc_html($table_headings['details'])
191 191
 							);
192 192
 
193 193
 						else :
@@ -196,12 +196,12 @@  discard block
 block discarded – undo
196 196
 								esc_url(
197 197
 									add_query_arg(
198 198
 										'payment_key',
199
-										give_get_payment_key( $post->ID ),
199
+										give_get_payment_key($post->ID),
200 200
 										give_get_history_page_uri()
201 201
 									)
202 202
 								),
203
-								__( 'View Receipt &raquo;', 'give' ),
204
-								esc_html( $table_headings['details'] )
203
+								__('View Receipt &raquo;', 'give'),
204
+								esc_html($table_headings['details'])
205 205
 							);
206 206
 
207 207
 						endif;
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 					 * @param int   $post_id       The ID of the post.
219 219
 					 * @param mixed $donation_data Payment meta data.
220 220
 					 */
221
-					do_action( 'give_donation_history_row_end', $post->ID, $donation_data );
221
+					do_action('give_donation_history_row_end', $post->ID, $donation_data);
222 222
 					?>
223 223
 				</tr>
224 224
 			<?php endforeach; ?>
@@ -231,22 +231,22 @@  discard block
 block discarded – undo
231 231
 			 *
232 232
 			 * @since 1.8.17
233 233
 			 */
234
-			do_action( 'give_donation_history_table_end' );
234
+			do_action('give_donation_history_table_end');
235 235
 			?>
236 236
 		</table>
237 237
 		<div id="give-donation-history-pagination" class="give_pagination navigation">
238 238
 			<?php
239 239
 			$big = 999999;
240
-			echo paginate_links( array(
241
-				'base'    => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
240
+			echo paginate_links(array(
241
+				'base'    => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
242 242
 				'format'  => '?paged=%#%',
243
-				'current' => max( 1, get_query_var( 'paged' ) ),
244
-				'total'   => ceil( give_count_donations_of_donor() / 20 ), // 20 items per page
245
-			) );
243
+				'current' => max(1, get_query_var('paged')),
244
+				'total'   => ceil(give_count_donations_of_donor() / 20), // 20 items per page
245
+			));
246 246
 			?>
247 247
 		</div>
248 248
 	</div>
249 249
 	<?php wp_reset_postdata(); ?>
250 250
 <?php else : ?>
251
-	<?php Give()->notices->print_frontend_notice( __( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' ); ?>
251
+	<?php Give()->notices->print_frontend_notice(__('It looks like you haven\'t made any donations.', 'give'), true, 'success'); ?>
252 252
 <?php endif;
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -190,7 +190,8 @@  discard block
 block discarded – undo
190 190
 								esc_html( $table_headings['details'] )
191 191
 							);
192 192
 
193
-						else :
193
+						else {
194
+							:
194 195
 							echo sprintf(
195 196
 								'<span class="title-for-mobile">%3$s</span><a href="%1$s">%2$s</a>',
196 197
 								esc_url(
@@ -203,6 +204,7 @@  discard block
 block discarded – undo
203 204
 								__( 'View Receipt &raquo;', 'give' ),
204 205
 								esc_html( $table_headings['details'] )
205 206
 							);
207
+						}
206 208
 
207 209
 						endif;
208 210
 						?>
@@ -247,6 +249,9 @@  discard block
 block discarded – undo
247 249
 		</div>
248 250
 	</div>
249 251
 	<?php wp_reset_postdata(); ?>
250
-<?php else : ?>
251
-	<?php Give()->notices->print_frontend_notice( __( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' ); ?>
252
+<?php else {
253
+	: ?>
254
+	<?php Give()->notices->print_frontend_notice( __( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' );
255
+}
256
+?>
252 257
 <?php endif;
Please login to merge, or discard this patch.
templates/shortcode-totals-progress.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -4,26 +4,26 @@  discard block
 block discarded – undo
4 4
  */
5 5
 
6 6
 // Bail out if total goal is empty.
7
-if ( empty( $total_goal ) ) {
7
+if (empty($total_goal)) {
8 8
 	return false;
9 9
 }
10 10
 
11 11
 // Set Give total progress bar color.
12
-$color = apply_filters( 'give_totals_progress_color', '#2bc253' );
12
+$color = apply_filters('give_totals_progress_color', '#2bc253');
13 13
 
14 14
 // Give total.
15
-$total = ! empty( $total ) ? $total : 0;
15
+$total = ! empty($total) ? $total : 0;
16 16
 
17 17
 /**
18 18
  * Filter the goal progress output
19 19
  *
20 20
  * @since 2.1
21 21
  */
22
-$progress = round( ( $total / $total_goal ) * 100, 2 );
22
+$progress = round(($total / $total_goal) * 100, 2);
23 23
 
24 24
 // Set progress to 100 percentage if total > total_goal
25 25
 $progress = $total >= $total_goal ? 100 : $progress;
26
-$progress = apply_filters( 'give_goal_totals_funded_percentage_output', $progress, $total, $total_goal );
26
+$progress = apply_filters('give_goal_totals_funded_percentage_output', $progress, $total, $total_goal);
27 27
 
28 28
 ?>
29 29
 <div class="give-goal-progress">
@@ -31,16 +31,16 @@  discard block
 block discarded – undo
31 31
 		<?php
32 32
 		echo sprintf(
33 33
 		/* translators: %s: percentage of the amount raised compared to the goal target */
34
-			__( '<span class="give-percentage">%s%%</span> funded', 'give' ),
35
-			round( $progress )
34
+			__('<span class="give-percentage">%s%%</span> funded', 'give'),
35
+			round($progress)
36 36
 		);
37 37
 		?>
38 38
 	</div>
39 39
 
40 40
 	<div class="give-progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100"
41
-	     aria-valuenow="<?php echo esc_attr( $progress ); ?>">
42
-			<span style="width: <?php echo esc_attr( $progress ); ?>%;<?php if ( ! empty( $color ) ) {
43
-				echo 'background-color:' . $color;
41
+	     aria-valuenow="<?php echo esc_attr($progress); ?>">
42
+			<span style="width: <?php echo esc_attr($progress); ?>%;<?php if ( ! empty($color)) {
43
+				echo 'background-color:'.$color;
44 44
 			} ?>"></span>
45 45
 	</div><!-- /.give-progress-bar -->
46 46
 
Please login to merge, or discard this patch.
templates/shortcode-profile-editor.php 2 patches
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -7,25 +7,25 @@  discard block
 block discarded – undo
7 7
  * @copyright    Copyright (c) 2016, WordImpress
8 8
  * @license      https://opensource.org/licenses/gpl-license GNU Public License
9 9
  */
10
-$current_user     = wp_get_current_user();
10
+$current_user = wp_get_current_user();
11 11
 
12
-if ( is_user_logged_in() ) :
12
+if (is_user_logged_in()) :
13 13
 	$user_id = get_current_user_id();
14
-	$first_name   = get_user_meta( $user_id, 'first_name', true );
15
-	$last_name    = get_user_meta( $user_id, 'last_name', true );
16
-	$last_name    = get_user_meta( $user_id, 'last_name', true );
14
+	$first_name   = get_user_meta($user_id, 'first_name', true);
15
+	$last_name    = get_user_meta($user_id, 'last_name', true);
16
+	$last_name    = get_user_meta($user_id, 'last_name', true);
17 17
 	$display_name = $current_user->display_name;
18
-	$address      = give_get_donor_address( $user_id, array( 'address_type' => 'personal' ) );
18
+	$address      = give_get_donor_address($user_id, array('address_type' => 'personal'));
19 19
 
20
-	$donor        = new Give_Donor( $user_id, true );
21
-	$company_name = $donor->get_meta( '_give_donor_company', true );
20
+	$donor        = new Give_Donor($user_id, true);
21
+	$company_name = $donor->get_meta('_give_donor_company', true);
22 22
 
23
-	if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] && ! give_get_errors() ) :
24
-		if ( isset( $_GET['update_code'] ) ) :?>
23
+	if (isset($_GET['updated']) && 'true' === $_GET['updated'] && ! give_get_errors()) :
24
+		if (isset($_GET['update_code'])) :?>
25 25
 			<?php
26
-			switch ( $_GET['update_code'] ) {
26
+			switch ($_GET['update_code']) {
27 27
 				case '1':
28
-					printf( '<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__( 'Success:', 'give' ), esc_html__( 'Your profile has been updated.', 'give' ) );
28
+					printf('<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__('Success:', 'give'), esc_html__('Your profile has been updated.', 'give'));
29 29
 					break;
30 30
 			}
31 31
 			?>
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 		<?php endif; ?>
34 34
 	<?php endif; ?>
35 35
 
36
-	<?php Give()->notices->render_frontend_notices( 0 ); ?>
36
+	<?php Give()->notices->render_frontend_notices(0); ?>
37 37
 
38 38
 	<?php
39 39
 	/**
@@ -43,59 +43,59 @@  discard block
 block discarded – undo
43 43
 	 *
44 44
 	 * @since 1.0
45 45
 	 */
46
-	do_action( 'give_profile_editor_before' );
46
+	do_action('give_profile_editor_before');
47 47
 	?>
48 48
 
49 49
 	<form id="give_profile_editor_form" class="give-form" action="<?php echo give_get_current_page_url(); ?>"
50 50
 	      method="post">
51 51
 
52 52
 		<fieldset>
53
-			<legend id="give_profile_name_label"><?php _e( 'Profile', 'give' ); ?></legend>
53
+			<legend id="give_profile_name_label"><?php _e('Profile', 'give'); ?></legend>
54 54
 
55 55
 			<h3 id="give_personal_information_label"
56
-			    class="give-section-break"><?php _e( 'Change your Name', 'give' ); ?></h3>
56
+			    class="give-section-break"><?php _e('Change your Name', 'give'); ?></h3>
57 57
 
58 58
 			<p id="give_profile_first_name_wrap" class="form-row form-row-first form-row-responsive">
59 59
 				<label for="give_first_name">
60
-					<?php _e( 'First Name', 'give' ); ?>
60
+					<?php _e('First Name', 'give'); ?>
61 61
 					<span class="give-required-indicator  ">*</span>
62 62
 				</label>
63 63
 				<input name="give_first_name" id="give_first_name" class="text give-input" type="text"
64
-				       value="<?php echo esc_attr( $first_name ); ?>"/>
64
+				       value="<?php echo esc_attr($first_name); ?>"/>
65 65
 			</p>
66 66
 
67 67
 			<p id="give_profile_last_name_wrap" class="form-row form-row-last form-row-responsive">
68
-				<label for="give_last_name"><?php _e( 'Last Name', 'give' ); ?></label>
68
+				<label for="give_last_name"><?php _e('Last Name', 'give'); ?></label>
69 69
 				<input name="give_last_name" id="give_last_name" class="text give-input" type="text"
70
-				       value="<?php echo esc_attr( $last_name ); ?>"/>
70
+				       value="<?php echo esc_attr($last_name); ?>"/>
71 71
 			</p>
72 72
 
73
-			<?php if ( ! empty( $company_name ) ) : ?>
73
+			<?php if ( ! empty($company_name)) : ?>
74 74
 				<p id="give_profile_company_name_wrap" class="form-row form-row-wide">
75
-					<label for="give_company_name"><?php _e( 'Company Name', 'give' ); ?></label>
75
+					<label for="give_company_name"><?php _e('Company Name', 'give'); ?></label>
76 76
 					<input name="give_company_name" id="give_company_name" class="text give-input" type="text"
77
-					       value="<?php echo esc_attr( $company_name ); ?>"/>
77
+					       value="<?php echo esc_attr($company_name); ?>"/>
78 78
 				</p>
79 79
 			<?php endif; ?>
80 80
 
81 81
 			<p id="give_profile_display_name_wrap" class="form-row form-row-first form-row-responsive">
82
-				<label for="give_display_name"><?php _e( 'Display Name', 'give' ); ?></label>
82
+				<label for="give_display_name"><?php _e('Display Name', 'give'); ?></label>
83 83
 				<select name="give_display_name" id="give_display_name" class="select give-select">
84
-					<?php if ( ! empty( $current_user->first_name ) ): ?>
85
-						<option <?php selected( $display_name, $current_user->first_name ); ?>
86
-							value="<?php echo esc_attr( $current_user->first_name ); ?>"><?php echo esc_html( $current_user->first_name ); ?></option>
84
+					<?php if ( ! empty($current_user->first_name)): ?>
85
+						<option <?php selected($display_name, $current_user->first_name); ?>
86
+							value="<?php echo esc_attr($current_user->first_name); ?>"><?php echo esc_html($current_user->first_name); ?></option>
87 87
 					<?php endif; ?>
88
-					<option <?php selected( $display_name, $current_user->user_nicename ); ?>
89
-						value="<?php echo esc_attr( $current_user->user_nicename ); ?>"><?php echo esc_html( $current_user->user_nicename ); ?></option>
90
-					<?php if ( ! empty( $current_user->last_name ) ): ?>
91
-						<option <?php selected( $display_name, $current_user->last_name ); ?>
92
-							value="<?php echo esc_attr( $current_user->last_name ); ?>"><?php echo esc_html( $current_user->last_name ); ?></option>
88
+					<option <?php selected($display_name, $current_user->user_nicename); ?>
89
+						value="<?php echo esc_attr($current_user->user_nicename); ?>"><?php echo esc_html($current_user->user_nicename); ?></option>
90
+					<?php if ( ! empty($current_user->last_name)): ?>
91
+						<option <?php selected($display_name, $current_user->last_name); ?>
92
+							value="<?php echo esc_attr($current_user->last_name); ?>"><?php echo esc_html($current_user->last_name); ?></option>
93 93
 					<?php endif; ?>
94
-					<?php if ( ! empty( $current_user->first_name ) && ! empty( $current_user->last_name ) ): ?>
95
-						<option <?php selected( $display_name, $current_user->first_name . ' ' . $current_user->last_name ); ?>
96
-							value="<?php echo esc_attr( $current_user->first_name . ' ' . $current_user->last_name ); ?>"><?php echo esc_html( $current_user->first_name . ' ' . $current_user->last_name ); ?></option>
97
-						<option <?php selected( $display_name, $current_user->last_name . ' ' . $current_user->first_name ); ?>
98
-							value="<?php echo esc_attr( $current_user->last_name . ' ' . $current_user->first_name ); ?>"><?php echo esc_html( $current_user->last_name . ' ' . $current_user->first_name ); ?></option>
94
+					<?php if ( ! empty($current_user->first_name) && ! empty($current_user->last_name)): ?>
95
+						<option <?php selected($display_name, $current_user->first_name.' '.$current_user->last_name); ?>
96
+							value="<?php echo esc_attr($current_user->first_name.' '.$current_user->last_name); ?>"><?php echo esc_html($current_user->first_name.' '.$current_user->last_name); ?></option>
97
+						<option <?php selected($display_name, $current_user->last_name.' '.$current_user->first_name); ?>
98
+							value="<?php echo esc_attr($current_user->last_name.' '.$current_user->first_name); ?>"><?php echo esc_html($current_user->last_name.' '.$current_user->first_name); ?></option>
99 99
 					<?php endif; ?>
100 100
 				</select>
101 101
 				<?php
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 				 *
107 107
 				 * @since 1.0
108 108
 				 */
109
-				do_action( 'give_profile_editor_name' );
109
+				do_action('give_profile_editor_name');
110 110
 				?>
111 111
 			</p>
112 112
 
@@ -118,16 +118,16 @@  discard block
 block discarded – undo
118 118
 			 *
119 119
 			 * @since 1.0
120 120
 			 */
121
-			do_action( 'give_profile_editor_after_name' );
121
+			do_action('give_profile_editor_after_name');
122 122
 			?>
123 123
 
124 124
 			<p class="form-row form-row-last form-row-responsive">
125 125
 				<label for="give_email">
126
-					<?php _e( 'Email Address', 'give' ); ?>
126
+					<?php _e('Email Address', 'give'); ?>
127 127
 					<span class="give-required-indicator  ">*</span>
128 128
 				</label>
129 129
 				<input name="give_email" id="give_email" class="text give-input required" type="email"
130
-				       value="<?php echo esc_attr( $current_user->user_email ); ?>" required aria-required="true"/>
130
+				       value="<?php echo esc_attr($current_user->user_email); ?>" required aria-required="true"/>
131 131
 				<?php
132 132
 				/**
133 133
 				 * Fires in the profile editor shortcode, to the email section.
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 				 *
137 137
 				 * @since 1.0
138 138
 				 */
139
-				do_action( 'give_profile_editor_email' );
139
+				do_action('give_profile_editor_email');
140 140
 				?>
141 141
 			</p>
142 142
 
@@ -148,21 +148,21 @@  discard block
 block discarded – undo
148 148
 			 *
149 149
 			 * @since 1.0
150 150
 			 */
151
-			do_action( 'give_profile_editor_after_email' );
151
+			do_action('give_profile_editor_after_email');
152 152
 			?>
153 153
 
154 154
 			<h3 id="give_profile_password_label"
155
-			    class="give-section-break"><?php _e( 'Change your Password', 'give' ); ?></h3>
155
+			    class="give-section-break"><?php _e('Change your Password', 'give'); ?></h3>
156 156
 
157 157
 			<div id="give_profile_password_wrap" class="give-clearfix">
158 158
 				<p id="give_profile_password_wrap_1" class="form-row form-row-first form-row-responsive">
159
-					<label for="give_new_user_pass1"><?php _e( 'New Password', 'give' ); ?></label>
159
+					<label for="give_new_user_pass1"><?php _e('New Password', 'give'); ?></label>
160 160
 					<input name="give_new_user_pass1" id="give_new_user_pass1" class="password give-input"
161 161
 					       type="password"/>
162 162
 				</p>
163 163
 
164 164
 				<p id="give_profile_password_wrap_2" class="form-row form-row-last form-row-responsive">
165
-					<label for="give_new_user_pass2"><?php _e( 'Re-enter Password', 'give' ); ?></label>
165
+					<label for="give_new_user_pass2"><?php _e('Re-enter Password', 'give'); ?></label>
166 166
 					<input name="give_new_user_pass2" id="give_new_user_pass2" class="password give-input"
167 167
 					       type="password"/>
168 168
 					<?php
@@ -173,12 +173,12 @@  discard block
 block discarded – undo
173 173
 					 *
174 174
 					 * @since 1.0
175 175
 					 */
176
-					do_action( 'give_profile_editor_password' );
176
+					do_action('give_profile_editor_password');
177 177
 					?>
178 178
 				</p>
179 179
 			</div>
180 180
 
181
-			<p class="give_password_change_notice"><?php _e( 'Please note after changing your password, you must log back in.', 'give' ); ?></p>
181
+			<p class="give_password_change_notice"><?php _e('Please note after changing your password, you must log back in.', 'give'); ?></p>
182 182
 
183 183
 			<?php
184 184
 			/**
@@ -188,17 +188,17 @@  discard block
 block discarded – undo
188 188
 			 *
189 189
 			 * @since 1.0
190 190
 			 */
191
-			do_action( 'give_profile_editor_after_password' );
191
+			do_action('give_profile_editor_after_password');
192 192
 			?>
193 193
 
194 194
 			<p id="give_profile_submit_wrap">
195 195
 				<input type="hidden" name="give_profile_editor_nonce"
196
-				       value="<?php echo wp_create_nonce( 'give-profile-editor-nonce' ); ?>"/>
196
+				       value="<?php echo wp_create_nonce('give-profile-editor-nonce'); ?>"/>
197 197
 				<input type="hidden" name="give_action" value="edit_user_profile"/>
198 198
 				<input type="hidden" name="give_redirect"
199
-				       value="<?php echo esc_url( give_get_current_page_url() ); ?>"/>
199
+				       value="<?php echo esc_url(give_get_current_page_url()); ?>"/>
200 200
 				<input name="give_profile_editor_submit" id="give_profile_editor_submit" type="submit"
201
-				       class="give_submit" value="<?php _e( 'Save Changes', 'give' ); ?>"/>
201
+				       class="give_submit" value="<?php _e('Save Changes', 'give'); ?>"/>
202 202
 			</p>
203 203
 
204 204
 		</fieldset>
@@ -213,23 +213,23 @@  discard block
 block discarded – undo
213 213
 	 *
214 214
 	 * @since 1.0
215 215
 	 */
216
-	do_action( 'give_profile_editor_after' );
216
+	do_action('give_profile_editor_after');
217 217
 	?>
218 218
 
219 219
 <?php
220 220
 else :
221
-	if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] && ! give_get_errors() ) {
222
-		if ( isset( $_GET['update_code'] ) ) {
223
-			switch ( $_GET['update_code'] ) {
221
+	if (isset($_GET['updated']) && 'true' === $_GET['updated'] && ! give_get_errors()) {
222
+		if (isset($_GET['update_code'])) {
223
+			switch ($_GET['update_code']) {
224 224
 				case '2':
225
-					printf( '<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__( 'Success:', 'give' ), esc_html__( 'Your profile and password has been updated.', 'give' ) );
226
-					_e( 'Login with your new credentials.', 'give' );
225
+					printf('<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__('Success:', 'give'), esc_html__('Your profile and password has been updated.', 'give'));
226
+					_e('Login with your new credentials.', 'give');
227 227
 					echo give_login_form();
228 228
 					break;
229 229
 
230 230
 				case '3':
231
-					printf( '<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__( 'Success:', 'give' ), esc_html__( 'Your password has been updated.', 'give' ) );
232
-					_e( 'Login with your new credentials.', 'give' );
231
+					printf('<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__('Success:', 'give'), esc_html__('Your password has been updated.', 'give'));
232
+					_e('Login with your new credentials.', 'give');
233 233
 					echo give_login_form();
234 234
 					break;
235 235
 
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 			}
239 239
 		}
240 240
 	} else {
241
-		_e( 'You need to login to edit your profile.', 'give' );
241
+		_e('You need to login to edit your profile.', 'give');
242 242
 		echo give_login_form();
243 243
 	}
244 244
 endif;
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -217,12 +217,14 @@
 block discarded – undo
217 217
 	?>
218 218
 
219 219
 <?php
220
-else :
220
+else {
221
+	:
221 222
 	if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] && ! give_get_errors() ) {
222 223
 		if ( isset( $_GET['update_code'] ) ) {
223 224
 			switch ( $_GET['update_code'] ) {
224 225
 				case '2':
225 226
 					printf( '<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__( 'Success:', 'give' ), esc_html__( 'Your profile and password has been updated.', 'give' ) );
227
+}
226 228
 					_e( 'Login with your new credentials.', 'give' );
227 229
 					echo give_login_form();
228 230
 					break;
Please login to merge, or discard this patch.
templates/shortcode-receipt.php 1 patch
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -6,26 +6,26 @@  discard block
 block discarded – undo
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
-$donation_number = Give()->seq_donation_number->get_serial_code( $payment->ID );
22
-$form_id      = give_get_payment_meta( $donation_id, '_give_payment_form_id', true );
23
-$donation     = give_get_donation_form_title( $donation_id );
24
-$user         = give_get_payment_meta_user_info( $donation_id );
25
-$email        = give_get_payment_user_email( $donation_id );
21
+$donation_number = Give()->seq_donation_number->get_serial_code($payment->ID);
22
+$form_id      = give_get_payment_meta($donation_id, '_give_payment_form_id', true);
23
+$donation     = give_get_donation_form_title($donation_id);
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 );
28
-$company_name = give_get_payment_meta( $donation_id, '_give_donation_company', true );
27
+$status_label = give_get_payment_status($payment, true);
28
+$company_name = give_get_payment_meta($donation_id, '_give_donation_company', true);
29 29
 
30 30
 /**
31 31
  * Generate Donation Receipt Arguments.
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
  * @since 1.8.8
37 37
  */
38 38
 $give_receipt_args['donation_receipt']['donor'] = array(
39
-	'name'    => __( 'Donor', 'give' ),
40
-	'value'   => $user['first_name'] . ' ' . $user['last_name'],
39
+	'name'    => __('Donor', 'give'),
40
+	'value'   => $user['first_name'].' '.$user['last_name'],
41 41
 	'display' => $give_receipt_args['donor'],
42 42
 );
43 43
 
@@ -51,50 +51,50 @@  discard block
 block discarded – undo
51 51
  * @return bool show/hide company name in donation receipt page.
52 52
  */
53 53
 $give_receipt_args['donation_receipt']['company_name'] = array(
54
-	'name'    => __( 'Company Name', 'give' ),
55
-	'value'   => esc_attr( $company_name ),
54
+	'name'    => __('Company Name', 'give'),
55
+	'value'   => esc_attr($company_name),
56 56
 	'display' => $give_receipt_args['company_name'],
57 57
 );
58 58
 
59 59
 $give_receipt_args['donation_receipt']['date'] = array(
60
-	'name'    => __( 'Date', 'give' ),
61
-	'value'   => date_i18n( give_date_format(), strtotime( give_get_payment_completed_date( $donation_id ) ) ),
60
+	'name'    => __('Date', 'give'),
61
+	'value'   => date_i18n(give_date_format(), strtotime(give_get_payment_completed_date($donation_id))),
62 62
 	'display' => $give_receipt_args['date'],
63 63
 );
64 64
 
65 65
 $give_receipt_args['donation_receipt']['total_donation'] = array(
66
-	'name'    => __( 'Total Donation', 'give' ),
67
-	'value'   => give_donation_amount( $donation_id, array( 'currency' => true, 'amount' => true, 'type' => 'receipt' ) ),
66
+	'name'    => __('Total Donation', 'give'),
67
+	'value'   => give_donation_amount($donation_id, array('currency' => true, 'amount' => true, 'type' => 'receipt')),
68 68
 	'display' => $give_receipt_args['price'],
69 69
 );
70 70
 
71 71
 $give_receipt_args['donation_receipt']['donation'] = array(
72
-	'name'    => __( 'Donation', 'give' ),
72
+	'name'    => __('Donation', 'give'),
73 73
 	'value'   => $donation,
74 74
 	'display' => true,
75 75
 );
76 76
 
77 77
 $give_receipt_args['donation_receipt']['donation_status'] = array(
78
-	'name'    => __( 'Donation Status', 'give' ),
79
-	'value'   => esc_attr( $status_label ),
78
+	'name'    => __('Donation Status', 'give'),
79
+	'value'   => esc_attr($status_label),
80 80
 	'display' => $give_receipt_args['payment_status'],
81 81
 );
82 82
 
83 83
 $give_receipt_args['donation_receipt']['donation_id'] = array(
84
-	'name'    => __( 'Donation ID', 'give' ),
84
+	'name'    => __('Donation ID', 'give'),
85 85
 	'value'   => $donation_number,
86 86
 	'display' => $give_receipt_args['payment_id'],
87 87
 );
88 88
 
89 89
 $give_receipt_args['donation_receipt']['payment_key'] = array(
90
-	'name'    => __( 'Payment Key', 'give' ),
91
-	'value'   => get_post_meta( $donation_id, '_give_payment_purchase_key', true ),
90
+	'name'    => __('Payment Key', 'give'),
91
+	'value'   => get_post_meta($donation_id, '_give_payment_purchase_key', true),
92 92
 	'display' => $give_receipt_args['payment_key'],
93 93
 );
94 94
 
95 95
 $give_receipt_args['donation_receipt']['payment_method'] = array(
96
-	'name'    => __( 'Payment Method', 'give' ),
97
-	'value'   => give_get_gateway_checkout_label( give_get_payment_gateway( $donation_id ) ),
96
+	'name'    => __('Payment Method', 'give'),
97
+	'value'   => give_get_gateway_checkout_label(give_get_payment_gateway($donation_id)),
98 98
 	'display' => $give_receipt_args['payment_method'],
99 99
 );
100 100
 
@@ -109,10 +109,10 @@  discard block
 block discarded – undo
109 109
  *
110 110
  * @since 1.8.8
111 111
  */
112
-$give_receipt_args['donation_receipt'] = apply_filters( 'give_donation_receipt_args', $give_receipt_args['donation_receipt'], $donation_id, $form_id );
112
+$give_receipt_args['donation_receipt'] = apply_filters('give_donation_receipt_args', $give_receipt_args['donation_receipt'], $donation_id, $form_id);
113 113
 
114 114
 // When the donation were made through offline donation, We won't show receipt and payment status though.
115
-if ( 'offline' === give_get_payment_gateway( $payment->ID ) && 'pending' === $status ) {
115
+if ('offline' === give_get_payment_gateway($payment->ID) && 'pending' === $status) {
116 116
 
117 117
 	/**
118 118
 	 * Before the offline donation receipt content starts.
@@ -122,13 +122,13 @@  discard block
 block discarded – undo
122 122
 	 * @param Give_Payment $payment           Donation payment object.
123 123
 	 * @param array        $give_receipt_args Receipt Arguments.
124 124
 	 */
125
-	do_action( 'give_receipt_before_offline_payment', $payment, $give_receipt_args );
125
+	do_action('give_receipt_before_offline_payment', $payment, $give_receipt_args);
126 126
 	?>
127
-	<h2><?php echo apply_filters( 'give_receipt_offline_payment_heading', __( 'Your Donation is Almost Complete!', 'give' ) ); ?></h2>
128
-	<div id="give_donation_receipt" class="<?php echo esc_attr( apply_filters( 'give_receipt_offline_payment_classes', 'give_receipt_offline_payment' ) ); ?>">
127
+	<h2><?php echo apply_filters('give_receipt_offline_payment_heading', __('Your Donation is Almost Complete!', 'give')); ?></h2>
128
+	<div id="give_donation_receipt" class="<?php echo esc_attr(apply_filters('give_receipt_offline_payment_classes', 'give_receipt_offline_payment')); ?>">
129 129
 		<?php
130 130
 		// Instruction for offline donation.
131
-		$offline_instruction = give_get_offline_payment_instruction( $form_id, true );
131
+		$offline_instruction = give_get_offline_payment_instruction($form_id, true);
132 132
 
133 133
 		/**
134 134
 		 * Instruction for the offline donation.
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 		 * @param Give_Payment $payment             Payment object.
140 140
 		 * @param integer      $form_id             Donation form id.
141 141
 		 */
142
-		echo apply_filters( 'give_receipt_offline_payment_instruction', $offline_instruction, $payment, $form_id );
142
+		echo apply_filters('give_receipt_offline_payment_instruction', $offline_instruction, $payment, $form_id);
143 143
 		?>
144 144
 	</div>
145 145
 	<?php
@@ -151,52 +151,52 @@  discard block
 block discarded – undo
151 151
 	 * @param Give_Payment $payment           Donation payment object.
152 152
 	 * @param array        $give_receipt_args Receipt Arguments.
153 153
 	 */
154
-	do_action( 'give_receipt_after_offline_payment', $payment, $give_receipt_args );
154
+	do_action('give_receipt_after_offline_payment', $payment, $give_receipt_args);
155 155
 
156 156
 	return;
157 157
 }
158 158
 
159 159
 // Show payment status notice based on shortcode attribute.
160
-if ( filter_var( $give_receipt_args['status_notice'], FILTER_VALIDATE_BOOLEAN ) ) {
160
+if (filter_var($give_receipt_args['status_notice'], FILTER_VALIDATE_BOOLEAN)) {
161 161
 	$notice_message = '';
162 162
 	$notice_type    = 'warning';
163 163
 
164
-	switch ( $status ) {
164
+	switch ($status) {
165 165
 		case 'publish':
166
-			$notice_message = __( 'Payment Complete: Thank you for your donation.', 'give' );
166
+			$notice_message = __('Payment Complete: Thank you for your donation.', 'give');
167 167
 			$notice_type    = 'success';
168 168
 			break;
169 169
 		case 'pending':
170
-			$notice_message = __( 'Payment Pending: Your donation is currently processing.', 'give' );
170
+			$notice_message = __('Payment Pending: Your donation is currently processing.', 'give');
171 171
 			$notice_type    = 'warning';
172 172
 			break;
173 173
 		case 'refunded':
174
-			$notice_message = __( 'Payment Refunded: Your donation has been refunded.', 'give' );
174
+			$notice_message = __('Payment Refunded: Your donation has been refunded.', 'give');
175 175
 			$notice_type    = 'warning';
176 176
 			break;
177 177
 		case 'preapproval':
178
-			$notice_message = __( 'Payment Preapproved: Thank you for your donation.', 'give' );
178
+			$notice_message = __('Payment Preapproved: Thank you for your donation.', 'give');
179 179
 			$notice_type    = 'warning';
180 180
 			break;
181 181
 		case 'failed':
182
-			$notice_message = __( 'Payment Failed: Please contact the site owner for assistance.', 'give' );
182
+			$notice_message = __('Payment Failed: Please contact the site owner for assistance.', 'give');
183 183
 			$notice_type    = 'error';
184 184
 			break;
185 185
 		case 'cancelled':
186
-			$notice_message = __( 'Payment Cancelled: Your donation has been cancelled.', 'give' );
186
+			$notice_message = __('Payment Cancelled: Your donation has been cancelled.', 'give');
187 187
 			$notice_type    = 'error';
188 188
 			break;
189 189
 		case 'abandoned':
190
-			$notice_message = __( 'Payment Abandoned: This donation has not been completed.', 'give' );
190
+			$notice_message = __('Payment Abandoned: This donation has not been completed.', 'give');
191 191
 			$notice_type    = 'error';
192 192
 			break;
193 193
 		case 'revoked':
194
-			$notice_message = __( 'Payment Revoked: Please contact the site owner for assistance.', 'give' );
194
+			$notice_message = __('Payment Revoked: Please contact the site owner for assistance.', 'give');
195 195
 			$notice_type    = 'error';
196 196
 			break;
197 197
 	}
198 198
 
199
-	if ( ! empty( $notice_message ) ) {
199
+	if ( ! empty($notice_message)) {
200 200
 		/**
201 201
 		 * Filters payment status notice for receipts.
202 202
 		 *
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 		 * @param string $status Payment status.
212 212
 		 * @param int $donation_id Donation ID.
213 213
 		 */
214
-		echo apply_filters( 'give_receipt_status_notice', Give()->notices->print_frontend_notice( $notice_message, false, $notice_type ), $id, $status, $donation_id );
214
+		echo apply_filters('give_receipt_status_notice', Give()->notices->print_frontend_notice($notice_message, false, $notice_type), $id, $status, $donation_id);
215 215
 	}
216 216
 }// End if().
217 217
 
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
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_before_table', $payment, $give_receipt_args );
228
+do_action('give_payment_receipt_before_table', $payment, $give_receipt_args);
229 229
 ?>
230 230
 
231 231
 <table id="give_donation_receipt" class="give-table">
@@ -241,11 +241,11 @@  discard block
 block discarded – undo
241 241
 	 * @param object $payment           The payment object.
242 242
 	 * @param array  $give_receipt_args Receipt_argument.
243 243
 	 */
244
-	do_action( 'give_payment_receipt_header_before', $payment, $give_receipt_args );
244
+	do_action('give_payment_receipt_header_before', $payment, $give_receipt_args);
245 245
 	?>
246 246
 	<tr>
247 247
 		<th scope="colgroup" colspan="2">
248
-			<span class="give-receipt-thead-text"><?php esc_html_e( 'Donation Receipt', 'give' ) ?></span>
248
+			<span class="give-receipt-thead-text"><?php esc_html_e('Donation Receipt', 'give') ?></span>
249 249
 		</th>
250 250
 	</tr>
251 251
 	<?php
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
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_header_after', $payment, $give_receipt_args );
262
+	do_action('give_payment_receipt_header_after', $payment, $give_receipt_args);
263 263
 	?>
264 264
 	</thead>
265 265
 
@@ -275,11 +275,11 @@  discard block
 block discarded – undo
275 275
 	 * @param object $payment           The payment object.
276 276
 	 * @param array  $give_receipt_args Receipt_argument.
277 277
 	 */
278
-	do_action( 'give_payment_receipt_before', $payment, $give_receipt_args );
278
+	do_action('give_payment_receipt_before', $payment, $give_receipt_args);
279 279
 	?>
280 280
 
281
-	<?php foreach ( $give_receipt_args['donation_receipt'] as $receipt_item ) { ?>
282
-		<?php if ( filter_var( $receipt_item['display'], FILTER_VALIDATE_BOOLEAN ) ) : ?>
281
+	<?php foreach ($give_receipt_args['donation_receipt'] as $receipt_item) { ?>
282
+		<?php if (filter_var($receipt_item['display'], FILTER_VALIDATE_BOOLEAN)) : ?>
283 283
 			<tr>
284 284
 				<td scope="row"><strong><?php echo $receipt_item['name']; ?></strong></td>
285 285
 				<td><?php echo $receipt_item['value']; ?></td>
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
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', $payment, $give_receipt_args );
301
+	do_action('give_payment_receipt_after', $payment, $give_receipt_args);
302 302
 	?>
303 303
 	</tbody>
304 304
 </table>
@@ -314,5 +314,5 @@  discard block
 block discarded – undo
314 314
  * @param object $payment           The payment object.
315 315
  * @param array  $give_receipt_args Receipt_argument.
316 316
  */
317
-do_action( 'give_payment_receipt_after_table', $payment, $give_receipt_args );
317
+do_action('give_payment_receipt_after_table', $payment, $give_receipt_args);
318 318
 ?>
Please login to merge, or discard this patch.
templates/shortcode-form-grid.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  */
5 5
 
6 6
 // Exit if accessed directly.
7
-if ( ! defined( 'ABSPATH' ) ) {
7
+if ( ! defined('ABSPATH')) {
8 8
 	exit;
9 9
 }
10 10
 
@@ -19,16 +19,16 @@  discard block
 block discarded – undo
19 19
 <div class="give-grid__item">
20 20
 	<?php
21 21
 	// Print the opening anchor tag based on display style.
22
-	if ( 'redirect' === $atts['display_style'] ) {
22
+	if ('redirect' === $atts['display_style']) {
23 23
 		printf(
24 24
 			'<a id="give-card-%1$s" class="give-card" href="%2$s">',
25
-			esc_attr( $form_id ),
26
-			esc_attr( get_the_permalink() )
25
+			esc_attr($form_id),
26
+			esc_attr(get_the_permalink())
27 27
 		);
28
-	} elseif ( 'modal_reveal' === $atts['display_style'] ) {
28
+	} elseif ('modal_reveal' === $atts['display_style']) {
29 29
 		printf(
30 30
 			'<a id="give-card-%1$s" class="give-card js-give-grid-modal-launcher" data-effect="mfp-zoom-out" href="#give-modal-form-%1$s">',
31
-			esc_attr( $form_id )
31
+			esc_attr($form_id)
32 32
 		);
33 33
 	}
34 34
 	?>
@@ -36,46 +36,46 @@  discard block
 block discarded – undo
36 36
 		<div class="give-card__body">
37 37
 			<?php
38 38
 			// Maybe display the form title.
39
-			if ( true === $atts['show_title'] ) {
40
-				the_title( '<h3 class="give-card__title">', '</h3>' );
39
+			if (true === $atts['show_title']) {
40
+				the_title('<h3 class="give-card__title">', '</h3>');
41 41
 			}
42 42
 
43 43
 			// Maybe display the form excerpt.
44
-			if ( true === $atts['show_excerpt'] ) {
45
-				if ( has_excerpt( $form_id ) ) {
44
+			if (true === $atts['show_excerpt']) {
45
+				if (has_excerpt($form_id)) {
46 46
 					// Get excerpt from the form post's excerpt field.
47
-					$raw_content      = get_the_excerpt( $form_id );
47
+					$raw_content      = get_the_excerpt($form_id);
48 48
 					$stripped_content = wp_strip_all_tags(
49
-						strip_shortcodes( $raw_content )
49
+						strip_shortcodes($raw_content)
50 50
 					);
51 51
 				} else {
52 52
 					// Get content from the form post's content field.
53
-					$raw_content = give_get_meta( $form_id, '_give_form_content', true );
53
+					$raw_content = give_get_meta($form_id, '_give_form_content', true);
54 54
 
55
-					if ( ! empty( $raw_content ) ) {
55
+					if ( ! empty($raw_content)) {
56 56
 						$stripped_content = wp_strip_all_tags(
57
-							strip_shortcodes( $raw_content )
57
+							strip_shortcodes($raw_content)
58 58
 						);
59 59
 					}
60 60
 				}
61 61
 
62 62
 				// Maybe truncate excerpt.
63
-				if ( 0 < $atts['excerpt_length'] ) {
64
-					$excerpt = wp_trim_words( $stripped_content, $atts['excerpt_length'] );
63
+				if (0 < $atts['excerpt_length']) {
64
+					$excerpt = wp_trim_words($stripped_content, $atts['excerpt_length']);
65 65
 				} else {
66 66
 					$excerpt = $stripped_content;
67 67
 				}
68 68
 
69
-				printf( '<p class="give-card__text">%s</p>', $excerpt );
69
+				printf('<p class="give-card__text">%s</p>', $excerpt);
70 70
 			}
71 71
 
72 72
 			// Maybe display the goal progess bar.
73 73
 			if (
74
-				give_is_setting_enabled( get_post_meta( $form_id, '_give_goal_option', true ) )
74
+				give_is_setting_enabled(get_post_meta($form_id, '_give_goal_option', true))
75 75
 				&& true === $atts['show_goal']
76 76
 			) {
77 77
 				echo '<div class="give-card__progress">';
78
-					give_show_goal_progress( $form_id );
78
+					give_show_goal_progress($form_id);
79 79
 				echo '</div>';
80 80
 			}
81 81
 			?>
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 		<?php
85 85
 		// Maybe display the featured image.
86 86
 		if (
87
-			give_is_setting_enabled( $give_settings['form_featured_img'] )
87
+			give_is_setting_enabled($give_settings['form_featured_img'])
88 88
 			&& has_post_thumbnail()
89 89
 			&& true === $atts['show_featured_image']
90 90
 		) {
@@ -94,28 +94,28 @@  discard block
 block discarded – undo
94 94
 			 * @param string The image size.
95 95
 			 * @param array  Form grid attributes.
96 96
 			 */
97
-			$image_size = apply_filters( 'give_form_grid_image_size', $atts['image_size'], $atts );
97
+			$image_size = apply_filters('give_form_grid_image_size', $atts['image_size'], $atts);
98 98
 			$image_attr = '';
99 99
 
100 100
 			echo '<div class="give-card__media">';
101
-				if ( 'auto' !== $atts['image_height'] ) {
101
+				if ('auto' !== $atts['image_height']) {
102 102
 					$image_attr = array(
103
-						'style' => 'height: ' . $atts['image_height'],
103
+						'style' => 'height: '.$atts['image_height'],
104 104
 					);
105 105
 				}
106
-				the_post_thumbnail( $image_size, $image_attr );
106
+				the_post_thumbnail($image_size, $image_attr);
107 107
 			echo '</div>';
108 108
 		}
109 109
 		?>
110 110
 	</a>
111 111
 	<?php
112 112
 	// If modal, print form in hidden container until it is time to be revealed.
113
-	if ( 'modal_reveal' === $atts['display_style'] ) {
113
+	if ('modal_reveal' === $atts['display_style']) {
114 114
 		printf(
115 115
 			'<div id="give-modal-form-%1$s" class="give-donation-grid-item-form give-modal--slide mfp-hide">',
116 116
 			$form_id
117 117
 		);
118
-		give_get_donation_form( $form_id );
118
+		give_get_donation_form($form_id);
119 119
 		echo '</div>';
120 120
 	}
121 121
 	?>
Please login to merge, or discard this patch.
templates/shortcode-goal.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,9 +8,9 @@
 block discarded – undo
8 8
 
9 9
 // Sanity check - ensure form has pass all condition to show goal.
10 10
 if ( ( isset( $args['show_goal'] ) && ! filter_var( $args['show_goal'], FILTER_VALIDATE_BOOLEAN ) )
11
-     || empty( $form->ID )
12
-     || ( is_singular( 'give_forms' ) && ! give_is_setting_enabled( $goal_option ) )
13
-     || ! give_is_setting_enabled( $goal_option ) || 0 === $form->goal ) {
11
+	 || empty( $form->ID )
12
+	 || ( is_singular( 'give_forms' ) && ! give_is_setting_enabled( $goal_option ) )
13
+	 || ! give_is_setting_enabled( $goal_option ) || 0 === $form->goal ) {
14 14
 	return false;
15 15
 }
16 16
 
Please login to merge, or discard this patch.
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -3,59 +3,59 @@  discard block
 block discarded – undo
3 3
  * This template is used to display the goal with [give_goal]
4 4
  */
5 5
 
6
-$form        = new Give_Donate_Form( $form_id );
7
-$goal_option = give_get_meta( $form->ID, '_give_goal_option', true );
6
+$form        = new Give_Donate_Form($form_id);
7
+$goal_option = give_get_meta($form->ID, '_give_goal_option', true);
8 8
 
9 9
 // Sanity check - ensure form has pass all condition to show goal.
10
-if ( ( isset( $args['show_goal'] ) && ! filter_var( $args['show_goal'], FILTER_VALIDATE_BOOLEAN ) )
11
-     || empty( $form->ID )
12
-     || ( is_singular( 'give_forms' ) && ! give_is_setting_enabled( $goal_option ) )
13
-     || ! give_is_setting_enabled( $goal_option ) || 0 === $form->goal ) {
10
+if ((isset($args['show_goal']) && ! filter_var($args['show_goal'], FILTER_VALIDATE_BOOLEAN))
11
+     || empty($form->ID)
12
+     || (is_singular('give_forms') && ! give_is_setting_enabled($goal_option))
13
+     || ! give_is_setting_enabled($goal_option) || 0 === $form->goal) {
14 14
 	return false;
15 15
 }
16 16
 
17
-$goal_format = give_get_meta( $form_id, '_give_goal_format', true );
18
-$price       = give_get_meta( $form_id, '_give_set_price', true );
19
-$color       = give_get_meta( $form_id, '_give_goal_color', true );
20
-$show_text   = isset( $args['show_text'] ) ? filter_var( $args['show_text'], FILTER_VALIDATE_BOOLEAN ) : true;
21
-$show_bar    = isset( $args['show_bar'] ) ? filter_var( $args['show_bar'], FILTER_VALIDATE_BOOLEAN ) : true;
17
+$goal_format = give_get_meta($form_id, '_give_goal_format', true);
18
+$price       = give_get_meta($form_id, '_give_set_price', true);
19
+$color       = give_get_meta($form_id, '_give_goal_color', true);
20
+$show_text   = isset($args['show_text']) ? filter_var($args['show_text'], FILTER_VALIDATE_BOOLEAN) : true;
21
+$show_bar    = isset($args['show_bar']) ? filter_var($args['show_bar'], FILTER_VALIDATE_BOOLEAN) : true;
22 22
 
23 23
 /**
24 24
  * Filter the form income
25 25
  *
26 26
  * @since 1.8.8
27 27
  */
28
-$income = apply_filters( 'give_goal_amount_raised_output', $form->get_earnings(), $form_id, $form );
28
+$income = apply_filters('give_goal_amount_raised_output', $form->get_earnings(), $form_id, $form);
29 29
 
30 30
 /**
31 31
  * Filter the form
32 32
  *
33 33
  * @since 1.8.8
34 34
  */
35
-$goal = apply_filters( 'give_goal_amount_target_output', $form->goal, $form_id, $form );
35
+$goal = apply_filters('give_goal_amount_target_output', $form->goal, $form_id, $form);
36 36
 
37
-switch ( $goal_format ) {
37
+switch ($goal_format) {
38 38
 
39 39
 	case  'donation':
40
-		$donations_completed = give_get_form_sales_stats( $form_id );
41
-		$donations_goal      = give_get_meta( $form_id, '_give_number_of_donation_goal', true );
42
-		$progress            = round( ( $donations_completed / $donations_goal ) * 100, 2 );
40
+		$donations_completed = give_get_form_sales_stats($form_id);
41
+		$donations_goal      = give_get_meta($form_id, '_give_number_of_donation_goal', true);
42
+		$progress            = round(($donations_completed / $donations_goal) * 100, 2);
43 43
 		$progress_bar_value  = $donations_completed >= $donations_goal ? 100 : $progress;
44 44
 		break;
45 45
 
46 46
 	case 'donors':
47
-		$donor_goal = give_get_meta( $form_id, '_give_number_of_donor_goal', true );
48
-		$donors     = give_get_form_donor_count( $form_id );
49
-		$progress   = $progress_bar_value = round( ( $donors / $donor_goal ) * 100, 2 );
47
+		$donor_goal = give_get_meta($form_id, '_give_number_of_donor_goal', true);
48
+		$donors     = give_get_form_donor_count($form_id);
49
+		$progress   = $progress_bar_value = round(($donors / $donor_goal) * 100, 2);
50 50
 		break;
51 51
 
52 52
 	case 'percentage':
53
-		$progress           = round( ( $income / $goal ) * 100, 2 );
53
+		$progress           = round(($income / $goal) * 100, 2);
54 54
 		$progress_bar_value = $income >= $goal ? 100 : $progress;
55 55
 		break;
56 56
 
57 57
 	default :
58
-		$progress            = round( ( $income / $goal ) * 100, 2 );
58
+		$progress = round(($income / $goal) * 100, 2);
59 59
 		$progress_bar_value = $income >= $goal ? 100 : $progress;
60 60
 		break;
61 61
 
@@ -66,64 +66,64 @@  discard block
 block discarded – undo
66 66
  *
67 67
  * @since 1.8.8
68 68
  */
69
-$progress = apply_filters( 'give_goal_amount_funded_percentage_output', $progress, $form_id, $form );
69
+$progress = apply_filters('give_goal_amount_funded_percentage_output', $progress, $form_id, $form);
70 70
 ?>
71 71
 <div class="give-goal-progress">
72
-	<?php if ( ! empty( $show_text ) ) : ?>
72
+	<?php if ( ! empty($show_text)) : ?>
73 73
 		<div class="raised">
74 74
 			<?php
75
-			if ( 'amount' === $goal_format ) :
75
+			if ('amount' === $goal_format) :
76 76
 
77 77
 				/**
78 78
 				 * Filter the give currency.
79 79
 				 *
80 80
 				 * @since 1.8.17
81 81
 				 */
82
-				$form_currency = apply_filters( 'give_goal_form_currency', give_get_currency( $form_id ), $form_id );
82
+				$form_currency = apply_filters('give_goal_form_currency', give_get_currency($form_id), $form_id);
83 83
 
84 84
 				/**
85 85
 				 * Filter the income formatting arguments.
86 86
 				 *
87 87
 				 * @since 1.8.17
88 88
 				 */
89
-				$income_format_args = apply_filters( 'give_goal_income_format_args', array(
89
+				$income_format_args = apply_filters('give_goal_income_format_args', array(
90 90
 					'sanitize' => false,
91 91
 					'currency' => $form_currency,
92 92
 					'decimal'  => false
93
-				), $form_id );
93
+				), $form_id);
94 94
 
95 95
 				/**
96 96
 				 * Filter the goal formatting arguments.
97 97
 				 *
98 98
 				 * @since 1.8.17
99 99
 				 */
100
-				$goal_format_args = apply_filters( 'give_goal_amount_format_args', array(
100
+				$goal_format_args = apply_filters('give_goal_amount_format_args', array(
101 101
 					'sanitize' => false,
102 102
 					'currency' => $form_currency,
103 103
 					'decimal'  => false
104
-				), $form_id );
104
+				), $form_id);
105 105
 
106 106
 				// Get formatted amount.
107
-				$income = give_human_format_large_amount( give_format_amount( $income, $income_format_args ), array( 'currency' => $form_currency ) );
108
-				$goal   = give_human_format_large_amount( give_format_amount( $goal, $goal_format_args ), array( 'currency' => $form_currency ) );
107
+				$income = give_human_format_large_amount(give_format_amount($income, $income_format_args), array('currency' => $form_currency));
108
+				$goal   = give_human_format_large_amount(give_format_amount($goal, $goal_format_args), array('currency' => $form_currency));
109 109
 
110 110
 				echo sprintf( /* translators: 1: amount of income raised 2: goal target amount. */
111
-					__( '<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> raised', 'give' ), give_currency_filter( $income, array( 'form_id' => $form_id ) ), give_currency_filter( $goal, array( 'form_id' => $form_id ) ) );
111
+					__('<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> raised', 'give'), give_currency_filter($income, array('form_id' => $form_id)), give_currency_filter($goal, array('form_id' => $form_id)) );
112 112
 
113
-			elseif ( 'percentage' === $goal_format ) :
113
+			elseif ('percentage' === $goal_format) :
114 114
 
115 115
 				echo sprintf( /* translators: %s: percentage of the amount raised compared to the goal target */
116
-					__( '<span class="give-percentage">%s%%</span> funded', 'give' ), round( $progress ) );
116
+					__('<span class="give-percentage">%s%%</span> funded', 'give'), round($progress) );
117 117
 
118
-			elseif ( 'donation' === $goal_format ) :
118
+			elseif ('donation' === $goal_format) :
119 119
 
120 120
 				echo sprintf( /* translators: 1: total number of donations completed 2: total number of donations set as goal */
121
-					_n( '<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donation', '<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donations', $donations_goal, 'give' ), $donations_completed, $donations_goal );
121
+					_n('<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donation', '<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donations', $donations_goal, 'give'), $donations_completed, $donations_goal );
122 122
 
123
-			elseif ( 'donors' === $goal_format ) :
123
+			elseif ('donors' === $goal_format) :
124 124
 
125 125
 				echo sprintf( /* translators: 1: total number of donors completed 2: total number of donors set as goal */
126
-					_n( '<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donation', '<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donors', $donor_goal, 'give' ), $donors, $donor_goal );
126
+					_n('<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donation', '<span class="income">%1$s</span> of <span class="goal-text">%2$s</span> donors', $donor_goal, 'give'), $donors, $donor_goal );
127 127
 
128 128
 			endif;
129 129
 			?>
@@ -131,11 +131,11 @@  discard block
 block discarded – undo
131 131
 	<?php endif; ?>
132 132
 
133 133
 
134
-	<?php if ( ! empty( $show_bar ) ) : ?>
134
+	<?php if ( ! empty($show_bar)) : ?>
135 135
 		<div class="give-progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100"
136
-			 aria-valuenow="<?php echo esc_attr( $progress_bar_value ); ?>">
137
-			<span style="width: <?php echo esc_attr( $progress_bar_value ); ?>%;<?php if ( ! empty( $color ) ) {
138
-				echo 'background-color:' . $color;
136
+			 aria-valuenow="<?php echo esc_attr($progress_bar_value); ?>">
137
+			<span style="width: <?php echo esc_attr($progress_bar_value); ?>%;<?php if ( ! empty($color)) {
138
+				echo 'background-color:'.$color;
139 139
 			} ?>"></span>
140 140
 		</div><!-- /.give-progress-bar -->
141 141
 	<?php endif; ?>
Please login to merge, or discard this patch.
includes/class-give-scripts.php 1 patch
Spacing   +154 added lines, -154 removed lines patch added patch discarded remove patch
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
 	 * @since 2.1.0
38 38
 	 */
39 39
 	public function __construct() {
40
-		$this->direction      = ( is_rtl() || isset( $_GET['d'] ) && 'rtl' === $_GET['d'] ) ? '.rtl' : '';
41
-		$this->scripts_footer = give_is_setting_enabled( give_get_option( 'scripts_footer' ) ) ? true : false;
40
+		$this->direction      = (is_rtl() || isset($_GET['d']) && 'rtl' === $_GET['d']) ? '.rtl' : '';
41
+		$this->scripts_footer = give_is_setting_enabled(give_get_option('scripts_footer')) ? true : false;
42 42
 		$this->init();
43 43
 	}
44 44
 
@@ -49,20 +49,20 @@  discard block
 block discarded – undo
49 49
 	 */
50 50
 	public function init() {
51 51
 
52
-		add_action( 'admin_enqueue_scripts', array( $this, 'register_styles' ) );
53
-		add_action( 'admin_enqueue_scripts', array( $this, 'register_scripts' ) );
54
-		add_action( 'wp_enqueue_scripts', array( $this, 'register_styles' ) );
55
-		add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts' ) );
52
+		add_action('admin_enqueue_scripts', array($this, 'register_styles'));
53
+		add_action('admin_enqueue_scripts', array($this, 'register_scripts'));
54
+		add_action('wp_enqueue_scripts', array($this, 'register_styles'));
55
+		add_action('wp_enqueue_scripts', array($this, 'register_scripts'));
56 56
 
57
-		if ( is_admin() ) {
58
-			add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
59
-			add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_styles' ) );
60
-			add_action( 'enqueue_block_editor_assets', array( $this, 'gutenberg_admin_scripts' ) );
61
-			add_action( 'admin_head', array( $this, 'global_admin_head' ) );
57
+		if (is_admin()) {
58
+			add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
59
+			add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_styles'));
60
+			add_action('enqueue_block_editor_assets', array($this, 'gutenberg_admin_scripts'));
61
+			add_action('admin_head', array($this, 'global_admin_head'));
62 62
 
63 63
 		} else {
64
-			add_action( 'wp_enqueue_scripts', array( $this, 'public_enqueue_styles' ) );
65
-			add_action( 'wp_enqueue_scripts', array( $this, 'public_enqueue_scripts' ) );
64
+			add_action('wp_enqueue_scripts', array($this, 'public_enqueue_styles'));
65
+			add_action('wp_enqueue_scripts', array($this, 'public_enqueue_scripts'));
66 66
 		}
67 67
 	}
68 68
 
@@ -74,11 +74,11 @@  discard block
 block discarded – undo
74 74
 	public function register_styles() {
75 75
 
76 76
 		// WP-admin.
77
-		wp_register_style( 'give-admin-styles', GIVE_PLUGIN_URL . 'assets/dist/css/admin' . $this->direction . '.css', array(), GIVE_VERSION );
77
+		wp_register_style('give-admin-styles', GIVE_PLUGIN_URL.'assets/dist/css/admin'.$this->direction.'.css', array(), GIVE_VERSION);
78 78
 
79 79
 		// Frontend.
80
-		if ( give_is_setting_enabled( give_get_option( 'css' ) ) ) {
81
-			wp_register_style( 'give-styles', $this->get_frontend_stylesheet_uri(), array(), GIVE_VERSION, 'all' );
80
+		if (give_is_setting_enabled(give_get_option('css'))) {
81
+			wp_register_style('give-styles', $this->get_frontend_stylesheet_uri(), array(), GIVE_VERSION, 'all');
82 82
 		}
83 83
 	}
84 84
 
@@ -90,15 +90,15 @@  discard block
 block discarded – undo
90 90
 	public function register_scripts() {
91 91
 
92 92
 		// WP-Admin.
93
-		wp_register_script( 'give-admin-scripts', GIVE_PLUGIN_URL . 'assets/dist/js/admin.js', array(
93
+		wp_register_script('give-admin-scripts', GIVE_PLUGIN_URL.'assets/dist/js/admin.js', array(
94 94
 			'jquery',
95 95
 			'jquery-ui-datepicker',
96 96
 			'wp-color-picker',
97 97
 			'jquery-query',
98
-		), GIVE_VERSION );
98
+		), GIVE_VERSION);
99 99
 
100 100
 		// Frontend.
101
-		wp_register_script( 'give', GIVE_PLUGIN_URL . 'assets/dist/js/give.js', array( 'jquery' ), GIVE_VERSION, $this->scripts_footer );
101
+		wp_register_script('give', GIVE_PLUGIN_URL.'assets/dist/js/give.js', array('jquery'), GIVE_VERSION, $this->scripts_footer);
102 102
 	}
103 103
 
104 104
 	/**
@@ -108,20 +108,20 @@  discard block
 block discarded – undo
108 108
 	 *
109 109
 	 * @param string $hook Page hook.
110 110
 	 */
111
-	public function admin_enqueue_styles( $hook ) {
111
+	public function admin_enqueue_styles($hook) {
112 112
 
113 113
 		// Give Admin Only.
114
-		if ( ! apply_filters( 'give_load_admin_styles', give_is_admin_page(), $hook ) ) {
114
+		if ( ! apply_filters('give_load_admin_styles', give_is_admin_page(), $hook)) {
115 115
 			return;
116 116
 		}
117 117
 
118 118
 		// Give enqueues.
119
-		wp_enqueue_style( 'give-admin-styles' );
120
-		wp_enqueue_style( 'give-admin-bar-notification' );
119
+		wp_enqueue_style('give-admin-styles');
120
+		wp_enqueue_style('give-admin-bar-notification');
121 121
 
122 122
 		// WP Core enqueues.
123
-		wp_enqueue_style( 'wp-color-picker' );
124
-		wp_enqueue_style( 'thickbox' ); // @TODO remove once we have modal API.
123
+		wp_enqueue_style('wp-color-picker');
124
+		wp_enqueue_style('thickbox'); // @TODO remove once we have modal API.
125 125
 
126 126
 	}
127 127
 
@@ -132,21 +132,21 @@  discard block
 block discarded – undo
132 132
 	 *
133 133
 	 * @param string $hook Page hook.
134 134
 	 */
135
-	public function admin_enqueue_scripts( $hook ) {
135
+	public function admin_enqueue_scripts($hook) {
136 136
 
137 137
 		// Give Admin Only.
138
-		if ( ! apply_filters( 'give_load_admin_scripts', give_is_admin_page(), $hook ) ) {
138
+		if ( ! apply_filters('give_load_admin_scripts', give_is_admin_page(), $hook)) {
139 139
 			return;
140 140
 		}
141 141
 
142 142
 		// WP Scripts.
143
-		wp_enqueue_script( 'wp-color-picker' );
144
-		wp_enqueue_script( 'jquery-ui-datepicker' );
145
-		wp_enqueue_script( 'thickbox' );
143
+		wp_enqueue_script('wp-color-picker');
144
+		wp_enqueue_script('jquery-ui-datepicker');
145
+		wp_enqueue_script('thickbox');
146 146
 		wp_enqueue_media();
147 147
 
148 148
 		// Give admin scripts.
149
-		wp_enqueue_script( 'give-admin-scripts' );
149
+		wp_enqueue_script('give-admin-scripts');
150 150
 
151 151
 		// Localize admin scripts
152 152
 		$this->admin_localize_scripts();
@@ -166,111 +166,111 @@  discard block
 block discarded – undo
166 166
 		$decimal_separator  = give_get_price_decimal_separator();
167 167
 
168 168
 		// Localize strings & variables for JS.
169
-		wp_localize_script( 'give-admin-scripts', 'give_vars', array(
170
-			'post_id'                           => isset( $post->ID ) ? $post->ID : null,
169
+		wp_localize_script('give-admin-scripts', 'give_vars', array(
170
+			'post_id'                           => isset($post->ID) ? $post->ID : null,
171 171
 			'give_version'                      => GIVE_VERSION,
172 172
 			'thousands_separator'               => $thousand_separator,
173 173
 			'decimal_separator'                 => $decimal_separator,
174
-			'quick_edit_warning'                => __( 'Not available for variable priced forms.', 'give' ),
175
-			'delete_payment'                    => __( 'Are you sure you want to <strong>permanently</strong> delete this donation?', 'give' ),
176
-			'delete_payment_note'               => __( 'Are you sure you want to delete this note?', 'give' ),
177
-			'revoke_api_key'                    => __( 'Are you sure you want to revoke this API key?', 'give' ),
178
-			'regenerate_api_key'                => __( 'Are you sure you want to regenerate this API key?', 'give' ),
179
-			'resend_receipt'                    => __( 'Are you sure you want to resend the donation receipt?', 'give' ),
180
-			'disconnect_user'                   => __( 'Are you sure you want to disconnect the user from this donor?', 'give' ),
181
-			'one_option'                        => __( 'Choose a form', 'give' ),
182
-			'one_or_more_option'                => __( 'Choose one or more forms', 'give' ),
183
-			'currency_sign'                     => give_currency_filter( '' ),
184
-			'currency_pos'                      => isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before',
174
+			'quick_edit_warning'                => __('Not available for variable priced forms.', 'give'),
175
+			'delete_payment'                    => __('Are you sure you want to <strong>permanently</strong> delete this donation?', 'give'),
176
+			'delete_payment_note'               => __('Are you sure you want to delete this note?', 'give'),
177
+			'revoke_api_key'                    => __('Are you sure you want to revoke this API key?', 'give'),
178
+			'regenerate_api_key'                => __('Are you sure you want to regenerate this API key?', 'give'),
179
+			'resend_receipt'                    => __('Are you sure you want to resend the donation receipt?', 'give'),
180
+			'disconnect_user'                   => __('Are you sure you want to disconnect the user from this donor?', 'give'),
181
+			'one_option'                        => __('Choose a form', 'give'),
182
+			'one_or_more_option'                => __('Choose one or more forms', 'give'),
183
+			'currency_sign'                     => give_currency_filter(''),
184
+			'currency_pos'                      => isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before',
185 185
 			'currency_decimals'                 => give_get_price_decimals(),
186
-			'ok'                                => __( 'Ok', 'give' ),
187
-			'cancel'                            => __( 'Cancel', 'give' ),
188
-			'close'                             => __( 'Close', 'give' ),
189
-			'confirm'                           => __( 'Confirm', 'give' ),
190
-			'confirm_action'                    => __( 'Confirm Action', 'give' ),
191
-			'confirm_deletion'                  => __( 'Confirm Deletion', 'give' ),
192
-			'confirm_delete_donation'           => __( 'Confirm Delete Donation', 'give' ),
193
-			'confirm_resend'                    => __( 'Confirm re-send', 'give' ),
194
-			'confirm_bulk_action'               => __( 'Confirm bulk action', 'give' ),
195
-			'restart_upgrade'                   => __( 'Do you want to restart the update process?', 'give' ),
196
-			'restart_update'                    => __( 'It is recommended that you backup your database before proceeding. Do you want to run the update now?', 'give' ),
197
-			'stop_upgrade'                      => __( 'Do you want to stop the update process now?', 'give' ),
198
-			'import_failed'                     => __( 'Import failed', 'give' ),
199
-			'flush_success'                     => __( 'Flush success', 'give' ),
200
-			'flush_error'                       => __( 'Flush error', 'give' ),
201
-			'batch_export_no_class'             => __( 'You must choose a method.', 'give' ),
202
-			'batch_export_no_reqs'              => __( 'Required fields not completed.', 'give' ),
203
-			'reset_stats_warn'                  => __( 'Are you sure you want to reset Give? This process is <strong><em>not reversible</em></strong> and will delete all data regardless of test or live mode. Please be sure you have a recent backup before proceeding.', 'give' ),
204
-			'delete_test_donor'                 => __( 'Are you sure you want to delete all the test donors? This process will also delete test donations as well.', 'give' ),
205
-			'delete_import_donor'               => __( 'Are you sure you want to delete all the imported donors? This process will also delete imported donations as well.', 'give' ),
206
-			'price_format_guide'                => sprintf( __( 'Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give' ), $decimal_separator, $thousand_separator ),
186
+			'ok'                                => __('Ok', 'give'),
187
+			'cancel'                            => __('Cancel', 'give'),
188
+			'close'                             => __('Close', 'give'),
189
+			'confirm'                           => __('Confirm', 'give'),
190
+			'confirm_action'                    => __('Confirm Action', 'give'),
191
+			'confirm_deletion'                  => __('Confirm Deletion', 'give'),
192
+			'confirm_delete_donation'           => __('Confirm Delete Donation', 'give'),
193
+			'confirm_resend'                    => __('Confirm re-send', 'give'),
194
+			'confirm_bulk_action'               => __('Confirm bulk action', 'give'),
195
+			'restart_upgrade'                   => __('Do you want to restart the update process?', 'give'),
196
+			'restart_update'                    => __('It is recommended that you backup your database before proceeding. Do you want to run the update now?', 'give'),
197
+			'stop_upgrade'                      => __('Do you want to stop the update process now?', 'give'),
198
+			'import_failed'                     => __('Import failed', 'give'),
199
+			'flush_success'                     => __('Flush success', 'give'),
200
+			'flush_error'                       => __('Flush error', 'give'),
201
+			'batch_export_no_class'             => __('You must choose a method.', 'give'),
202
+			'batch_export_no_reqs'              => __('Required fields not completed.', 'give'),
203
+			'reset_stats_warn'                  => __('Are you sure you want to reset Give? This process is <strong><em>not reversible</em></strong> and will delete all data regardless of test or live mode. Please be sure you have a recent backup before proceeding.', 'give'),
204
+			'delete_test_donor'                 => __('Are you sure you want to delete all the test donors? This process will also delete test donations as well.', 'give'),
205
+			'delete_import_donor'               => __('Are you sure you want to delete all the imported donors? This process will also delete imported donations as well.', 'give'),
206
+			'price_format_guide'                => sprintf(__('Please enter amount in monetary decimal ( %1$s ) format without thousand separator ( %2$s ) .', 'give'), $decimal_separator, $thousand_separator),
207 207
 			/* translators : %s: Donation form options metabox */
208
-			'confirm_before_remove_row_text'    => __( 'Do you want to delete this item?', 'give' ),
209
-			'matched_success_failure_page'      => __( 'You cannot set the success and failed pages to the same page', 'give' ),
210
-			'dismiss_notice_text'               => __( 'Dismiss this notice.', 'give' ),
211
-			'search_placeholder'                => __( 'Type to search all forms', 'give' ),
212
-			'search_placeholder_donor'          => __( 'Type to search all donors', 'give' ),
213
-			'search_placeholder_country'        => __( 'Type to search all countries', 'give' ),
214
-			'search_placeholder_state'          => __( 'Type to search all states/provinces', 'give' ),
215
-			'unlock_donor_fields_title'         => __( 'Action forbidden', 'give' ),
216
-			'unlock_donor_fields_message'               => __( 'To edit first name and last name, please go to user profile of the donor.', 'give' ),
217
-			'remove_from_bulk_delete'           => __( 'Remove from Bulk Delete', 'give' ),
208
+			'confirm_before_remove_row_text'    => __('Do you want to delete this item?', 'give'),
209
+			'matched_success_failure_page'      => __('You cannot set the success and failed pages to the same page', 'give'),
210
+			'dismiss_notice_text'               => __('Dismiss this notice.', 'give'),
211
+			'search_placeholder'                => __('Type to search all forms', 'give'),
212
+			'search_placeholder_donor'          => __('Type to search all donors', 'give'),
213
+			'search_placeholder_country'        => __('Type to search all countries', 'give'),
214
+			'search_placeholder_state'          => __('Type to search all states/provinces', 'give'),
215
+			'unlock_donor_fields_title'         => __('Action forbidden', 'give'),
216
+			'unlock_donor_fields_message'               => __('To edit first name and last name, please go to user profile of the donor.', 'give'),
217
+			'remove_from_bulk_delete'           => __('Remove from Bulk Delete', 'give'),
218 218
 			'donors_bulk_action'                => array(
219 219
 				'no_donor_selected'  => array(
220
-					'title' => __( 'No donors selected', 'give' ),
221
-					'desc'  => __( 'You must choose at least one or more donors to delete.', 'give' )
220
+					'title' => __('No donors selected', 'give'),
221
+					'desc'  => __('You must choose at least one or more donors to delete.', 'give')
222 222
 				),
223 223
 				'no_action_selected' => array(
224
-					'title' => __( 'No action selected', 'give' ),
225
-					'desc'  => __( 'You must select a bulk action to proceed.', 'give' ),
224
+					'title' => __('No action selected', 'give'),
225
+					'desc'  => __('You must select a bulk action to proceed.', 'give'),
226 226
 				),
227 227
 			),
228 228
 			'donations_bulk_action'             => array(
229 229
 				'titles'         => array(
230
-					'zero' => __( 'No payments selected', 'give' ),
230
+					'zero' => __('No payments selected', 'give'),
231 231
 				),
232 232
 				'delete'         => array(
233
-					'zero'     => __( 'You must choose at least one or more donations to delete.', 'give' ),
234
-					'single'   => __( 'Are you sure you want to permanently delete this donation?', 'give' ),
235
-					'multiple' => __( 'Are you sure you want to permanently delete the selected {payment_count} donations?', 'give' ),
233
+					'zero'     => __('You must choose at least one or more donations to delete.', 'give'),
234
+					'single'   => __('Are you sure you want to permanently delete this donation?', 'give'),
235
+					'multiple' => __('Are you sure you want to permanently delete the selected {payment_count} donations?', 'give'),
236 236
 				),
237 237
 				'resend-receipt' => array(
238
-					'zero'     => __( 'You must choose at least one or more recipients to resend the email receipt.', 'give' ),
239
-					'single'   => __( 'Are you sure you want to resend the email receipt to this recipient?', 'give' ),
240
-					'multiple' => __( 'Are you sure you want to resend the emails receipt to {payment_count} recipients?', 'give' ),
238
+					'zero'     => __('You must choose at least one or more recipients to resend the email receipt.', 'give'),
239
+					'single'   => __('Are you sure you want to resend the email receipt to this recipient?', 'give'),
240
+					'multiple' => __('Are you sure you want to resend the emails receipt to {payment_count} recipients?', 'give'),
241 241
 				),
242 242
 				'set-to-status'  => array(
243
-					'zero'     => __( 'You must choose at least one or more donations to set status to {status}.', 'give' ),
244
-					'single'   => __( 'Are you sure you want to set status of this donation to {status}?', 'give' ),
245
-					'multiple' => __( 'Are you sure you want to set status of {payment_count} donations to {status}?', 'give' ),
243
+					'zero'     => __('You must choose at least one or more donations to set status to {status}.', 'give'),
244
+					'single'   => __('Are you sure you want to set status of this donation to {status}?', 'give'),
245
+					'multiple' => __('Are you sure you want to set status of {payment_count} donations to {status}?', 'give'),
246 246
 				),
247 247
 			),
248 248
 			'updates'                           => array(
249
-				'ajax_error' => __( 'Please reload this page and try again', 'give' ),
249
+				'ajax_error' => __('Please reload this page and try again', 'give'),
250 250
 			),
251 251
 			'metabox_fields'                    => array(
252 252
 				'media' => array(
253
-					'button_title' => __( 'Choose Image', 'give' ),
253
+					'button_title' => __('Choose Image', 'give'),
254 254
 				),
255 255
 				'file'  => array(
256
-					'button_title' => __( 'Choose File', 'give' ),
256
+					'button_title' => __('Choose File', 'give'),
257 257
 				),
258 258
 			),
259 259
 			'chosen'                            => array(
260
-				'no_results_msg'  => __( 'No results match {search_term}', 'give' ),
261
-				'ajax_search_msg' => __( 'Searching results for match {search_term}', 'give' ),
260
+				'no_results_msg'  => __('No results match {search_term}', 'give'),
261
+				'ajax_search_msg' => __('Searching results for match {search_term}', 'give'),
262 262
 			),
263
-			'db_update_confirmation_msg_button' => __( 'Run Updates', 'give' ),
264
-			'db_update_confirmation_msg'        => __( 'The following process will make updates to your site\'s database. Please create a database backup before proceeding with updates.', 'give' ),
265
-			'error_message'                     => __( 'Something went wrong kindly try again!', 'give' ),
263
+			'db_update_confirmation_msg_button' => __('Run Updates', 'give'),
264
+			'db_update_confirmation_msg'        => __('The following process will make updates to your site\'s database. Please create a database backup before proceeding with updates.', 'give'),
265
+			'error_message'                     => __('Something went wrong kindly try again!', 'give'),
266 266
 			'give_donation_import'              => 'give_donation_import',
267 267
 			'core_settings_import'              => 'give_core_settings_import',
268
-			'setting_not_save_message'          => __( 'Changes you made may not be saved.', 'give' ),
268
+			'setting_not_save_message'          => __('Changes you made may not be saved.', 'give'),
269 269
 			'give_donation_amounts'             => array(
270
-				'minimum' => apply_filters( 'give_donation_minimum_limit', 1 ),
271
-				'maximum' => apply_filters( 'give_donation_maximum_limit', 999999.99 ),
270
+				'minimum' => apply_filters('give_donation_minimum_limit', 1),
271
+				'maximum' => apply_filters('give_donation_maximum_limit', 999999.99),
272 272
 			),
273
-		) );
273
+		));
274 274
 	}
275 275
 
276 276
 	/**
@@ -281,10 +281,10 @@  discard block
 block discarded – undo
281 281
 		<style type="text/css" media="screen">
282 282
 			@font-face {
283 283
 				font-family: 'give-icomoon';
284
-				src: url('<?php echo GIVE_PLUGIN_URL . 'assets/dist/fonts/icomoon.eot?ngjl88'; ?>');
285
-				src: url('<?php echo GIVE_PLUGIN_URL . 'assets/dist/fonts/icomoon.eot?#iefixngjl88'?>') format('embedded-opentype'),
286
-				url('<?php echo GIVE_PLUGIN_URL . 'assets/dist/fonts/icomoon.woff?ngjl88'; ?>') format('woff'),
287
-				url('<?php echo GIVE_PLUGIN_URL . 'assets/dist/fonts/icomoon.svg?ngjl88#icomoon'; ?>') format('svg');
284
+				src: url('<?php echo GIVE_PLUGIN_URL.'assets/dist/fonts/icomoon.eot?ngjl88'; ?>');
285
+				src: url('<?php echo GIVE_PLUGIN_URL.'assets/dist/fonts/icomoon.eot?#iefixngjl88'?>') format('embedded-opentype'),
286
+				url('<?php echo GIVE_PLUGIN_URL.'assets/dist/fonts/icomoon.woff?ngjl88'; ?>') format('woff'),
287
+				url('<?php echo GIVE_PLUGIN_URL.'assets/dist/fonts/icomoon.svg?ngjl88#icomoon'; ?>') format('svg');
288 288
 				font-weight: normal;
289 289
 				font-style: normal;
290 290
 			}
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 	 * @since 2.1.0
308 308
 	 */
309 309
 	public function public_enqueue_styles() {
310
-		wp_enqueue_style( 'give-styles' );
310
+		wp_enqueue_style('give-styles');
311 311
 	}
312 312
 
313 313
 
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 	 * @since 2.1.0
318 318
 	 */
319 319
 	public function public_enqueue_scripts() {
320
-		wp_enqueue_script( 'give' );
320
+		wp_enqueue_script('give');
321 321
 
322 322
 		$this->public_localize_scripts();
323 323
 	}
@@ -327,19 +327,19 @@  discard block
 block discarded – undo
327 327
 	 */
328 328
 	public function public_localize_scripts() {
329 329
 
330
-		$localize_give_vars = apply_filters( 'give_global_script_vars', array(
330
+		$localize_give_vars = apply_filters('give_global_script_vars', array(
331 331
 			'ajaxurl'                    => give_get_ajax_url(),
332
-			'checkout_nonce'             => wp_create_nonce( 'give_checkout_nonce' ), // Do not use this nonce. Its deprecated.
332
+			'checkout_nonce'             => wp_create_nonce('give_checkout_nonce'), // Do not use this nonce. Its deprecated.
333 333
 			'currency'                   => give_get_currency(),
334
-			'currency_sign'              => give_currency_filter( '' ),
334
+			'currency_sign'              => give_currency_filter(''),
335 335
 			'currency_pos'               => give_get_currency_position(),
336 336
 			'thousands_separator'        => give_get_price_thousand_separator(),
337 337
 			'decimal_separator'          => give_get_price_decimal_separator(),
338
-			'no_gateway'                 => __( 'Please select a payment method.', 'give' ),
339
-			'bad_minimum'                => __( 'The minimum custom donation amount for this form is', 'give' ),
340
-			'bad_maximum'                => __( 'The maximum custom donation amount for this form is', 'give' ),
341
-			'general_loading'            => __( 'Loading...', 'give' ),
342
-			'purchase_loading'           => __( 'Please Wait...', 'give' ),
338
+			'no_gateway'                 => __('Please select a payment method.', 'give'),
339
+			'bad_minimum'                => __('The minimum custom donation amount for this form is', 'give'),
340
+			'bad_maximum'                => __('The maximum custom donation amount for this form is', 'give'),
341
+			'general_loading'            => __('Loading...', 'give'),
342
+			'purchase_loading'           => __('Please Wait...', 'give'),
343 343
 			'number_decimals'            => give_get_price_decimals(),
344 344
 			'give_version'               => GIVE_VERSION,
345 345
 			'magnific_options'           => apply_filters(
@@ -353,30 +353,30 @@  discard block
 block discarded – undo
353 353
 				'give_form_translation_js',
354 354
 				array(
355 355
 					// Field name               Validation message.
356
-					'payment-mode'           => __( 'Please select payment mode.', 'give' ),
357
-					'give_first'             => __( 'Please enter your first name.', 'give' ),
358
-					'give_email'             => __( 'Please enter a valid email address.', 'give' ),
359
-					'give_user_login'        => __( 'Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give' ),
360
-					'give_user_pass'         => __( 'Enter a password.', 'give' ),
361
-					'give_user_pass_confirm' => __( 'Enter the password confirmation.', 'give' ),
362
-					'give_agree_to_terms'    => __( 'You must agree to the terms and conditions.', 'give' ),
356
+					'payment-mode'           => __('Please select payment mode.', 'give'),
357
+					'give_first'             => __('Please enter your first name.', 'give'),
358
+					'give_email'             => __('Please enter a valid email address.', 'give'),
359
+					'give_user_login'        => __('Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give'),
360
+					'give_user_pass'         => __('Enter a password.', 'give'),
361
+					'give_user_pass_confirm' => __('Enter the password confirmation.', 'give'),
362
+					'give_agree_to_terms'    => __('You must agree to the terms and conditions.', 'give'),
363 363
 				)
364 364
 			),
365
-			'confirm_email_sent_message' => __( 'Please check your email and click on the link to access your complete donation history.', 'give' ),
366
-			'ajax_vars'                  => apply_filters( 'give_global_ajax_vars', array(
365
+			'confirm_email_sent_message' => __('Please check your email and click on the link to access your complete donation history.', 'give'),
366
+			'ajax_vars'                  => apply_filters('give_global_ajax_vars', array(
367 367
 				'ajaxurl'         => give_get_ajax_url(),
368
-				'ajaxNonce'       => wp_create_nonce( 'give_ajax_nonce' ),
369
-				'loading'         => __( 'Loading', 'give' ),
368
+				'ajaxNonce'       => wp_create_nonce('give_ajax_nonce'),
369
+				'loading'         => __('Loading', 'give'),
370 370
 				// General loading message.
371
-				'select_option'   => __( 'Please select an option', 'give' ),
371
+				'select_option'   => __('Please select an option', 'give'),
372 372
 				// Variable pricing error with multi-donation option enabled.
373
-				'default_gateway' => give_get_default_gateway( null ),
374
-				'permalinks'      => get_option( 'permalink_structure' ) ? '1' : '0',
373
+				'default_gateway' => give_get_default_gateway(null),
374
+				'permalinks'      => get_option('permalink_structure') ? '1' : '0',
375 375
 				'number_decimals' => give_get_price_decimals(),
376
-			) ),
377
-		) );
376
+			)),
377
+		));
378 378
 
379
-		wp_localize_script( 'give', 'give_global_vars', $localize_give_vars );
379
+		wp_localize_script('give', 'give_global_vars', $localize_give_vars);
380 380
 
381 381
 	}
382 382
 
@@ -390,15 +390,15 @@  discard block
 block discarded – undo
390 390
 	 */
391 391
 	public function get_frontend_stylesheet_uri() {
392 392
 
393
-		$file          = 'give' . $this->direction . '.css';
393
+		$file          = 'give'.$this->direction.'.css';
394 394
 		$templates_dir = give_get_theme_template_dir_name();
395 395
 
396 396
 		// Directory paths to CSS files to support checking via file_exists().
397
-		$child_theme_style_sheet    = trailingslashit( get_stylesheet_directory() ) . $templates_dir . $file;
398
-		$child_theme_style_sheet_2  = trailingslashit( get_stylesheet_directory() ) . $templates_dir . 'give' . $this->direction . '.css';
399
-		$parent_theme_style_sheet   = trailingslashit( get_template_directory() ) . $templates_dir . $file;
400
-		$parent_theme_style_sheet_2 = trailingslashit( get_template_directory() ) . $templates_dir . 'give' . $this->direction . '.css';
401
-		$give_plugin_style_sheet    = trailingslashit( GIVE_PLUGIN_DIR ) . 'assets/dist/css/' . $file;
397
+		$child_theme_style_sheet    = trailingslashit(get_stylesheet_directory()).$templates_dir.$file;
398
+		$child_theme_style_sheet_2  = trailingslashit(get_stylesheet_directory()).$templates_dir.'give'.$this->direction.'.css';
399
+		$parent_theme_style_sheet   = trailingslashit(get_template_directory()).$templates_dir.$file;
400
+		$parent_theme_style_sheet_2 = trailingslashit(get_template_directory()).$templates_dir.'give'.$this->direction.'.css';
401
+		$give_plugin_style_sheet    = trailingslashit(GIVE_PLUGIN_DIR).'assets/dist/css/'.$file;
402 402
 		$uri                        = false;
403 403
 
404 404
 		/**
@@ -409,23 +409,23 @@  discard block
 block discarded – undo
409 409
 		 * c. followed by non minified version, even if SCRIPT_DEBUG is not enabled. This allows users to copy just give.css to their theme.
410 410
 		 * d. Finally, fallback to the standard Give version. This is the default styles included within the plugin.
411 411
 		 */
412
-		if ( file_exists( $child_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $child_theme_style_sheet_2 ) ) ) ) {
413
-			if ( ! empty( $nonmin ) ) {
414
-				$uri = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . 'give' . $this->direction . '.css';
412
+		if (file_exists($child_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($child_theme_style_sheet_2)))) {
413
+			if ( ! empty($nonmin)) {
414
+				$uri = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.'give'.$this->direction.'.css';
415 415
 			} else {
416
-				$uri = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . $file;
416
+				$uri = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.$file;
417 417
 			}
418
-		} elseif ( file_exists( $parent_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $parent_theme_style_sheet_2 ) ) ) ) {
419
-			if ( ! empty( $nonmin ) ) {
420
-				$uri = trailingslashit( get_template_directory_uri() ) . $templates_dir . 'give' . $this->direction . '.css';
418
+		} elseif (file_exists($parent_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($parent_theme_style_sheet_2)))) {
419
+			if ( ! empty($nonmin)) {
420
+				$uri = trailingslashit(get_template_directory_uri()).$templates_dir.'give'.$this->direction.'.css';
421 421
 			} else {
422
-				$uri = trailingslashit( get_template_directory_uri() ) . $templates_dir . $file;
422
+				$uri = trailingslashit(get_template_directory_uri()).$templates_dir.$file;
423 423
 			}
424
-		} elseif ( file_exists( $give_plugin_style_sheet ) ) {
425
-			$uri = trailingslashit( GIVE_PLUGIN_URL ) . 'assets/dist/css/' . $file;
424
+		} elseif (file_exists($give_plugin_style_sheet)) {
425
+			$uri = trailingslashit(GIVE_PLUGIN_URL).'assets/dist/css/'.$file;
426 426
 		}
427 427
 
428
-		return apply_filters( 'give_get_stylesheet_uri', $uri );
428
+		return apply_filters('give_get_stylesheet_uri', $uri);
429 429
 
430 430
 	}
431 431
 
@@ -437,19 +437,19 @@  discard block
 block discarded – undo
437 437
 		// Enqueue the bundled block JS file
438 438
 		wp_enqueue_script(
439 439
 			'give-blocks-js',
440
-			GIVE_PLUGIN_URL . 'assets/dist/js/gutenberg.js',
441
-			array( 'wp-i18n', 'wp-element', 'wp-blocks', 'wp-components', 'wp-api' ),
440
+			GIVE_PLUGIN_URL.'assets/dist/js/gutenberg.js',
441
+			array('wp-i18n', 'wp-element', 'wp-blocks', 'wp-components', 'wp-api'),
442 442
 			GIVE_VERSION
443 443
 		);
444 444
 
445 445
 		// Enqueue public styles
446
-		wp_enqueue_style( 'give-styles' );
446
+		wp_enqueue_style('give-styles');
447 447
 
448 448
 		// Enqueue the bundled block css file
449 449
 		wp_enqueue_style(
450 450
 			'give-blocks-css',
451
-			GIVE_PLUGIN_URL . 'assets/dist/css/gutenberg.css',
452
-			array( 'wp-blocks' ),
451
+			GIVE_PLUGIN_URL.'assets/dist/css/gutenberg.css',
452
+			array('wp-blocks'),
453 453
 			GIVE_VERSION
454 454
 		);
455 455
 
Please login to merge, or discard this patch.
includes/emails/class-give-email-tags.php 1 patch
Spacing   +275 added lines, -275 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
  */
24 24
 
25 25
 // Exit if accessed directly.
26
-if ( ! defined( 'ABSPATH' ) ) {
26
+if ( ! defined('ABSPATH')) {
27 27
 	exit;
28 28
 }
29 29
 
@@ -56,13 +56,13 @@  discard block
 block discarded – undo
56 56
 	 * @param callable $func        Hook to run when email tag is found
57 57
 	 * @param string   $context     Email tag category
58 58
 	 */
59
-	public function add( $tag, $description, $func, $context = '' ) {
60
-		if ( is_callable( $func ) ) {
61
-			$this->tags[ $tag ] = array(
59
+	public function add($tag, $description, $func, $context = '') {
60
+		if (is_callable($func)) {
61
+			$this->tags[$tag] = array(
62 62
 				'tag'         => $tag,
63 63
 				'description' => $description,
64 64
 				'func'        => $func,
65
-				'context'     => give_check_variable( $context, 'empty', 'general' ),
65
+				'context'     => give_check_variable($context, 'empty', 'general'),
66 66
 			);
67 67
 		}
68 68
 	}
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
 	 *
75 75
 	 * @param string $tag Email tag to remove hook from
76 76
 	 */
77
-	public function remove( $tag ) {
78
-		unset( $this->tags[ $tag ] );
77
+	public function remove($tag) {
78
+		unset($this->tags[$tag]);
79 79
 	}
80 80
 
81 81
 	/**
@@ -87,8 +87,8 @@  discard block
 block discarded – undo
87 87
 	 *
88 88
 	 * @return bool
89 89
 	 */
90
-	public function email_tag_exists( $tag ) {
91
-		return array_key_exists( $tag, $this->tags );
90
+	public function email_tag_exists($tag) {
91
+		return array_key_exists($tag, $this->tags);
92 92
 	}
93 93
 
94 94
 	/**
@@ -102,23 +102,23 @@  discard block
 block discarded – undo
102 102
 	 *
103 103
 	 * @return array
104 104
 	 */
105
-	public function get_tags( $context_type = 'all', $field = '' ) {
105
+	public function get_tags($context_type = 'all', $field = '') {
106 106
 		$tags = $this->tags;
107 107
 
108
-		if ( 'all' !== $context_type ) {
108
+		if ('all' !== $context_type) {
109 109
 			$tags = array();
110 110
 
111
-			foreach ( $this->tags as $tag ) {
112
-				if ( empty( $tag['context'] ) || $context_type !== $tag['context'] ) {
111
+			foreach ($this->tags as $tag) {
112
+				if (empty($tag['context']) || $context_type !== $tag['context']) {
113 113
 					continue;
114 114
 				}
115 115
 
116
-				$tags[ $tag['tag'] ] = $tag;
116
+				$tags[$tag['tag']] = $tag;
117 117
 			}
118 118
 		}
119 119
 
120
-		if ( ! empty( $tags ) && ! empty( $field ) ) {
121
-			$tags = wp_list_pluck( $tags, $field );
120
+		if ( ! empty($tags) && ! empty($field)) {
121
+			$tags = wp_list_pluck($tags, $field);
122 122
 		}
123 123
 
124 124
 		return $tags;
@@ -136,16 +136,16 @@  discard block
 block discarded – undo
136 136
 	 *
137 137
 	 * @return string Content with email tags filtered out.
138 138
 	 */
139
-	public function do_tags( $content, $tag_args ) {
139
+	public function do_tags($content, $tag_args) {
140 140
 
141 141
 		// Check if there is at least one tag added.
142
-		if ( empty( $this->tags ) || ! is_array( $this->tags ) ) {
142
+		if (empty($this->tags) || ! is_array($this->tags)) {
143 143
 			return $content;
144 144
 		}
145 145
 
146 146
 		$this->tag_args = $tag_args;
147 147
 
148
-		$new_content = preg_replace_callback( "/{([A-z0-9\-\_]+)}/s", array( $this, 'do_tag' ), $content );
148
+		$new_content = preg_replace_callback("/{([A-z0-9\-\_]+)}/s", array($this, 'do_tag'), $content);
149 149
 
150 150
 		$this->tag_args = null;
151 151
 
@@ -161,17 +161,17 @@  discard block
 block discarded – undo
161 161
 	 *
162 162
 	 * @return mixed
163 163
 	 */
164
-	public function do_tag( $m ) {
164
+	public function do_tag($m) {
165 165
 
166 166
 		// Get tag
167 167
 		$tag = $m[1];
168 168
 
169 169
 		// Return tag if tag not set
170
-		if ( ! $this->email_tag_exists( $tag ) ) {
170
+		if ( ! $this->email_tag_exists($tag)) {
171 171
 			return $m[0];
172 172
 		}
173 173
 
174
-		return call_user_func( $this->tags[ $tag ]['func'], $this->tag_args, $tag );
174
+		return call_user_func($this->tags[$tag]['func'], $this->tag_args, $tag);
175 175
 	}
176 176
 
177 177
 }
@@ -186,8 +186,8 @@  discard block
 block discarded – undo
186 186
  * @param callable $func        Hook to run when email tag is found
187 187
  * @param string   $context     Email tag category
188 188
  */
189
-function give_add_email_tag( $tag, $description, $func, $context = '' ) {
190
-	Give()->email_tags->add( $tag, $description, $func, $context );
189
+function give_add_email_tag($tag, $description, $func, $context = '') {
190
+	Give()->email_tags->add($tag, $description, $func, $context);
191 191
 }
192 192
 
193 193
 /**
@@ -197,8 +197,8 @@  discard block
 block discarded – undo
197 197
  *
198 198
  * @param string $tag Email tag to remove hook from
199 199
  */
200
-function give_remove_email_tag( $tag ) {
201
-	Give()->email_tags->remove( $tag );
200
+function give_remove_email_tag($tag) {
201
+	Give()->email_tags->remove($tag);
202 202
 }
203 203
 
204 204
 /**
@@ -210,8 +210,8 @@  discard block
 block discarded – undo
210 210
  *
211 211
  * @return bool
212 212
  */
213
-function give_email_tag_exists( $tag ) {
214
-	return Give()->email_tags->email_tag_exists( $tag );
213
+function give_email_tag_exists($tag) {
214
+	return Give()->email_tags->email_tag_exists($tag);
215 215
 }
216 216
 
217 217
 /**
@@ -238,9 +238,9 @@  discard block
 block discarded – undo
238 238
 	$email_tags = give_get_email_tags();
239 239
 
240 240
 	ob_start();
241
-	if ( count( $email_tags ) > 0 ) : ?>
241
+	if (count($email_tags) > 0) : ?>
242 242
 		<div class="give-email-tags-wrap">
243
-			<?php foreach ( $email_tags as $email_tag ) : ?>
243
+			<?php foreach ($email_tags as $email_tag) : ?>
244 244
 				<span class="give_<?php echo $email_tag['tag']; ?>_tag">
245 245
 					<code>{<?php echo $email_tag['tag']; ?>}</code> - <?php echo $email_tag['description']; ?>
246 246
 				</span>
@@ -264,14 +264,14 @@  discard block
 block discarded – undo
264 264
  *
265 265
  * @return string Content with email tags filtered out.
266 266
  */
267
-function give_do_email_tags( $content, $tag_args ) {
267
+function give_do_email_tags($content, $tag_args) {
268 268
 	// Backward compatibility < 2.0
269
-	if ( ! is_array( $tag_args ) ) {
270
-		$tag_args = array( 'payment_id' => $tag_args );
269
+	if ( ! is_array($tag_args)) {
270
+		$tag_args = array('payment_id' => $tag_args);
271 271
 	}
272 272
 
273 273
 	// Replace all tags
274
-	$content = Give()->email_tags->do_tags( $content, $tag_args );
274
+	$content = Give()->email_tags->do_tags($content, $tag_args);
275 275
 
276 276
 	/**
277 277
 	 * Filter the filtered content text.
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 	 * @since 1.0
280 280
 	 * @since 2.0 $payment_meta, $payment_id removed and $tag_args added.
281 281
 	 */
282
-	$content = apply_filters( 'give_email_template_tags', $content, $tag_args );
282
+	$content = apply_filters('give_email_template_tags', $content, $tag_args);
283 283
 
284 284
 	// Return content
285 285
 	return $content;
@@ -298,10 +298,10 @@  discard block
 block discarded – undo
298 298
 	 *
299 299
 	 * @since 1.0
300 300
 	 */
301
-	do_action( 'give_add_email_tags' );
301
+	do_action('give_add_email_tags');
302 302
 }
303 303
 
304
-add_action( 'init', 'give_load_email_tags', - 999 );
304
+add_action('init', 'give_load_email_tags', - 999);
305 305
 
306 306
 
307 307
 /**
@@ -316,67 +316,67 @@  discard block
 block discarded – undo
316 316
 		/*	Donation Payment */
317 317
 		array(
318 318
 			'tag'         => 'donation',
319
-			'description' => esc_html__( 'The donation form name, and the donation level (if applicable).', 'give' ),
319
+			'description' => esc_html__('The donation form name, and the donation level (if applicable).', 'give'),
320 320
 			'function'    => 'give_email_tag_donation',
321 321
 			'context'     => 'donation',
322 322
 		),
323 323
 		array(
324 324
 			'tag'         => 'amount',
325
-			'description' => esc_html__( 'The total donation amount with currency sign.', 'give' ),
325
+			'description' => esc_html__('The total donation amount with currency sign.', 'give'),
326 326
 			'function'    => 'give_email_tag_amount',
327 327
 			'context'     => 'donation',
328 328
 		),
329 329
 		array(
330 330
 			'tag'         => 'price',
331
-			'description' => esc_html__( 'The total donation amount with currency sign.', 'give' ),
331
+			'description' => esc_html__('The total donation amount with currency sign.', 'give'),
332 332
 			'function'    => 'give_email_tag_price',
333 333
 			'context'     => 'donation',
334 334
 		),
335 335
 		array(
336 336
 			'tag'         => 'billing_address',
337
-			'description' => esc_html__( 'The donor\'s billing address.', 'give' ),
337
+			'description' => esc_html__('The donor\'s billing address.', 'give'),
338 338
 			'function'    => 'give_email_tag_billing_address',
339 339
 			'context'     => 'donation',
340 340
 		),
341 341
 		array(
342 342
 			'tag'         => 'date',
343
-			'description' => esc_html__( 'The date of the donation.', 'give' ),
343
+			'description' => esc_html__('The date of the donation.', 'give'),
344 344
 			'function'    => 'give_email_tag_date',
345 345
 			'context'     => 'donation',
346 346
 		),
347 347
 		array(
348 348
 			'tag'         => 'payment_id',
349
-			'description' => esc_html__( 'The unique ID number for this donation.', 'give' ),
349
+			'description' => esc_html__('The unique ID number for this donation.', 'give'),
350 350
 			'function'    => 'give_email_tag_payment_id',
351 351
 			'context'     => 'donation',
352 352
 		),
353 353
 		array(
354 354
 			'tag'         => 'payment_method',
355
-			'description' => esc_html__( 'The method of payment used for this donation.', 'give' ),
355
+			'description' => esc_html__('The method of payment used for this donation.', 'give'),
356 356
 			'function'    => 'give_email_tag_payment_method',
357 357
 			'context'     => 'donation',
358 358
 		),
359 359
 		array(
360 360
 			'tag'         => 'payment_total',
361
-			'description' => esc_html__( 'The payment total for this donation.', 'give' ),
361
+			'description' => esc_html__('The payment total for this donation.', 'give'),
362 362
 			'function'    => 'give_email_tag_payment_total',
363 363
 			'context'     => 'donation',
364 364
 		),
365 365
 		array(
366 366
 			'tag'         => 'receipt_id',
367
-			'description' => esc_html__( 'The unique ID number for this donation receipt.', 'give' ),
367
+			'description' => esc_html__('The unique ID number for this donation receipt.', 'give'),
368 368
 			'function'    => 'give_email_tag_receipt_id',
369 369
 			'context'     => 'donation',
370 370
 		),
371 371
 		array(
372 372
 			'tag'         => 'receipt_link',
373
-			'description' => esc_html__( 'The donation receipt direct link, to view the receipt on the website.', 'give' ),
373
+			'description' => esc_html__('The donation receipt direct link, to view the receipt on the website.', 'give'),
374 374
 			'function'    => 'give_email_tag_receipt_link',
375 375
 			'context'     => 'donation',
376 376
 		),
377 377
 		array(
378 378
 			'tag'         => 'receipt_link_url',
379
-			'description' => esc_html__( 'The donation receipt direct URL, to view the receipt on the website.', 'give' ),
379
+			'description' => esc_html__('The donation receipt direct URL, to view the receipt on the website.', 'give'),
380 380
 			'function'    => 'give_email_tag_receipt_link_url',
381 381
 			'context'     => 'donation',
382 382
 		),
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 		/* Donation Form */
385 385
 		array(
386 386
 			'tag'         => 'form_title',
387
-			'description' => esc_html__( 'The donation form name.', 'give' ),
387
+			'description' => esc_html__('The donation form name.', 'give'),
388 388
 			'function'    => 'give_email_tag_form_title',
389 389
 			'context'     => 'form',
390 390
 		),
@@ -392,37 +392,37 @@  discard block
 block discarded – undo
392 392
 		/* Donor */
393 393
 		array(
394 394
 			'tag'         => 'name',
395
-			'description' => esc_html__( 'The donor\'s first name.', 'give' ),
395
+			'description' => esc_html__('The donor\'s first name.', 'give'),
396 396
 			'function'    => 'give_email_tag_first_name',
397 397
 			'context'     => 'donor',
398 398
 		),
399 399
 		array(
400 400
 			'tag'         => 'fullname',
401
-			'description' => esc_html__( 'The donor\'s full name, first and last.', 'give' ),
401
+			'description' => esc_html__('The donor\'s full name, first and last.', 'give'),
402 402
 			'function'    => 'give_email_tag_fullname',
403 403
 			'context'     => 'donor',
404 404
 		),
405 405
 		array(
406 406
 			'tag'         => 'username',
407
-			'description' => esc_html__( 'The donor\'s user name on the site, if they registered an account.', 'give' ),
407
+			'description' => esc_html__('The donor\'s user name on the site, if they registered an account.', 'give'),
408 408
 			'function'    => 'give_email_tag_username',
409 409
 			'context'     => 'donor',
410 410
 		),
411 411
 		array(
412 412
 			'tag'         => 'company_name',
413
-			'description' => esc_html__( 'Company name.', 'give' ),
413
+			'description' => esc_html__('Company name.', 'give'),
414 414
 			'function'    => 'give_email_tag_company_name',
415 415
 			'context'     => 'donation',
416 416
 		),
417 417
 		array(
418 418
 			'tag'         => 'user_email',
419
-			'description' => esc_html__( 'The donor\'s email address.', 'give' ),
419
+			'description' => esc_html__('The donor\'s email address.', 'give'),
420 420
 			'function'    => 'give_email_tag_user_email',
421 421
 			'context'     => 'donor',
422 422
 		),
423 423
 		array(
424 424
 			'tag'         => 'email_access_link',
425
-			'description' => esc_html__( 'The donor\'s email access link.', 'give' ),
425
+			'description' => esc_html__('The donor\'s email access link.', 'give'),
426 426
 			'function'    => 'give_email_tag_email_access_link',
427 427
 			'context'     => 'donor',
428 428
 		),
@@ -430,14 +430,14 @@  discard block
 block discarded – undo
430 430
 		/* General */
431 431
 		array(
432 432
 			'tag'         => 'sitename',
433
-			'description' => esc_html__( 'The name of your site.', 'give' ),
433
+			'description' => esc_html__('The name of your site.', 'give'),
434 434
 			'function'    => 'give_email_tag_sitename',
435 435
 			'context'     => 'general',
436 436
 		),
437 437
 
438 438
 		array(
439 439
 			'tag'         => 'reset_password_link',
440
-			'description' => esc_html__( 'The reset password link for user.', 'give' ),
440
+			'description' => esc_html__('The reset password link for user.', 'give'),
441 441
 			'function'    => 'give_email_tag_reset_password_link',
442 442
 			'context'     => 'general',
443 443
 		),
@@ -445,21 +445,21 @@  discard block
 block discarded – undo
445 445
 	);
446 446
 
447 447
 	// Apply give_email_tags filter
448
-	$email_tags = apply_filters( 'give_email_tags', $email_tags );
448
+	$email_tags = apply_filters('give_email_tags', $email_tags);
449 449
 
450 450
 	// Add email tags
451
-	foreach ( $email_tags as $email_tag ) {
451
+	foreach ($email_tags as $email_tag) {
452 452
 		give_add_email_tag(
453 453
 			$email_tag['tag'],
454 454
 			$email_tag['description'],
455 455
 			$email_tag['function'],
456
-			( ! empty( $email_tag['context'] ) ? $email_tag['context'] : '' )
456
+			( ! empty($email_tag['context']) ? $email_tag['context'] : '')
457 457
 		);
458 458
 	}
459 459
 
460 460
 }
461 461
 
462
-add_action( 'give_add_email_tags', 'give_setup_email_tags' );
462
+add_action('give_add_email_tags', 'give_setup_email_tags');
463 463
 
464 464
 
465 465
 /**
@@ -471,24 +471,24 @@  discard block
 block discarded – undo
471 471
  *
472 472
  * @return string $firstname
473 473
  */
474
-function give_email_tag_first_name( $tag_args ) {
474
+function give_email_tag_first_name($tag_args) {
475 475
 	$user_info = array();
476 476
 	$firstname = '';
477 477
 
478 478
 	// Backward compatibility.
479
-	$tag_args = __give_20_bc_str_type_email_tag_param( $tag_args );
479
+	$tag_args = __give_20_bc_str_type_email_tag_param($tag_args);
480 480
 
481
-	switch ( true ) {
482
-		case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ):
483
-			$donor_info  = give_get_payment_meta_user_info( $tag_args['payment_id'] );
484
-			$email_names = give_get_email_names( $donor_info );
481
+	switch (true) {
482
+		case give_check_variable($tag_args, 'isset', 0, 'payment_id'):
483
+			$donor_info  = give_get_payment_meta_user_info($tag_args['payment_id']);
484
+			$email_names = give_get_email_names($donor_info);
485 485
 			$firstname   = $email_names['name'];
486 486
 
487 487
 			break;
488 488
 
489
-		case give_check_variable( $tag_args, 'isset', 0, 'user_id' ):
489
+		case give_check_variable($tag_args, 'isset', 0, 'user_id'):
490 490
 			$firstname = Give()->donor_meta->get_meta(
491
-				Give()->donors->get_column_by( 'id', 'user_id', $tag_args['user_id'] ),
491
+				Give()->donors->get_column_by('id', 'user_id', $tag_args['user_id']),
492 492
 				'_give_donor_first_name',
493 493
 				true
494 494
 			);
@@ -499,8 +499,8 @@  discard block
 block discarded – undo
499 499
 		 *
500 500
 		 * @since 2.0
501 501
 		 */
502
-		case give_check_variable( $tag_args, 'isset', 0, 'donor_id' ):
503
-			$firstname = Give()->donor_meta->get_meta( $tag_args['donor_id'], '_give_donor_first_name', true );
502
+		case give_check_variable($tag_args, 'isset', 0, 'donor_id'):
503
+			$firstname = Give()->donor_meta->get_meta($tag_args['donor_id'], '_give_donor_first_name', true);
504 504
 			break;
505 505
 	}
506 506
 
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
 	 * @param string $firstname
513 513
 	 * @param array  $tag_args
514 514
 	 */
515
-	$firstname = apply_filters( 'give_email_tag_first_name', $firstname, $tag_args );
515
+	$firstname = apply_filters('give_email_tag_first_name', $firstname, $tag_args);
516 516
 
517 517
 	return $firstname;
518 518
 }
@@ -526,21 +526,21 @@  discard block
 block discarded – undo
526 526
  *
527 527
  * @return string $fullname
528 528
  */
529
-function give_email_tag_fullname( $tag_args ) {
529
+function give_email_tag_fullname($tag_args) {
530 530
 	$fullname = '';
531 531
 
532 532
 	// Backward compatibility.
533
-	$tag_args = __give_20_bc_str_type_email_tag_param( $tag_args );
533
+	$tag_args = __give_20_bc_str_type_email_tag_param($tag_args);
534 534
 
535
-	switch ( true ) {
536
-		case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ):
537
-			$donor_info  = give_get_payment_meta_user_info( $tag_args['payment_id'] );
538
-			$email_names = give_get_email_names( $donor_info );
535
+	switch (true) {
536
+		case give_check_variable($tag_args, 'isset', 0, 'payment_id'):
537
+			$donor_info  = give_get_payment_meta_user_info($tag_args['payment_id']);
538
+			$email_names = give_get_email_names($donor_info);
539 539
 			$fullname    = $email_names['fullname'];
540 540
 			break;
541 541
 
542
-		case give_check_variable( $tag_args, 'isset', 0, 'user_id' ):
543
-			$fullname = Give()->donors->get_column_by( 'name', 'user_id', $tag_args['user_id'] );
542
+		case give_check_variable($tag_args, 'isset', 0, 'user_id'):
543
+			$fullname = Give()->donors->get_column_by('name', 'user_id', $tag_args['user_id']);
544 544
 			break;
545 545
 
546 546
 		/**
@@ -548,8 +548,8 @@  discard block
 block discarded – undo
548 548
 		 *
549 549
 		 * @since 2.0
550 550
 		 */
551
-		case give_check_variable( $tag_args, 'isset', 0, 'donor_id' ):
552
-			$fullname = Give()->donors->get_column( 'name', $tag_args['donor_id'] );
551
+		case give_check_variable($tag_args, 'isset', 0, 'donor_id'):
552
+			$fullname = Give()->donors->get_column('name', $tag_args['donor_id']);
553 553
 			break;
554 554
 	}
555 555
 
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
 	 * @param string $fullname
562 562
 	 * @param array  $tag_args
563 563
 	 */
564
-	$fullname = apply_filters( 'give_email_tag_fullname', $fullname, $tag_args );
564
+	$fullname = apply_filters('give_email_tag_fullname', $fullname, $tag_args);
565 565
 
566 566
 	return $fullname;
567 567
 }
@@ -575,21 +575,21 @@  discard block
 block discarded – undo
575 575
  *
576 576
  * @return string username.
577 577
  */
578
-function give_email_tag_username( $tag_args ) {
578
+function give_email_tag_username($tag_args) {
579 579
 	$username = '';
580 580
 
581 581
 	// Backward compatibility.
582
-	$tag_args = __give_20_bc_str_type_email_tag_param( $tag_args );
582
+	$tag_args = __give_20_bc_str_type_email_tag_param($tag_args);
583 583
 
584
-	switch ( true ) {
585
-		case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ):
586
-			$donor_info  = give_get_payment_meta_user_info( $tag_args['payment_id'] );
587
-			$email_names = give_get_email_names( $donor_info );
584
+	switch (true) {
585
+		case give_check_variable($tag_args, 'isset', 0, 'payment_id'):
586
+			$donor_info  = give_get_payment_meta_user_info($tag_args['payment_id']);
587
+			$email_names = give_get_email_names($donor_info);
588 588
 			$username    = $email_names['username'];
589 589
 			break;
590 590
 
591
-		case give_check_variable( $tag_args, 'isset', 0, 'user_id' ):
592
-			$user_info = get_user_by( 'id', $tag_args['user_id'] );
591
+		case give_check_variable($tag_args, 'isset', 0, 'user_id'):
592
+			$user_info = get_user_by('id', $tag_args['user_id']);
593 593
 			$username  = $user_info->user_login;
594 594
 			break;
595 595
 
@@ -598,9 +598,9 @@  discard block
 block discarded – undo
598 598
 		 *
599 599
 		 * @since 2.0
600 600
 		 */
601
-		case give_check_variable( $tag_args, 'isset', 0, 'donor_id' ):
602
-			if ( $user_id = Give()->donors->get_column( 'user_id', $tag_args['donor_id'] ) ) {
603
-				$user_info = get_user_by( 'id', $user_id );
601
+		case give_check_variable($tag_args, 'isset', 0, 'donor_id'):
602
+			if ($user_id = Give()->donors->get_column('user_id', $tag_args['donor_id'])) {
603
+				$user_info = get_user_by('id', $user_id);
604 604
 				$username  = $user_info->user_login;
605 605
 			}
606 606
 			break;
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
 	 * @param string $username
615 615
 	 * @param array  $tag_args
616 616
 	 */
617
-	$username = apply_filters( 'give_email_tag_username', $username, $tag_args );
617
+	$username = apply_filters('give_email_tag_username', $username, $tag_args);
618 618
 
619 619
 	return $username;
620 620
 }
@@ -628,19 +628,19 @@  discard block
 block discarded – undo
628 628
  *
629 629
  * @return string user_email
630 630
  */
631
-function give_email_tag_user_email( $tag_args ) {
631
+function give_email_tag_user_email($tag_args) {
632 632
 	$email = '';
633 633
 
634 634
 	// Backward compatibility.
635
-	$tag_args = __give_20_bc_str_type_email_tag_param( $tag_args );
635
+	$tag_args = __give_20_bc_str_type_email_tag_param($tag_args);
636 636
 
637
-	switch ( true ) {
638
-		case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ):
639
-			$email = give_get_donation_donor_email( $tag_args['payment_id'] );
637
+	switch (true) {
638
+		case give_check_variable($tag_args, 'isset', 0, 'payment_id'):
639
+			$email = give_get_donation_donor_email($tag_args['payment_id']);
640 640
 			break;
641 641
 
642
-		case give_check_variable( $tag_args, 'isset', 0, 'user_id' ):
643
-			$user_info = get_user_by( 'id', $tag_args['user_id'] );
642
+		case give_check_variable($tag_args, 'isset', 0, 'user_id'):
643
+			$user_info = get_user_by('id', $tag_args['user_id']);
644 644
 			$email     = $user_info->user_email;
645 645
 			break;
646 646
 
@@ -649,8 +649,8 @@  discard block
 block discarded – undo
649 649
 		 *
650 650
 		 * @since 2.0
651 651
 		 */
652
-		case give_check_variable( $tag_args, 'isset', 0, 'donor_id' ):
653
-			$email = Give()->donors->get_column( 'email', $tag_args['donor_id'] );
652
+		case give_check_variable($tag_args, 'isset', 0, 'donor_id'):
653
+			$email = Give()->donors->get_column('email', $tag_args['donor_id']);
654 654
 			break;
655 655
 	}
656 656
 
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
 	 * @param string $email
663 663
 	 * @param array  $tag_args
664 664
 	 */
665
-	$email = apply_filters( 'give_email_tag_user_email', $email, $tag_args );
665
+	$email = apply_filters('give_email_tag_user_email', $email, $tag_args);
666 666
 
667 667
 	return $email;
668 668
 }
@@ -676,22 +676,22 @@  discard block
 block discarded – undo
676 676
  *
677 677
  * @return string billing_address
678 678
  */
679
-function give_email_tag_billing_address( $tag_args ) {
679
+function give_email_tag_billing_address($tag_args) {
680 680
 	$address = '';
681 681
 
682 682
 	// Backward compatibility.
683
-	$tag_args = __give_20_bc_str_type_email_tag_param( $tag_args );
683
+	$tag_args = __give_20_bc_str_type_email_tag_param($tag_args);
684 684
 
685
-	switch ( true ) {
686
-		case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ):
687
-			$donation_address = give_get_donation_address( $tag_args['payment_id'] );
688
-			$address  = $donation_address['line1'] . "\n";
685
+	switch (true) {
686
+		case give_check_variable($tag_args, 'isset', 0, 'payment_id'):
687
+			$donation_address = give_get_donation_address($tag_args['payment_id']);
688
+			$address = $donation_address['line1']."\n";
689 689
 
690
-			if ( ! empty( $donation_address['line2'] ) ) {
691
-				$address .= $donation_address['line2'] . "\n";
690
+			if ( ! empty($donation_address['line2'])) {
691
+				$address .= $donation_address['line2']."\n";
692 692
 			}
693 693
 
694
-			$address .= $donation_address['city'] . ' ' . $donation_address['zip'] . ' ' . $donation_address['state'] . "\n";
694
+			$address .= $donation_address['city'].' '.$donation_address['zip'].' '.$donation_address['state']."\n";
695 695
 			$address .= $donation_address['country'];
696 696
 			break;
697 697
 	}
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
 	 * @param string $address
705 705
 	 * @param array  $tag_args
706 706
 	 */
707
-	$address = apply_filters( 'give_email_tag_billing_address', $address, $tag_args );
707
+	$address = apply_filters('give_email_tag_billing_address', $address, $tag_args);
708 708
 
709 709
 	return $address;
710 710
 }
@@ -718,15 +718,15 @@  discard block
 block discarded – undo
718 718
  *
719 719
  * @return string date
720 720
  */
721
-function give_email_tag_date( $tag_args ) {
721
+function give_email_tag_date($tag_args) {
722 722
 	$date = '';
723 723
 
724 724
 	// Backward compatibility.
725
-	$tag_args = __give_20_bc_str_type_email_tag_param( $tag_args );
725
+	$tag_args = __give_20_bc_str_type_email_tag_param($tag_args);
726 726
 
727
-	switch ( true ) {
728
-		case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ):
729
-			$date = date_i18n( give_date_format(), strtotime( get_the_date( $tag_args['payment_id'] ) ) );
727
+	switch (true) {
728
+		case give_check_variable($tag_args, 'isset', 0, 'payment_id'):
729
+			$date = date_i18n(give_date_format(), strtotime(get_the_date($tag_args['payment_id'])));
730 730
 			break;
731 731
 	}
732 732
 
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
 	 * @param string $date
739 739
 	 * @param array  $tag_args
740 740
 	 */
741
-	$date = apply_filters( 'give_email_tag_date', $date, $tag_args );
741
+	$date = apply_filters('give_email_tag_date', $date, $tag_args);
742 742
 
743 743
 	return $date;
744 744
 }
@@ -752,16 +752,16 @@  discard block
 block discarded – undo
752 752
  *
753 753
  * @return string amount
754 754
  */
755
-function give_email_tag_amount( $tag_args ) {
755
+function give_email_tag_amount($tag_args) {
756 756
 	$amount = '';
757 757
 
758 758
 	// Backward compatibility.
759
-	$tag_args = __give_20_bc_str_type_email_tag_param( $tag_args );
759
+	$tag_args = __give_20_bc_str_type_email_tag_param($tag_args);
760 760
 
761
-	switch ( true ) {
762
-		case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ):
763
-			$give_amount = give_donation_amount( $tag_args['payment_id'], true );
764
-			$amount      = html_entity_decode( $give_amount, ENT_COMPAT, 'UTF-8' );
761
+	switch (true) {
762
+		case give_check_variable($tag_args, 'isset', 0, 'payment_id'):
763
+			$give_amount = give_donation_amount($tag_args['payment_id'], true);
764
+			$amount      = html_entity_decode($give_amount, ENT_COMPAT, 'UTF-8');
765 765
 			break;
766 766
 	}
767 767
 
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
 	 * @param string $amount
774 774
 	 * @param array  $tag_args
775 775
 	 */
776
-	$amount = apply_filters( 'give_email_tag_amount', $amount, $tag_args );
776
+	$amount = apply_filters('give_email_tag_amount', $amount, $tag_args);
777 777
 
778 778
 	return $amount;
779 779
 }
@@ -787,8 +787,8 @@  discard block
 block discarded – undo
787 787
  *
788 788
  * @return string price
789 789
  */
790
-function give_email_tag_price( $tag_args ) {
791
-	return give_email_tag_amount( $tag_args );
790
+function give_email_tag_price($tag_args) {
791
+	return give_email_tag_amount($tag_args);
792 792
 }
793 793
 
794 794
 /**
@@ -800,15 +800,15 @@  discard block
 block discarded – undo
800 800
  *
801 801
  * @return int payment_id
802 802
  */
803
-function give_email_tag_payment_id( $tag_args ) {
803
+function give_email_tag_payment_id($tag_args) {
804 804
 	$payment_id = '';
805 805
 
806 806
 	// Backward compatibility.
807
-	$tag_args = __give_20_bc_str_type_email_tag_param( $tag_args );
807
+	$tag_args = __give_20_bc_str_type_email_tag_param($tag_args);
808 808
 
809
-	switch ( true ) {
810
-		case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ):
811
-			$payment_id = Give()->seq_donation_number->get_serial_code( $tag_args['payment_id'] );
809
+	switch (true) {
810
+		case give_check_variable($tag_args, 'isset', 0, 'payment_id'):
811
+			$payment_id = Give()->seq_donation_number->get_serial_code($tag_args['payment_id']);
812 812
 			break;
813 813
 	}
814 814
 
@@ -820,7 +820,7 @@  discard block
 block discarded – undo
820 820
 	 * @param string $payment_id
821 821
 	 * @param array  $tag_args
822 822
 	 */
823
-	return apply_filters( 'give_email_tag_payment_id', $payment_id, $tag_args );
823
+	return apply_filters('give_email_tag_payment_id', $payment_id, $tag_args);
824 824
 }
825 825
 
826 826
 /**
@@ -832,15 +832,15 @@  discard block
 block discarded – undo
832 832
  *
833 833
  * @return string receipt_id
834 834
  */
835
-function give_email_tag_receipt_id( $tag_args ) {
835
+function give_email_tag_receipt_id($tag_args) {
836 836
 	$receipt_id = '';
837 837
 
838 838
 	// Backward compatibility.
839
-	$tag_args = __give_20_bc_str_type_email_tag_param( $tag_args );
839
+	$tag_args = __give_20_bc_str_type_email_tag_param($tag_args);
840 840
 
841
-	switch ( true ) {
842
-		case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ):
843
-			$receipt_id = give_get_payment_key( $tag_args['payment_id'] );
841
+	switch (true) {
842
+		case give_check_variable($tag_args, 'isset', 0, 'payment_id'):
843
+			$receipt_id = give_get_payment_key($tag_args['payment_id']);
844 844
 			break;
845 845
 	}
846 846
 
@@ -852,7 +852,7 @@  discard block
 block discarded – undo
852 852
 	 * @param string $receipt_id
853 853
 	 * @param array  $tag_args
854 854
 	 */
855
-	return apply_filters( 'give_email_tag_receipt_id', $receipt_id, $tag_args );
855
+	return apply_filters('give_email_tag_receipt_id', $receipt_id, $tag_args);
856 856
 }
857 857
 
858 858
 /**
@@ -864,21 +864,21 @@  discard block
 block discarded – undo
864 864
  *
865 865
  * @return string $form_title
866 866
  */
867
-function give_email_tag_donation( $tag_args ) {
867
+function give_email_tag_donation($tag_args) {
868 868
 	$donation_form_title = '';
869 869
 
870 870
 	// Backward compatibility.
871
-	$tag_args = __give_20_bc_str_type_email_tag_param( $tag_args );
871
+	$tag_args = __give_20_bc_str_type_email_tag_param($tag_args);
872 872
 
873
-	switch ( true ) {
874
-		case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ):
875
-			$level_title         = give_has_variable_prices( give_get_payment_form_id( $tag_args['payment_id'] ) );
873
+	switch (true) {
874
+		case give_check_variable($tag_args, 'isset', 0, 'payment_id'):
875
+			$level_title         = give_has_variable_prices(give_get_payment_form_id($tag_args['payment_id']));
876 876
 			$separator           = $level_title ? '-' : '';
877 877
 			$donation_form_title = strip_tags(
878 878
 				give_check_variable(
879 879
 					give_get_donation_form_title(
880 880
 						$tag_args['payment_id'],
881
-						array( 'separator' => $separator, )
881
+						array('separator' => $separator,)
882 882
 					),
883 883
 					'empty',
884 884
 					''
@@ -911,15 +911,15 @@  discard block
 block discarded – undo
911 911
  *
912 912
  * @return string $form_title
913 913
  */
914
-function give_email_tag_form_title( $tag_args ) {
914
+function give_email_tag_form_title($tag_args) {
915 915
 	$donation_form_title = '';
916 916
 
917 917
 	// Backward compatibility.
918
-	$tag_args = __give_20_bc_str_type_email_tag_param( $tag_args );
918
+	$tag_args = __give_20_bc_str_type_email_tag_param($tag_args);
919 919
 
920
-	switch ( true ) {
921
-		case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ):
922
-			$donation_form_title = give_get_payment_meta( $tag_args['payment_id'], '_give_payment_form_title' );
920
+	switch (true) {
921
+		case give_check_variable($tag_args, 'isset', 0, 'payment_id'):
922
+			$donation_form_title = give_get_payment_meta($tag_args['payment_id'], '_give_payment_form_title');
923 923
 			break;
924 924
 	}
925 925
 
@@ -948,15 +948,15 @@  discard block
 block discarded – undo
948 948
  *
949 949
  * @return string $company_name
950 950
  */
951
-function give_email_tag_company_name( $tag_args ) {
951
+function give_email_tag_company_name($tag_args) {
952 952
 	$company_name = '';
953 953
 
954 954
 	// Backward compatibility.
955
-	$tag_args = __give_20_bc_str_type_email_tag_param( $tag_args );
955
+	$tag_args = __give_20_bc_str_type_email_tag_param($tag_args);
956 956
 
957
-	switch ( true ) {
958
-		case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ):
959
-			$company_name = give_get_payment_meta( $tag_args['payment_id'], '_give_donation_company', true );
957
+	switch (true) {
958
+		case give_check_variable($tag_args, 'isset', 0, 'payment_id'):
959
+			$company_name = give_get_payment_meta($tag_args['payment_id'], '_give_donation_company', true);
960 960
 			break;
961 961
 	}
962 962
 
@@ -984,18 +984,18 @@  discard block
 block discarded – undo
984 984
  *
985 985
  * @return string gateway
986 986
  */
987
-function give_email_tag_payment_method( $tag_args ) {
987
+function give_email_tag_payment_method($tag_args) {
988 988
 	$payment_method = '';
989 989
 
990 990
 	// Backward compatibility.
991
-	$tag_args = __give_20_bc_str_type_email_tag_param( $tag_args );
991
+	$tag_args = __give_20_bc_str_type_email_tag_param($tag_args);
992 992
 
993 993
 	// Backward compatibility.
994
-	$tag_args = __give_20_bc_str_type_email_tag_param( $tag_args );
994
+	$tag_args = __give_20_bc_str_type_email_tag_param($tag_args);
995 995
 
996
-	switch ( true ) {
997
-		case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ):
998
-			$payment_method = give_get_gateway_checkout_label( give_get_payment_gateway( $tag_args['payment_id'] ) );
996
+	switch (true) {
997
+		case give_check_variable($tag_args, 'isset', 0, 'payment_id'):
998
+			$payment_method = give_get_gateway_checkout_label(give_get_payment_gateway($tag_args['payment_id']));
999 999
 			break;
1000 1000
 	}
1001 1001
 
@@ -1026,15 +1026,15 @@  discard block
 block discarded – undo
1026 1026
  *
1027 1027
  * @return string
1028 1028
  */
1029
-function give_email_tag_payment_total( $tag_args ) {
1029
+function give_email_tag_payment_total($tag_args) {
1030 1030
 	$payment_total = '';
1031 1031
 
1032 1032
 	// Backward compatibility.
1033
-	$tag_args = __give_20_bc_str_type_email_tag_param( $tag_args );
1033
+	$tag_args = __give_20_bc_str_type_email_tag_param($tag_args);
1034 1034
 
1035
-	switch ( true ) {
1036
-		case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ):
1037
-			$payment_total = give_currency_filter( give_get_payment_total( $tag_args['payment_id'] ) );
1035
+	switch (true) {
1036
+		case give_check_variable($tag_args, 'isset', 0, 'payment_id'):
1037
+			$payment_total = give_currency_filter(give_get_payment_total($tag_args['payment_id']));
1038 1038
 			break;
1039 1039
 	}
1040 1040
 
@@ -1062,11 +1062,11 @@  discard block
 block discarded – undo
1062 1062
  *
1063 1063
  * @return string
1064 1064
  */
1065
-function give_email_tag_sitename( $tag_args = array() ) {
1066
-	$sitename = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES );
1065
+function give_email_tag_sitename($tag_args = array()) {
1066
+	$sitename = wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES);
1067 1067
 
1068 1068
 	// Backward compatibility.
1069
-	$tag_args = __give_20_bc_str_type_email_tag_param( $tag_args );
1069
+	$tag_args = __give_20_bc_str_type_email_tag_param($tag_args);
1070 1070
 
1071 1071
 	/**
1072 1072
 	 * Filter the {sitename} email template tag output.
@@ -1092,26 +1092,26 @@  discard block
 block discarded – undo
1092 1092
  *
1093 1093
  * @return string receipt_link
1094 1094
  */
1095
-function give_email_tag_receipt_link( $tag_args ) {
1095
+function give_email_tag_receipt_link($tag_args) {
1096 1096
 	// Backward compatibility.
1097
-	$tag_args = __give_20_bc_str_type_email_tag_param( $tag_args );
1097
+	$tag_args = __give_20_bc_str_type_email_tag_param($tag_args);
1098 1098
 
1099
-	$receipt_url = give_get_receipt_url( give_check_variable( $tag_args, 'empty', 0, 'payment_id' ) );
1099
+	$receipt_url = give_get_receipt_url(give_check_variable($tag_args, 'empty', 0, 'payment_id'));
1100 1100
 
1101 1101
 	// Bailout.
1102
-	if ( give_get_option( 'email_template' ) === 'none' ) {
1102
+	if (give_get_option('email_template') === 'none') {
1103 1103
 		return $receipt_url;
1104 1104
 	}
1105 1105
 
1106 1106
 
1107
-	$receipt_url = esc_url( add_query_arg( array(
1108
-		'payment_key' => give_get_payment_key( $tag_args['payment_id'] ),
1109
-	), give_get_history_page_uri() ) );
1107
+	$receipt_url = esc_url(add_query_arg(array(
1108
+		'payment_key' => give_get_payment_key($tag_args['payment_id']),
1109
+	), give_get_history_page_uri()));
1110 1110
 
1111 1111
 	$formatted = sprintf(
1112 1112
 		'<a href="%1$s">%2$s</a>',
1113 1113
 		$receipt_url,
1114
-		__( 'View it in your browser &raquo;', 'give' )
1114
+		__('View it in your browser &raquo;', 'give')
1115 1115
 	);
1116 1116
 
1117 1117
 	/**
@@ -1140,11 +1140,11 @@  discard block
 block discarded – undo
1140 1140
  *
1141 1141
  * @return string receipt_url
1142 1142
  */
1143
-function give_email_tag_receipt_link_url( $tag_args ) {
1143
+function give_email_tag_receipt_link_url($tag_args) {
1144 1144
 	// Backward compatibility.
1145
-	$tag_args = __give_20_bc_str_type_email_tag_param( $tag_args );
1145
+	$tag_args = __give_20_bc_str_type_email_tag_param($tag_args);
1146 1146
 
1147
-	$receipt_link_url = give_get_receipt_url( give_check_variable( $tag_args, 'empty', 0, 'payment_id' ) );
1147
+	$receipt_link_url = give_get_receipt_url(give_check_variable($tag_args, 'empty', 0, 'payment_id'));
1148 1148
 
1149 1149
 	/**
1150 1150
 	 * Filter the {receipt_link_url} email template tag output.
@@ -1171,13 +1171,13 @@  discard block
 block discarded – undo
1171 1171
  *
1172 1172
  * @return string
1173 1173
  */
1174
-function give_get_receipt_url( $payment_id ) {
1174
+function give_get_receipt_url($payment_id) {
1175 1175
 	$receipt_url = '';
1176 1176
 
1177
-	if ( $payment_id ) {
1178
-		$receipt_url = esc_url( add_query_arg( array(
1179
-			'payment_key' => give_get_payment_key( $payment_id ),
1180
-		), give_get_history_page_uri() ) );
1177
+	if ($payment_id) {
1178
+		$receipt_url = esc_url(add_query_arg(array(
1179
+			'payment_key' => give_get_payment_key($payment_id),
1180
+		), give_get_history_page_uri()));
1181 1181
 	}
1182 1182
 
1183 1183
 	return $receipt_url;
@@ -1193,22 +1193,22 @@  discard block
 block discarded – undo
1193 1193
  *
1194 1194
  * @return string
1195 1195
  */
1196
-function give_email_tag_email_access_link( $tag_args ) {
1196
+function give_email_tag_email_access_link($tag_args) {
1197 1197
 	$donor_id          = 0;
1198 1198
 	$donor             = array();
1199 1199
 	$email_access_link = '';
1200 1200
 
1201 1201
 	// Backward compatibility.
1202
-	$tag_args = __give_20_bc_str_type_email_tag_param( $tag_args );
1202
+	$tag_args = __give_20_bc_str_type_email_tag_param($tag_args);
1203 1203
 
1204
-	switch ( true ) {
1205
-		case ! empty( $tag_args['donor_id'] ):
1204
+	switch (true) {
1205
+		case ! empty($tag_args['donor_id']):
1206 1206
 			$donor_id = $tag_args['donor_id'];
1207
-			$donor    = Give()->donors->get_by( 'id', $tag_args['donor_id'] );
1207
+			$donor    = Give()->donors->get_by('id', $tag_args['donor_id']);
1208 1208
 			break;
1209 1209
 
1210
-		case ! empty( $tag_args['user_id'] ):
1211
-			$donor    = Give()->donors->get_by( 'user_id', $tag_args['user_id'] );
1210
+		case ! empty($tag_args['user_id']):
1211
+			$donor    = Give()->donors->get_by('user_id', $tag_args['user_id']);
1212 1212
 			$donor_id = $donor->id;
1213 1213
 			break;
1214 1214
 
@@ -1217,11 +1217,11 @@  discard block
 block discarded – undo
1217 1217
 	}
1218 1218
 
1219 1219
 	// Set email access link if donor exist.
1220
-	if ( $donor_id ) {
1221
-		$verify_key = wp_generate_password( 20, false );
1220
+	if ($donor_id) {
1221
+		$verify_key = wp_generate_password(20, false);
1222 1222
 
1223 1223
 		// Generate a new verify key
1224
-		Give()->email_access->set_verify_key( $donor_id, $donor->email, $verify_key );
1224
+		Give()->email_access->set_verify_key($donor_id, $donor->email, $verify_key);
1225 1225
 
1226 1226
 		$access_url = add_query_arg(
1227 1227
 			array(
@@ -1231,28 +1231,28 @@  discard block
 block discarded – undo
1231 1231
 		);
1232 1232
 
1233 1233
 		// Add Payment Key to email access url, if it exists.
1234
-		if ( ! empty( $_GET['payment_key'] ) ) {
1234
+		if ( ! empty($_GET['payment_key'])) {
1235 1235
 			$access_url = add_query_arg(
1236 1236
 				array(
1237
-					'payment_key' => give_clean( $_GET['payment_key'] ),
1237
+					'payment_key' => give_clean($_GET['payment_key']),
1238 1238
 				),
1239 1239
 				$access_url
1240 1240
 			);
1241 1241
 		}
1242 1242
 
1243
-		if ( empty( $tag_args['email_content_type'] ) || 'text/html' === $tag_args['email_content_type'] ) {
1243
+		if (empty($tag_args['email_content_type']) || 'text/html' === $tag_args['email_content_type']) {
1244 1244
 			$email_access_link = sprintf(
1245 1245
 				'<a href="%1$s" target="_blank">%2$s</a>',
1246
-				esc_url( $access_url ),
1247
-				__( 'View your donation history &raquo;', 'give' )
1246
+				esc_url($access_url),
1247
+				__('View your donation history &raquo;', 'give')
1248 1248
 			);
1249 1249
 
1250 1250
 		} else {
1251 1251
 
1252 1252
 			$email_access_link = sprintf(
1253 1253
 				'%1$s: %2$s',
1254
-				__( 'View your donation history', 'give' ),
1255
-				esc_url( $access_url )
1254
+				__('View your donation history', 'give'),
1255
+				esc_url($access_url)
1256 1256
 			);
1257 1257
 		}
1258 1258
 	}
@@ -1284,23 +1284,23 @@  discard block
 block discarded – undo
1284 1284
  *
1285 1285
  * @return array
1286 1286
  */
1287
-function __give_20_bc_str_type_email_tag_param( $tag_args ) {
1288
-	if ( ! is_array( $tag_args ) ) {
1289
-		switch ( true ) {
1290
-			case ( 'give_payment' === get_post_type( $tag_args ) ):
1291
-				$tag_args = array( 'payment_id' => $tag_args );
1287
+function __give_20_bc_str_type_email_tag_param($tag_args) {
1288
+	if ( ! is_array($tag_args)) {
1289
+		switch (true) {
1290
+			case ('give_payment' === get_post_type($tag_args)):
1291
+				$tag_args = array('payment_id' => $tag_args);
1292 1292
 				break;
1293 1293
 
1294
-			case ( ! is_wp_error( get_user_by( 'id', $tag_args ) ) ):
1295
-				$tag_args = array( 'user_id' => $tag_args );
1294
+			case ( ! is_wp_error(get_user_by('id', $tag_args))):
1295
+				$tag_args = array('user_id' => $tag_args);
1296 1296
 				break;
1297 1297
 
1298
-			case ( Give()->donors->get_by( 'id', $tag_args ) ):
1299
-				$tag_args = array( 'donor_id' => $tag_args );
1298
+			case (Give()->donors->get_by('id', $tag_args)):
1299
+				$tag_args = array('donor_id' => $tag_args);
1300 1300
 				break;
1301 1301
 
1302
-			case ( Give()->donors->get_by( 'user_id', $tag_args ) ):
1303
-				$tag_args = array( 'user_id' => $tag_args );
1302
+			case (Give()->donors->get_by('user_id', $tag_args)):
1303
+				$tag_args = array('user_id' => $tag_args);
1304 1304
 				break;
1305 1305
 		}
1306 1306
 	}
@@ -1318,36 +1318,36 @@  discard block
 block discarded – undo
1318 1318
  *
1319 1319
  * @return array
1320 1320
  */
1321
-function give_email_tag_reset_password_link( $tag_args, $payment_id ) {
1321
+function give_email_tag_reset_password_link($tag_args, $payment_id) {
1322 1322
 
1323 1323
 	$reset_password_url = '';
1324 1324
 
1325
-	switch ( true ) {
1326
-		case give_check_variable( $tag_args, 'isset', 0, 'payment_id' ):
1327
-			$payment_id = Give()->seq_donation_number->get_serial_code( $tag_args['payment_id'] );
1325
+	switch (true) {
1326
+		case give_check_variable($tag_args, 'isset', 0, 'payment_id'):
1327
+			$payment_id = Give()->seq_donation_number->get_serial_code($tag_args['payment_id']);
1328 1328
 			break;
1329 1329
 
1330
-		case give_check_variable( $tag_args, 'isset', 0, 'user_id' ):
1331
-			$reset_password_url = give_get_reset_password_url( $tag_args['user_id'] );
1330
+		case give_check_variable($tag_args, 'isset', 0, 'user_id'):
1331
+			$reset_password_url = give_get_reset_password_url($tag_args['user_id']);
1332 1332
 			break;
1333 1333
 
1334
-		case give_check_variable( $tag_args, 'isset', 0, 'donor_id' ):
1335
-			$reset_password_url = give_get_reset_password_url( Give()->donors->get_column( 'user_id', $tag_args['donor_id'] ) );
1334
+		case give_check_variable($tag_args, 'isset', 0, 'donor_id'):
1335
+			$reset_password_url = give_get_reset_password_url(Give()->donors->get_column('user_id', $tag_args['donor_id']));
1336 1336
 			break;
1337 1337
 	}
1338 1338
 
1339
-	if ( empty( $tag_args['email_content_type'] ) || 'text/html' === $tag_args['email_content_type'] ) {
1339
+	if (empty($tag_args['email_content_type']) || 'text/html' === $tag_args['email_content_type']) {
1340 1340
 		// Generate link, if Email content type is html.
1341 1341
 		$reset_password_link = sprintf(
1342 1342
 			'<a href="%1$s" target="_blank">%2$s</a>',
1343
-			esc_url( $reset_password_url ),
1344
-			__( 'Reset your password &raquo;', 'give' )
1343
+			esc_url($reset_password_url),
1344
+			__('Reset your password &raquo;', 'give')
1345 1345
 		);
1346 1346
 	} else {
1347 1347
 		$reset_password_link = sprintf(
1348 1348
 			'%1$s: %2$s',
1349
-			__( 'Reset your password', 'give' ),
1350
-			esc_url( $reset_password_url )
1349
+			__('Reset your password', 'give'),
1350
+			esc_url($reset_password_url)
1351 1351
 		);
1352 1352
 	}
1353 1353
 
@@ -1376,21 +1376,21 @@  discard block
 block discarded – undo
1376 1376
  *
1377 1377
  * @return mixed|string
1378 1378
  */
1379
-function give_get_reset_password_url( $user_id ) {
1379
+function give_get_reset_password_url($user_id) {
1380 1380
 	$reset_password_url = '';
1381 1381
 
1382 1382
 	// Proceed further only, if user_id exists.
1383
-	if ( $user_id ) {
1383
+	if ($user_id) {
1384 1384
 
1385 1385
 		// Get User Object Details.
1386
-		$user = get_user_by( 'ID', $user_id );
1386
+		$user = get_user_by('ID', $user_id);
1387 1387
 
1388 1388
 		// Prepare Reset Password URL.
1389
-		$reset_password_url = esc_url( add_query_arg( array(
1389
+		$reset_password_url = esc_url(add_query_arg(array(
1390 1390
 			'action' => 'rp',
1391
-			'key'    => get_password_reset_key( $user ),
1391
+			'key'    => get_password_reset_key($user),
1392 1392
 			'login'  => $user->user_login,
1393
-		), wp_login_url() ) );
1393
+		), wp_login_url()));
1394 1394
 	}
1395 1395
 
1396 1396
 	return $reset_password_url;
@@ -1409,94 +1409,94 @@  discard block
 block discarded – undo
1409 1409
  *
1410 1410
  * @return mixed
1411 1411
  */
1412
-function __give_render_metadata_email_tag( $content, $tag_args ) {
1413
-	preg_match_all( "/{meta_([A-z0-9\-\_\ ]+)}/s", $content, $matches );
1412
+function __give_render_metadata_email_tag($content, $tag_args) {
1413
+	preg_match_all("/{meta_([A-z0-9\-\_\ ]+)}/s", $content, $matches);
1414 1414
 
1415
-	if ( ! empty( $matches[0] ) ) {
1415
+	if ( ! empty($matches[0])) {
1416 1416
 		$search = $replace = array();
1417
-		foreach ( $matches[0] as $index => $meta_tag ) {
1418
-			if ( in_array( $meta_tag, $search ) ) {
1417
+		foreach ($matches[0] as $index => $meta_tag) {
1418
+			if (in_array($meta_tag, $search)) {
1419 1419
 				continue;
1420 1420
 			}
1421 1421
 
1422 1422
 			$search[] = $meta_tag;
1423 1423
 
1424
-			$meta_tag     = str_replace( array( '{', 'meta_', '}' ), '', $meta_tag );
1425
-			$meta_tag_arr = array_map( 'trim', explode( ' ', $meta_tag, 2 ) );
1426
-			$meta_tag     = current( $meta_tag_arr );
1424
+			$meta_tag     = str_replace(array('{', 'meta_', '}'), '', $meta_tag);
1425
+			$meta_tag_arr = array_map('trim', explode(' ', $meta_tag, 2));
1426
+			$meta_tag     = current($meta_tag_arr);
1427 1427
 
1428
-			$meta_tag  = str_replace( array( '{', 'meta_', '}' ), '', $meta_tag );
1429
-			$type      = current( explode( '_', $meta_tag, 2 ) );
1430
-			$meta_name = preg_replace( "/^{$type}_/", '', $meta_tag );
1428
+			$meta_tag  = str_replace(array('{', 'meta_', '}'), '', $meta_tag);
1429
+			$type      = current(explode('_', $meta_tag, 2));
1430
+			$meta_name = preg_replace("/^{$type}_/", '', $meta_tag);
1431 1431
 
1432
-			switch ( $type ) {
1432
+			switch ($type) {
1433 1433
 				case 'donation':
1434 1434
 
1435 1435
 					//Bailout.
1436
-					if ( ! isset( $tag_args['payment_id'] ) ) {
1436
+					if ( ! isset($tag_args['payment_id'])) {
1437 1437
 						$replace[] = '';
1438 1438
 						continue;
1439 1439
 					}
1440 1440
 
1441
-					$meta_data = give_get_meta( absint( $tag_args['payment_id'] ), $meta_name, true, '' );
1441
+					$meta_data = give_get_meta(absint($tag_args['payment_id']), $meta_name, true, '');
1442 1442
 
1443
-					if ( ! isset( $meta_tag_arr[1] ) || ! is_array( $meta_data ) ) {
1443
+					if ( ! isset($meta_tag_arr[1]) || ! is_array($meta_data)) {
1444 1444
 						$replace[] = $meta_data;
1445
-					} elseif ( in_array( $meta_tag_arr[1], array_keys( $meta_data ) ) ) {
1446
-						$replace[] = $meta_data[ $meta_tag_arr[1] ];
1445
+					} elseif (in_array($meta_tag_arr[1], array_keys($meta_data))) {
1446
+						$replace[] = $meta_data[$meta_tag_arr[1]];
1447 1447
 					}
1448 1448
 
1449 1449
 					break;
1450 1450
 
1451 1451
 				case 'form':
1452
-					$form_id = isset( $tag_args['form_id'] ) ? absint( $tag_args['form_id'] ) : 0;
1452
+					$form_id = isset($tag_args['form_id']) ? absint($tag_args['form_id']) : 0;
1453 1453
 
1454 1454
 					// Bailout.
1455
-					if ( ! $form_id && isset( $tag_args['payment_id'] ) ) {
1456
-						$form_id = give_get_payment_form_id( $tag_args['payment_id'] );
1455
+					if ( ! $form_id && isset($tag_args['payment_id'])) {
1456
+						$form_id = give_get_payment_form_id($tag_args['payment_id']);
1457 1457
 					}
1458 1458
 
1459
-					$meta_data = give_get_meta( $form_id, $meta_name, true, '' );
1460
-					if ( ! isset( $meta_tag_arr[1] ) || ! is_array( $meta_data ) ) {
1459
+					$meta_data = give_get_meta($form_id, $meta_name, true, '');
1460
+					if ( ! isset($meta_tag_arr[1]) || ! is_array($meta_data)) {
1461 1461
 						$replace[] = $meta_data;
1462
-					} elseif ( in_array( $meta_tag_arr[1], array_keys( $meta_data ) ) ) {
1463
-						$replace[] = $meta_data[ $meta_tag_arr[1] ];
1462
+					} elseif (in_array($meta_tag_arr[1], array_keys($meta_data))) {
1463
+						$replace[] = $meta_data[$meta_tag_arr[1]];
1464 1464
 					}
1465 1465
 					break;
1466 1466
 
1467 1467
 				case 'donor':
1468
-					$donor_id = isset( $tag_args['donor_id'] ) ? absint( $tag_args['donor_id'] ) : 0;
1468
+					$donor_id = isset($tag_args['donor_id']) ? absint($tag_args['donor_id']) : 0;
1469 1469
 
1470 1470
 					// Bailout.
1471
-					if ( ! $donor_id ) {
1472
-						if ( isset( $tag_args['payment_id'] ) ) {
1473
-							$donor_id = give_get_payment_donor_id( $tag_args['payment_id'] );
1474
-						} elseif ( isset( $tag_args['user_id'] ) ) {
1475
-							$donor_id = Give()->donors->get_column_by( 'id', 'user_id', $tag_args['user_id'] );
1471
+					if ( ! $donor_id) {
1472
+						if (isset($tag_args['payment_id'])) {
1473
+							$donor_id = give_get_payment_donor_id($tag_args['payment_id']);
1474
+						} elseif (isset($tag_args['user_id'])) {
1475
+							$donor_id = Give()->donors->get_column_by('id', 'user_id', $tag_args['user_id']);
1476 1476
 						}
1477 1477
 					}
1478 1478
 
1479
-					$meta_data = Give()->donor_meta->get_meta( $donor_id, $meta_name, true );
1479
+					$meta_data = Give()->donor_meta->get_meta($donor_id, $meta_name, true);
1480 1480
 
1481
-					if( empty( $meta_data ) && in_array( $meta_name, array_keys( Give()->donors->get_columns() ) ) ) {
1482
-						$meta_data = Give()->donors->get_column_by( $meta_name, 'id', $donor_id );
1481
+					if (empty($meta_data) && in_array($meta_name, array_keys(Give()->donors->get_columns()))) {
1482
+						$meta_data = Give()->donors->get_column_by($meta_name, 'id', $donor_id);
1483 1483
 					}
1484 1484
 
1485
-					if ( ! isset( $meta_tag_arr[1] ) || ! is_array( $meta_data ) ) {
1485
+					if ( ! isset($meta_tag_arr[1]) || ! is_array($meta_data)) {
1486 1486
 						$replace[] = $meta_data;
1487
-					} elseif ( in_array( $meta_tag_arr[1], array_keys( $meta_data ) ) ) {
1488
-						$replace[] = $meta_data[ $meta_tag_arr[1] ];
1487
+					} elseif (in_array($meta_tag_arr[1], array_keys($meta_data))) {
1488
+						$replace[] = $meta_data[$meta_tag_arr[1]];
1489 1489
 					}
1490 1490
 
1491 1491
 					break;
1492 1492
 
1493 1493
 				default:
1494
-					$replace[] = end( $search );
1494
+					$replace[] = end($search);
1495 1495
 			}
1496 1496
 		}
1497 1497
 
1498
-		if ( ! empty( $search ) && ! empty( $replace ) ) {
1499
-			$content = str_replace( $search, $replace, $content );
1498
+		if ( ! empty($search) && ! empty($replace)) {
1499
+			$content = str_replace($search, $replace, $content);
1500 1500
 		}
1501 1501
 	}
1502 1502
 
@@ -1504,4 +1504,4 @@  discard block
 block discarded – undo
1504 1504
 	return $content;
1505 1505
 }
1506 1506
 
1507
-add_filter( 'give_email_template_tags', '__give_render_metadata_email_tag', 10, 2 );
1507
+add_filter('give_email_template_tags', '__give_render_metadata_email_tag', 10, 2);
Please login to merge, or discard this patch.
includes/emails/functions.php 1 patch
Spacing   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
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
 
@@ -26,14 +26,14 @@  discard block
 block discarded – undo
26 26
  *
27 27
  * @return void
28 28
  */
29
-function give_email_donation_receipt( $payment_id, $admin_notice = true ) {
29
+function give_email_donation_receipt($payment_id, $admin_notice = true) {
30 30
 	/**
31 31
 	 * Fire the action
32 32
 	 */
33
-	do_action( 'give_donation-receipt_email_notification', $payment_id );
33
+	do_action('give_donation-receipt_email_notification', $payment_id);
34 34
 
35 35
 	// If admin notifications are on, send the admin notice.
36
-	if ( $admin_notice && give_is_setting_enabled( Give_Email_Notification::get_instance('new-donation' )->get_notification_status() ) ) {
36
+	if ($admin_notice && give_is_setting_enabled(Give_Email_Notification::get_instance('new-donation')->get_notification_status())) {
37 37
 		/**
38 38
 		 * Fires in the donation email receipt.
39 39
 		 *
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 		 * @param int   $payment_id   Payment id.
45 45
 		 * @param mixed $payment_data Payment meta data.
46 46
 		 */
47
-		do_action( 'give_new-donation_email_notification', $payment_id, give_get_payment_meta( $payment_id ) );
47
+		do_action('give_new-donation_email_notification', $payment_id, give_get_payment_meta($payment_id));
48 48
 	}
49 49
 }
50 50
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
  *
58 58
  * @return void
59 59
  */
60
-function give_admin_email_notice( $payment_id ) {
60
+function give_admin_email_notice($payment_id) {
61 61
 	/**
62 62
 	 * Fires in the donation email receipt.
63 63
 	 *
@@ -68,10 +68,10 @@  discard block
 block discarded – undo
68 68
 	 * @param int   $payment_id   Payment id.
69 69
 	 * @param mixed $payment_data Payment meta data.
70 70
 	 */
71
-	do_action( 'give_new-donation_email_notification', $payment_id );
71
+	do_action('give_new-donation_email_notification', $payment_id);
72 72
 }
73 73
 
74
-add_action( 'give_admin_donation_email', 'give_admin_email_notice' );
74
+add_action('give_admin_donation_email', 'give_admin_email_notice');
75 75
 
76 76
 
77 77
 /**
@@ -84,16 +84,16 @@  discard block
 block discarded – undo
84 84
  */
85 85
 function give_get_default_donation_notification_email() {
86 86
 
87
-	$default_email_body = __( 'Hi there,', 'give' ) . "\n\n";
88
-	$default_email_body .= __( 'This email is to inform you that a new donation has been made on your website:', 'give' ) . ' <a href="' . get_bloginfo( 'url' ) . '" target="_blank">' . get_bloginfo( 'url' ) . '</a>' . ".\n\n";
89
-	$default_email_body .= '<strong>' . __( 'Donor:', 'give' ) . '</strong> {name}' . "\n";
90
-	$default_email_body .= '<strong>' . __( 'Donation:', 'give' ) . '</strong> {donation}' . "\n";
91
-	$default_email_body .= '<strong>' . __( 'Amount:', 'give' ) . '</strong> {amount}' . "\n";
92
-	$default_email_body .= '<strong>' . __( 'Payment Method:', 'give' ) . '</strong> {payment_method}' . "\n\n";
93
-	$default_email_body .= __( 'Thank you,', 'give' ) . "\n\n";
94
-	$default_email_body .= '{sitename}' . "\n";
87
+	$default_email_body = __('Hi there,', 'give')."\n\n";
88
+	$default_email_body .= __('This email is to inform you that a new donation has been made on your website:', 'give').' <a href="'.get_bloginfo('url').'" target="_blank">'.get_bloginfo('url').'</a>'.".\n\n";
89
+	$default_email_body .= '<strong>'.__('Donor:', 'give').'</strong> {name}'."\n";
90
+	$default_email_body .= '<strong>'.__('Donation:', 'give').'</strong> {donation}'."\n";
91
+	$default_email_body .= '<strong>'.__('Amount:', 'give').'</strong> {amount}'."\n";
92
+	$default_email_body .= '<strong>'.__('Payment Method:', 'give').'</strong> {payment_method}'."\n\n";
93
+	$default_email_body .= __('Thank you,', 'give')."\n\n";
94
+	$default_email_body .= '{sitename}'."\n";
95 95
 
96
-	return apply_filters( 'give_default_donation_notification_email', $default_email_body );
96
+	return apply_filters('give_default_donation_notification_email', $default_email_body);
97 97
 }
98 98
 
99 99
 
@@ -107,21 +107,21 @@  discard block
 block discarded – undo
107 107
  */
108 108
 function give_get_default_donation_receipt_email() {
109 109
 
110
-	$default_email_body = __( 'Dear', 'give' ) . " {name},\n\n";
111
-	$default_email_body .= __( 'Thank you for your donation. Your generosity is appreciated! Here are the details of your donation:', 'give' ) . "\n\n";
112
-	$default_email_body .= '<strong>' . __( 'Donor:', 'give' ) . '</strong> {fullname}' . "\n";
113
-	$default_email_body .= '<strong>' . __( 'Donation:', 'give' ) . '</strong> {donation}' . "\n";
114
-	$default_email_body .= '<strong>' . __( 'Donation Date:', 'give' ) . '</strong> {date}' . "\n";
115
-	$default_email_body .= '<strong>' . __( 'Amount:', 'give' ) . '</strong> {amount}' . "\n";
116
-	$default_email_body .= '<strong>' . __( 'Payment Method:', 'give' ) . '</strong> {payment_method}' . "\n";
117
-	$default_email_body .= '<strong>' . __( 'Payment ID:', 'give' ) . '</strong> {payment_id}' . "\n";
118
-	$default_email_body .= '<strong>' . __( 'Receipt ID:', 'give' ) . '</strong> {receipt_id}' . "\n\n";
119
-	$default_email_body .= '{receipt_link}' . "\n\n";
110
+	$default_email_body = __('Dear', 'give')." {name},\n\n";
111
+	$default_email_body .= __('Thank you for your donation. Your generosity is appreciated! Here are the details of your donation:', 'give')."\n\n";
112
+	$default_email_body .= '<strong>'.__('Donor:', 'give').'</strong> {fullname}'."\n";
113
+	$default_email_body .= '<strong>'.__('Donation:', 'give').'</strong> {donation}'."\n";
114
+	$default_email_body .= '<strong>'.__('Donation Date:', 'give').'</strong> {date}'."\n";
115
+	$default_email_body .= '<strong>'.__('Amount:', 'give').'</strong> {amount}'."\n";
116
+	$default_email_body .= '<strong>'.__('Payment Method:', 'give').'</strong> {payment_method}'."\n";
117
+	$default_email_body .= '<strong>'.__('Payment ID:', 'give').'</strong> {payment_id}'."\n";
118
+	$default_email_body .= '<strong>'.__('Receipt ID:', 'give').'</strong> {receipt_id}'."\n\n";
119
+	$default_email_body .= '{receipt_link}'."\n\n";
120 120
 	$default_email_body .= "\n\n";
121
-	$default_email_body .= __( 'Sincerely,', 'give' ) . "\n";
122
-	$default_email_body .= '{sitename}' . "\n";
121
+	$default_email_body .= __('Sincerely,', 'give')."\n";
122
+	$default_email_body .= '{sitename}'."\n";
123 123
 
124
-	return apply_filters( 'give_default_donation_receipt_email', $default_email_body );
124
+	return apply_filters('give_default_donation_receipt_email', $default_email_body);
125 125
 }
126 126
 
127 127
 /**
@@ -134,22 +134,22 @@  discard block
 block discarded – undo
134 134
  *
135 135
  * @return array $email_names
136 136
  */
137
-function give_get_email_names( $user_info, $payment = false ) {
137
+function give_get_email_names($user_info, $payment = false) {
138 138
 	$email_names = array();
139 139
 
140
-	if ( is_a( $payment, 'Give_Payment' ) ) {
140
+	if (is_a($payment, 'Give_Payment')) {
141 141
 
142
-		if ( $payment->user_id > 0 ) {
142
+		if ($payment->user_id > 0) {
143 143
 
144
-			$user_data               = get_userdata( $payment->user_id );
144
+			$user_data               = get_userdata($payment->user_id);
145 145
 			$email_names['name']     = $payment->first_name;
146
-			$email_names['fullname'] = trim( $payment->first_name . ' ' . $payment->last_name );
146
+			$email_names['fullname'] = trim($payment->first_name.' '.$payment->last_name);
147 147
 			$email_names['username'] = $user_data->user_login;
148 148
 
149
-		} elseif ( ! empty( $payment->first_name ) ) {
149
+		} elseif ( ! empty($payment->first_name)) {
150 150
 
151 151
 			$email_names['name']     = $payment->first_name;
152
-			$email_names['fullname'] = trim( $payment->first_name . ' ' . $payment->last_name );
152
+			$email_names['fullname'] = trim($payment->first_name.' '.$payment->last_name);
153 153
 			$email_names['username'] = $payment->first_name;
154 154
 
155 155
 		} else {
@@ -162,30 +162,30 @@  discard block
 block discarded – undo
162 162
 	} else {
163 163
 
164 164
 		// Support for old serialized data.
165
-		if ( is_serialized( $user_info ) ) {
165
+		if (is_serialized($user_info)) {
166 166
 
167 167
 			// Security check.
168
-			preg_match( '/[oO]\s*:\s*\d+\s*:\s*"\s*(?!(?i)(stdClass))/', $user_info, $matches );
169
-			if ( ! empty( $matches ) ) {
168
+			preg_match('/[oO]\s*:\s*\d+\s*:\s*"\s*(?!(?i)(stdClass))/', $user_info, $matches);
169
+			if ( ! empty($matches)) {
170 170
 				return array(
171 171
 					'name'     => '',
172 172
 					'fullname' => '',
173 173
 					'username' => '',
174 174
 				);
175 175
 			} else {
176
-				$user_info = maybe_unserialize( $user_info );
176
+				$user_info = maybe_unserialize($user_info);
177 177
 			}
178 178
 
179 179
 		}
180 180
 
181
-		if ( isset( $user_info['id'] ) && $user_info['id'] > 0 && isset( $user_info['first_name'] ) ) {
182
-			$user_data               = get_userdata( $user_info['id'] );
181
+		if (isset($user_info['id']) && $user_info['id'] > 0 && isset($user_info['first_name'])) {
182
+			$user_data               = get_userdata($user_info['id']);
183 183
 			$email_names['name']     = $user_info['first_name'];
184
-			$email_names['fullname'] = $user_info['first_name'] . ' ' . $user_info['last_name'];
184
+			$email_names['fullname'] = $user_info['first_name'].' '.$user_info['last_name'];
185 185
 			$email_names['username'] = $user_data->user_login;
186
-		} elseif ( isset( $user_info['first_name'] ) ) {
186
+		} elseif (isset($user_info['first_name'])) {
187 187
 			$email_names['name']     = $user_info['first_name'];
188
-			$email_names['fullname'] = $user_info['first_name'] . ' ' . $user_info['last_name'];
188
+			$email_names['fullname'] = $user_info['first_name'].' '.$user_info['last_name'];
189 189
 			$email_names['username'] = $user_info['first_name'];
190 190
 		} else {
191 191
 			$email_names['name']     = $user_info['email'];
@@ -205,37 +205,37 @@  discard block
 block discarded – undo
205 205
  *
206 206
  * @since 1.8.14
207 207
  */
208
-function give_admin_email_user_donor_disconnection( $user_id, $donor_id ) {
208
+function give_admin_email_user_donor_disconnection($user_id, $donor_id) {
209 209
 
210
-	$user_id  = absint( $user_id );
211
-	$donor_id = absint( $donor_id );
210
+	$user_id  = absint($user_id);
211
+	$donor_id = absint($donor_id);
212 212
 
213 213
 	// Bail Out, if user id doesn't exists.
214
-	if ( empty( $user_id ) ) {
214
+	if (empty($user_id)) {
215 215
 		return;
216 216
 	}
217 217
 
218 218
 	// Bail Out, if donor id doesn't exists.
219
-	if ( empty( $donor_id ) ) {
219
+	if (empty($donor_id)) {
220 220
 		return;
221 221
 	}
222 222
 
223
-	$from_name = give_get_option( 'from_name', wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ) );
223
+	$from_name = give_get_option('from_name', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES));
224 224
 
225
-	$from_email = give_get_option( 'from_email', get_bloginfo( 'admin_email' ) );
225
+	$from_email = give_get_option('from_email', get_bloginfo('admin_email'));
226 226
 
227 227
 	/* translators: %s: payment id */
228
-	$subject = __( 'Attention: User tries to login whose Donor profile is disconnected!', 'give' );
228
+	$subject = __('Attention: User tries to login whose Donor profile is disconnected!', 'give');
229 229
 
230 230
 	/**
231 231
 	 * Filters the Donor-User Disconnection notification subject.
232 232
 	 *
233 233
 	 * @since 1.8.14
234 234
 	 */
235
-	$subject = apply_filters( 'give_admin_donor_user_disconnection_notification_subject', wp_strip_all_tags( $subject ) );
235
+	$subject = apply_filters('give_admin_donor_user_disconnection_notification_subject', wp_strip_all_tags($subject));
236 236
 
237
-	$headers = "From: " . stripslashes_deep( html_entity_decode( $from_name, ENT_COMPAT, 'UTF-8' ) ) . " <$from_email>\r\n";
238
-	$headers .= "Reply-To: " . $from_email . "\r\n";
237
+	$headers = "From: ".stripslashes_deep(html_entity_decode($from_name, ENT_COMPAT, 'UTF-8'))." <$from_email>\r\n";
238
+	$headers .= "Reply-To: ".$from_email."\r\n";
239 239
 	$headers .= "Content-Type: text/html; charset=utf-8\r\n";
240 240
 
241 241
 	/**
@@ -243,25 +243,25 @@  discard block
 block discarded – undo
243 243
 	 *
244 244
 	 * @since 1.8.14
245 245
 	 */
246
-	$headers = apply_filters( 'give_admin_donor_user_disconnection_notification_headers', $headers );
246
+	$headers = apply_filters('give_admin_donor_user_disconnection_notification_headers', $headers);
247 247
 
248
-	$message = __( 'Hi Admin,', 'give' ) . "\n\n";
249
-	$message .= __( 'This email is to inform you that a user has tried logging in. But, User was unable to login due to User-Donor profile disconnection.', 'give' ) . "\n\n";
250
-	$message .= __( 'Do you want to reconnect User and Donor profile again?', 'give' ) . "\n\n";
248
+	$message = __('Hi Admin,', 'give')."\n\n";
249
+	$message .= __('This email is to inform you that a user has tried logging in. But, User was unable to login due to User-Donor profile disconnection.', 'give')."\n\n";
250
+	$message .= __('Do you want to reconnect User and Donor profile again?', 'give')."\n\n";
251 251
 	$message .= sprintf(
252 252
 		'<a href="%1$s">%2$s</a>',
253
-		esc_url( admin_url() . 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $donor_id . '&user_id=' . $user_id . '&give-message=reconnect-user' ),
254
-		__( 'Reconnect User', 'give' ) . "\n\n"
253
+		esc_url(admin_url().'edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$donor_id.'&user_id='.$user_id.'&give-message=reconnect-user'),
254
+		__('Reconnect User', 'give')."\n\n"
255 255
 	);
256
-	$message .= __( 'Thank you,', 'give' ) . "\n\n";
257
-	$message .= '{sitename}' . "\n";
256
+	$message .= __('Thank you,', 'give')."\n\n";
257
+	$message .= '{sitename}'."\n";
258 258
 
259 259
 	$emails = Give()->emails;
260
-	$emails->__set( 'from_name', $from_name );
261
-	$emails->__set( 'from_email', $from_email );
262
-	$emails->__set( 'headers', $headers );
263
-	$emails->__set( 'heading', __( 'User - Donor Profile Disconnection', 'give' ) );
260
+	$emails->__set('from_name', $from_name);
261
+	$emails->__set('from_email', $from_email);
262
+	$emails->__set('headers', $headers);
263
+	$emails->__set('heading', __('User - Donor Profile Disconnection', 'give'));
264 264
 
265
-	$emails->send( give_get_admin_notice_emails(), $subject, give_do_email_tags( $message ) );
265
+	$emails->send(give_get_admin_notice_emails(), $subject, give_do_email_tags($message));
266 266
 
267 267
 }
Please login to merge, or discard this patch.