Test Failed
Push — master ( 26906f...b49498 )
by Devin
05:35
created
includes/admin/emails/class-new-offline-donation-email.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -12,11 +12,11 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if access directly.
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
19
-if ( ! class_exists( 'Give_New_Offline_Donation_Email' ) ) :
19
+if ( ! class_exists('Give_New_Offline_Donation_Email')) :
20 20
 
21 21
 	/**
22 22
 	 * Give_New_Offline_Donation_Email
@@ -36,32 +36,32 @@  discard block
 block discarded – undo
36 36
 		 */
37 37
 		public function init() {
38 38
 			// Initialize empty payment.
39
-			$this->payment = new Give_Payment( 0 );
39
+			$this->payment = new Give_Payment(0);
40 40
 
41
-			$this->load( array(
41
+			$this->load(array(
42 42
 				'id'                           => 'new-offline-donation',
43
-				'label'                        => __( 'New Offline Donation', 'give' ),
44
-				'description'                  => __( 'Sent to designated recipient(s) for a new (pending) offline donation.', 'give' ),
43
+				'label'                        => __('New Offline Donation', 'give'),
44
+				'description'                  => __('Sent to designated recipient(s) for a new (pending) offline donation.', 'give'),
45 45
 				'has_recipient_field'          => true,
46
-				'notification_status'          => give_is_gateway_active( 'offline' ) ? 'enabled' : 'disabled',
46
+				'notification_status'          => give_is_gateway_active('offline') ? 'enabled' : 'disabled',
47 47
 				'notification_status_editable' => false,
48 48
 				'preview_email_tags_values'    => array(
49
-					'payment_method' => esc_html__( 'Offline', 'give' ),
49
+					'payment_method' => esc_html__('Offline', 'give'),
50 50
 				),
51 51
 				'default_email_subject'        => $this->get_default_email_subject(),
52 52
 				'default_email_message'        => $this->get_default_email_message(),
53 53
 				'notices' => array(
54 54
 					'non-notification-status-editable' => sprintf(
55 55
 						'%1$s <a href="%2$s">%3$s &raquo;</a>',
56
-						__( 'This notification is automatically toggled based on whether the gateway is enabled or not.', 'give' ),
57
-						esc_url( admin_url('edit.php?post_type=give_forms&page=give-settings&tab=gateways&section=offline-donations') ),
58
-						__( 'Edit Setting', 'give' )
56
+						__('This notification is automatically toggled based on whether the gateway is enabled or not.', 'give'),
57
+						esc_url(admin_url('edit.php?post_type=give_forms&page=give-settings&tab=gateways&section=offline-donations')),
58
+						__('Edit Setting', 'give')
59 59
 					)
60 60
 				),
61
-			) );
61
+			));
62 62
 
63
-			add_action( 'give_insert_payment', array( $this, 'setup_email_notification' ) );
64
-			add_action( 'give_save_settings_give_settings', array( $this, 'set_notification_status' ), 10, 2 );
63
+			add_action('give_insert_payment', array($this, 'setup_email_notification'));
64
+			add_action('give_save_settings_give_settings', array($this, 'set_notification_status'), 10, 2);
65 65
 		}
66 66
 
67 67
 		/**
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 			 */
81 81
 			$subject = apply_filters(
82 82
 				'give_offline_admin_donation_notification_subject',
83
-				__( 'New Pending Donation', 'give' )
83
+				__('New Pending Donation', 'give')
84 84
 			);
85 85
 
86 86
 			/**
@@ -105,18 +105,18 @@  discard block
 block discarded – undo
105 105
 		 * @return string
106 106
 		 */
107 107
 		public function get_default_email_message() {
108
-			$message = __( 'Dear Admin,', 'give' ) . "\n\n";
109
-			$message .= __( 'An offline donation has been made on your website:', 'give' ) . ' ' . get_bloginfo( 'name' ) . ' ';
110
-			$message .= __( 'Hooray! The donation is in a pending status and is awaiting payment. Donation instructions have been emailed to the donor. Once you receive payment, be sure to mark the donation as complete using the link below.', 'give' ) . "\n\n";
108
+			$message = __('Dear Admin,', 'give')."\n\n";
109
+			$message .= __('An offline donation has been made on your website:', 'give').' '.get_bloginfo('name').' ';
110
+			$message .= __('Hooray! The donation is in a pending status and is awaiting payment. Donation instructions have been emailed to the donor. Once you receive payment, be sure to mark the donation as complete using the link below.', 'give')."\n\n";
111 111
 
112
-			$message .= '<strong>' . __( 'Donor:', 'give' ) . '</strong> {fullname}' . "\n";
113
-			$message .= '<strong>' . __( 'Amount:', 'give' ) . '</strong> {amount}' . "\n\n";
112
+			$message .= '<strong>'.__('Donor:', 'give').'</strong> {fullname}'."\n";
113
+			$message .= '<strong>'.__('Amount:', 'give').'</strong> {amount}'."\n\n";
114 114
 
115 115
 			$message .= sprintf(
116 116
 				'<a href="%1$s">%2$s</a>',
117
-				admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id=' . $this->payment->ID ),
118
-				__( 'Click Here to View and/or Update Donation Details', 'give' )
119
-			) . "\n\n";
117
+				admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id='.$this->payment->ID),
118
+				__('Click Here to View and/or Update Donation Details', 'give')
119
+			)."\n\n";
120 120
 
121 121
 			/**
122 122
 			 * Filter the donation receipt email message
@@ -154,10 +154,10 @@  discard block
 block discarded – undo
154 154
 		 *
155 155
 		 * @return string
156 156
 		 */
157
-		public function get_email_message( $form_id = null ) {
157
+		public function get_email_message($form_id = null) {
158 158
 			$message = Give_Email_Notification_Util::get_value(
159 159
 				$this,
160
-				Give_Email_Setting_Field::get_prefix( $this, $form_id ) . 'email_message',
160
+				Give_Email_Setting_Field::get_prefix($this, $form_id).'email_message',
161 161
 				$form_id,
162 162
 				$this->config['default_email_message']
163 163
 			);
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 		 *
198 198
 		 * @return array
199 199
 		 */
200
-		public function get_email_attachments( $form_id = null ) {
200
+		public function get_email_attachments($form_id = null) {
201 201
 			/**
202 202
 			 * Filter the attachments.
203 203
 			 * Note: This filter will deprecate soon.
@@ -248,11 +248,11 @@  discard block
 block discarded – undo
248 248
 		 *
249 249
 		 * @param int $payment_id
250 250
 		 */
251
-		public function setup_email_notification( $payment_id ) {
252
-			$this->payment = new Give_Payment( $payment_id );
251
+		public function setup_email_notification($payment_id) {
252
+			$this->payment = new Give_Payment($payment_id);
253 253
 
254 254
 			// Exit if not donation was not with offline donation.
255
-			if ( 'offline' !== $this->payment->gateway ) {
255
+			if ('offline' !== $this->payment->gateway) {
256 256
 				return;
257 257
 			}
258 258
 
@@ -260,9 +260,9 @@  discard block
 block discarded – undo
260 260
 			$this->setup_email_data();
261 261
 
262 262
 			// Send email.
263
-			$this->send_email_notification( array(
263
+			$this->send_email_notification(array(
264 264
 				'payment_id' => $this->payment->ID,
265
-			) );
265
+			));
266 266
 		}
267 267
 
268 268
 		/**
@@ -274,18 +274,18 @@  discard block
 block discarded – undo
274 274
 		 * @param $update_options
275 275
 		 * @param $option_name
276 276
 		 */
277
-		public function set_notification_status( $update_options, $option_name ) {
277
+		public function set_notification_status($update_options, $option_name) {
278 278
 			// Get updated settings.
279 279
 			$update_options = give_get_settings();
280 280
 
281
-			$notification_status = isset( $update_options['gateways']['offline'] ) ? 'enabled' : 'disabled';
281
+			$notification_status = isset($update_options['gateways']['offline']) ? 'enabled' : 'disabled';
282 282
 
283 283
 			if (
284
-				empty( $update_options[ "{$this->config['id']}_notification" ] )
285
-				|| $notification_status !== $update_options[ "{$this->config['id']}_notification" ]
284
+				empty($update_options["{$this->config['id']}_notification"])
285
+				|| $notification_status !== $update_options["{$this->config['id']}_notification"]
286 286
 			) {
287
-				$update_options[ "{$this->config['id']}_notification" ] = $notification_status;
288
-				update_option( $option_name, $update_options );
287
+				$update_options["{$this->config['id']}_notification"] = $notification_status;
288
+				update_option($option_name, $update_options);
289 289
 			}
290 290
 		}
291 291
 
@@ -300,13 +300,13 @@  discard block
 block discarded – undo
300 300
 		 *
301 301
 		 * @return array
302 302
 		 */
303
-		public function add_metabox_setting_field( $settings, $form_id ) {
303
+		public function add_metabox_setting_field($settings, $form_id) {
304 304
 
305
-			if ( in_array( 'offline', array_keys( give_get_enabled_payment_gateways($form_id) ) ) ) {
305
+			if (in_array('offline', array_keys(give_get_enabled_payment_gateways($form_id)))) {
306 306
 				$settings[] = array(
307 307
 					'id'     => $this->config['id'],
308 308
 					'title'  => $this->config['label'],
309
-					'fields' => $this->get_setting_fields( $form_id ),
309
+					'fields' => $this->get_setting_fields($form_id),
310 310
 				);
311 311
 			}
312 312
 
Please login to merge, or discard this patch.
includes/admin/emails/filters.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -19,28 +19,28 @@  discard block
 block discarded – undo
19 19
  *
20 20
  * @return array
21 21
  */
22
-function give_email_notification_row_actions_callback( $row_actions, $email ) {
23
-	if( Give_Email_Notification_Util::is_email_preview( $email ) ) {
22
+function give_email_notification_row_actions_callback($row_actions, $email) {
23
+	if (Give_Email_Notification_Util::is_email_preview($email)) {
24 24
 		$preview_link = sprintf(
25 25
 			'<a href="%1$s" target="_blank">%2$s</a>',
26 26
 			wp_nonce_url(
27 27
 				add_query_arg(
28
-					array( 'give_action' => 'preview_email', 'email_type' => $email->config['id'] ),
28
+					array('give_action' => 'preview_email', 'email_type' => $email->config['id']),
29 29
 					home_url()
30 30
 				), 'give-preview-email'
31 31
 			),
32
-			__( 'Preview', 'give' )
32
+			__('Preview', 'give')
33 33
 		);
34 34
 
35 35
 		$send_preview_email_link = sprintf(
36 36
 			'<a href="%1$s">%2$s</a>',
37 37
 			wp_nonce_url(
38
-				add_query_arg( array(
38
+				add_query_arg(array(
39 39
 					'give_action'  => 'send_preview_email',
40 40
 					'email_type' => $email->config['id'],
41 41
 					'give-message' => 'sent-test-email',
42
-				) ), 'give-send-preview-email' ),
43
-			__( 'Send test email', 'give' )
42
+				)), 'give-send-preview-email' ),
43
+			__('Send test email', 'give')
44 44
 		);
45 45
 
46 46
 		$row_actions['email_preview'] = $preview_link;
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
 	return $row_actions;
51 51
 }
52
-add_filter( 'give_email_notification_row_actions', 'give_email_notification_row_actions_callback', 10, 2 );
52
+add_filter('give_email_notification_row_actions', 'give_email_notification_row_actions_callback', 10, 2);
53 53
 
54 54
 /**
55 55
  * This help to decode all email template tags.
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
  *
62 62
  * @return string
63 63
  */
64
-function give_decode_email_tags( $message, $email_obj ) {
65
-	if ( ! empty( $email_obj->tag_args ) ) {
66
-		$message = give_do_email_tags( $message, $email_obj->tag_args );
64
+function give_decode_email_tags($message, $email_obj) {
65
+	if ( ! empty($email_obj->tag_args)) {
66
+		$message = give_do_email_tags($message, $email_obj->tag_args);
67 67
 	}
68 68
 
69 69
 	return $message;
70 70
 }
71 71
 
72
-add_filter( 'give_email_message', 'give_decode_email_tags', 10, 2 );
73 72
\ No newline at end of file
73
+add_filter('give_email_message', 'give_decode_email_tags', 10, 2);
74 74
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/emails/class-email-access-email.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -175,10 +175,10 @@
 block discarded – undo
175 175
 		 */
176 176
 		public function get_default_email_message() {
177 177
 			$message = sprintf(
178
-				           __( 'Please click the link to access your donation history on <a target="_blank" href="%1$s">%1$s</a>. If you did not request this email, please contact <a href="mailto:%2$s">%2$s</a>.', 'give' ),
179
-				           get_bloginfo( 'url' ),
180
-				           get_bloginfo( 'admin_email' )
181
-			           ) . "\n\n";
178
+						   __( 'Please click the link to access your donation history on <a target="_blank" href="%1$s">%1$s</a>. If you did not request this email, please contact <a href="mailto:%2$s">%2$s</a>.', 'give' ),
179
+						   get_bloginfo( 'url' ),
180
+						   get_bloginfo( 'admin_email' )
181
+					   ) . "\n\n";
182 182
 			$message .= '{email_access_link}' . "\n\n";
183 183
 			$message .= "\n\n";
184 184
 			$message .= __( 'Sincerely,', 'give' ) . "\n";
Please login to merge, or discard this patch.
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 // Exit if access directly.
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit;
16 16
 }
17 17
 
18
-if ( ! class_exists( 'Give_Email_Access_Email' ) ) :
18
+if ( ! class_exists('Give_Email_Access_Email')) :
19 19
 
20 20
 	/**
21 21
 	 * Give_Email_Access_Email
@@ -31,30 +31,30 @@  discard block
 block discarded – undo
31 31
 		 * @since  2.0
32 32
 		 */
33 33
 		public function init() {
34
-			$this->load( array(
34
+			$this->load(array(
35 35
 				'id'                           => 'email-access',
36
-				'label'                        => __( 'Email access', 'give' ),
37
-				'description'                  => __( 'Sent when donors request access to their donation history using only their email as verification. (See Settings > General > Access Control)', 'give' ),
38
-				'notification_status'          => give_get_option( 'email_access', 'disabled' ),
36
+				'label'                        => __('Email access', 'give'),
37
+				'description'                  => __('Sent when donors request access to their donation history using only their email as verification. (See Settings > General > Access Control)', 'give'),
38
+				'notification_status'          => give_get_option('email_access', 'disabled'),
39 39
 				'form_metabox_setting'         => false,
40 40
 				'notification_status_editable' => false,
41 41
 				'email_tag_context'            => 'donor',
42
-				'recipient_group_name'         => __( 'Donor', 'give' ),
43
-				'default_email_subject'        => sprintf( __( 'Please confirm your email for %s', 'give' ), get_bloginfo( 'url' ) ),
42
+				'recipient_group_name'         => __('Donor', 'give'),
43
+				'default_email_subject'        => sprintf(__('Please confirm your email for %s', 'give'), get_bloginfo('url')),
44 44
 				'default_email_message'        => $this->get_default_email_message(),
45 45
 				'notices' => array(
46 46
 					'non-notification-status-editable' => sprintf(
47 47
 						'%1$s <a href="%2$s">%3$s &raquo;</a>',
48
-						__( 'This notification is automatically toggled based on whether the email access is enabled or not.', 'give' ),
49
-						esc_url( admin_url('edit.php?post_type=give_forms&page=give-settings&tab=general&section=access-control') ),
50
-						__( 'Edit Setting', 'give' )
48
+						__('This notification is automatically toggled based on whether the email access is enabled or not.', 'give'),
49
+						esc_url(admin_url('edit.php?post_type=give_forms&page=give-settings&tab=general&section=access-control')),
50
+						__('Edit Setting', 'give')
51 51
 					)
52 52
 				),
53
-			) );
53
+			));
54 54
 
55
-			add_filter( "give_{$this->config['id']}_email_notification", array( $this, 'setup_email_notification' ), 10, 2 );
56
-			add_action( 'give_save_settings_give_settings', array( $this, 'set_notification_status' ), 10, 2 );
57
-			add_filter( 'give_email_preview_header', array( $this, 'email_preview_header' ), 10, 2 );
55
+			add_filter("give_{$this->config['id']}_email_notification", array($this, 'setup_email_notification'), 10, 2);
56
+			add_action('give_save_settings_give_settings', array($this, 'set_notification_status'), 10, 2);
57
+			add_filter('give_email_preview_header', array($this, 'email_preview_header'), 10, 2);
58 58
 		}
59 59
 
60 60
 
@@ -68,11 +68,11 @@  discard block
 block discarded – undo
68 68
 		 *
69 69
 		 * @return string
70 70
 		 */
71
-		public function get_email_subject( $form_id = null ) {
71
+		public function get_email_subject($form_id = null) {
72 72
 			$subject = wp_strip_all_tags(
73 73
 				Give_Email_Notification_Util::get_value(
74 74
 					$this,
75
-					Give_Email_Setting_Field::get_prefix( $this, $form_id ) . 'email_subject',
75
+					Give_Email_Setting_Field::get_prefix($this, $form_id).'email_subject',
76 76
 					$form_id,
77 77
 					$this->config['default_email_subject']
78 78
 				)
@@ -84,14 +84,14 @@  discard block
 block discarded – undo
84 84
 			 *
85 85
 			 * @since 1.0
86 86
 			 */
87
-			$subject = apply_filters( 'give_email_access_token_subject', $subject );
87
+			$subject = apply_filters('give_email_access_token_subject', $subject);
88 88
 
89 89
 			/**
90 90
 			 * Filters the donation notification subject.
91 91
 			 *
92 92
 			 * @since 2.0
93 93
 			 */
94
-			$subject = apply_filters( "give_{$this->config['id']}_get_email_subject", $subject, $this, $form_id );
94
+			$subject = apply_filters("give_{$this->config['id']}_get_email_subject", $subject, $this, $form_id);
95 95
 
96 96
 			return $subject;
97 97
 		}
@@ -107,10 +107,10 @@  discard block
 block discarded – undo
107 107
 		 *
108 108
 		 * @return string
109 109
 		 */
110
-		public function get_email_message( $form_id = null ) {
110
+		public function get_email_message($form_id = null) {
111 111
 			$message = Give_Email_Notification_Util::get_value(
112 112
 				$this,
113
-				Give_Email_Setting_Field::get_prefix( $this, $form_id ) . 'email_message',
113
+				Give_Email_Setting_Field::get_prefix($this, $form_id).'email_message',
114 114
 				$form_id,
115 115
 				$this->config['default_email_message']
116 116
 			);
@@ -121,14 +121,14 @@  discard block
 block discarded – undo
121 121
 			 *
122 122
 			 * @since 1.0
123 123
 			 */
124
-			$message = apply_filters( 'give_email_access_token_message', $message );
124
+			$message = apply_filters('give_email_access_token_message', $message);
125 125
 
126 126
 			/**
127 127
 			 * Filter the email message
128 128
 			 *
129 129
 			 * @since 2.0
130 130
 			 */
131
-			$message = apply_filters( "give_{$this->config['id']}_get_default_email_message", $message, $this, $form_id );
131
+			$message = apply_filters("give_{$this->config['id']}_get_default_email_message", $message, $this, $form_id);
132 132
 
133 133
 			return $message;
134 134
 		}
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 		 * @param int $form_id
144 144
 		 * @return array
145 145
 		 */
146
-		public function get_email_attachments( $form_id = null ) {
146
+		public function get_email_attachments($form_id = null) {
147 147
 			/**
148 148
 			 * Filters the donation notification email attachments.
149 149
 			 * By default, there is no attachment but plugins can hook in to provide one more multiple.
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 			 *
152 152
 			 * @since 1.0
153 153
 			 */
154
-			$attachments = apply_filters( 'give_admin_donation_notification_attachments', array() );
154
+			$attachments = apply_filters('give_admin_donation_notification_attachments', array());
155 155
 
156 156
 			/**
157 157
 			 * Filters the donation notification email attachments.
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 			 *
160 160
 			 * @since 2.0
161 161
 			 */
162
-			$attachments = apply_filters( "give_{$this->config['id']}_get_email_attachments", $attachments, $this, $form_id );
162
+			$attachments = apply_filters("give_{$this->config['id']}_get_email_attachments", $attachments, $this, $form_id);
163 163
 
164 164
 			return $attachments;
165 165
 		}
@@ -175,14 +175,14 @@  discard block
 block discarded – undo
175 175
 		 */
176 176
 		public function get_default_email_message() {
177 177
 			$message = sprintf(
178
-				           __( 'Please click the link to access your donation history on <a target="_blank" href="%1$s">%1$s</a>. If you did not request this email, please contact <a href="mailto:%2$s">%2$s</a>.', 'give' ),
179
-				           get_bloginfo( 'url' ),
180
-				           get_bloginfo( 'admin_email' )
181
-			           ) . "\n\n";
182
-			$message .= '{email_access_link}' . "\n\n";
178
+				           __('Please click the link to access your donation history on <a target="_blank" href="%1$s">%1$s</a>. If you did not request this email, please contact <a href="mailto:%2$s">%2$s</a>.', 'give'),
179
+				           get_bloginfo('url'),
180
+				           get_bloginfo('admin_email')
181
+			           )."\n\n";
182
+			$message .= '{email_access_link}'."\n\n";
183 183
 			$message .= "\n\n";
184
-			$message .= __( 'Sincerely,', 'give' ) . "\n";
185
-			$message .= get_bloginfo( 'name' ) . "\n";
184
+			$message .= __('Sincerely,', 'give')."\n";
185
+			$message .= get_bloginfo('name')."\n";
186 186
 
187 187
 			/**
188 188
 			 * Filter the new donation email message
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 			 *
192 192
 			 * @param string $message
193 193
 			 */
194
-			return apply_filters( "give_{$this->config['id']}_get_default_email_message", $message, $this );
194
+			return apply_filters("give_{$this->config['id']}_get_default_email_message", $message, $this);
195 195
 		}
196 196
 
197 197
 
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 			 *
208 208
 			 * @since 1.0
209 209
 			 */
210
-			$from_name = apply_filters( 'give_donation_from_name', Give()->emails->get_from_name() );
210
+			$from_name = apply_filters('give_donation_from_name', Give()->emails->get_from_name());
211 211
 
212 212
 			/**
213 213
 			 * Filters the from email.
@@ -215,20 +215,20 @@  discard block
 block discarded – undo
215 215
 			 *
216 216
 			 * @since 1.0
217 217
 			 */
218
-			$from_email = apply_filters( 'give_donation_from_address', Give()->emails->get_from_address() );
218
+			$from_email = apply_filters('give_donation_from_address', Give()->emails->get_from_address());
219 219
 
220
-			Give()->emails->__set( 'from_name', $from_name );
221
-			Give()->emails->__set( 'from_email', $from_email );
222
-			Give()->emails->__set( 'heading', apply_filters( 'give_email_access_token_heading', __( 'Confirm Email', 'give' ) ) );
220
+			Give()->emails->__set('from_name', $from_name);
221
+			Give()->emails->__set('from_email', $from_email);
222
+			Give()->emails->__set('heading', apply_filters('give_email_access_token_heading', __('Confirm Email', 'give')));
223 223
 
224 224
 			/**
225 225
 			 * Filters the donation notification email headers.
226 226
 			 *
227 227
 			 * @since 1.0
228 228
 			 */
229
-			$headers = apply_filters( 'give_admin_donation_notification_headers', Give()->emails->get_headers() );
229
+			$headers = apply_filters('give_admin_donation_notification_headers', Give()->emails->get_headers());
230 230
 
231
-			Give()->emails->__set( 'headers', $headers );
231
+			Give()->emails->__set('headers', $headers);
232 232
 		}
233 233
 
234 234
 		/**
@@ -242,8 +242,8 @@  discard block
 block discarded – undo
242 242
 		 *
243 243
 		 * @return bool
244 244
 		 */
245
-		public function setup_email_notification( $donor_id, $email ) {
246
-			$donor = Give()->donors->get_donor_by( 'email', $email );
245
+		public function setup_email_notification($donor_id, $email) {
246
+			$donor = Give()->donors->get_donor_by('email', $email);
247 247
 			$this->recipient_email = $email;
248 248
 
249 249
 			// Set email data.
@@ -268,17 +268,17 @@  discard block
 block discarded – undo
268 268
 		 * @param $update_options
269 269
 		 * @param $option_name
270 270
 		 */
271
-		public function set_notification_status( $update_options, $option_name ) {
271
+		public function set_notification_status($update_options, $option_name) {
272 272
 			// Get updated settings.
273 273
 			$update_options = give_get_settings();
274 274
 
275 275
 			if (
276
-				! empty( $update_options['email_access'] )
277
-				&& ! empty( $update_options[ "{$this->config['id']}_notification" ] )
278
-				&& $update_options['email_access'] !== $update_options[ "{$this->config['id']}_notification" ]
276
+				! empty($update_options['email_access'])
277
+				&& ! empty($update_options["{$this->config['id']}_notification"])
278
+				&& $update_options['email_access'] !== $update_options["{$this->config['id']}_notification"]
279 279
 			) {
280
-				$update_options[ "{$this->config['id']}_notification" ] = $update_options['email_access'];
281
-				update_option( $option_name, $update_options );
280
+				$update_options["{$this->config['id']}_notification"] = $update_options['email_access'];
281
+				update_option($option_name, $update_options);
282 282
 			}
283 283
 		}
284 284
 
@@ -293,8 +293,8 @@  discard block
 block discarded – undo
293 293
 		 * @param Give_Email_Access_Email $email
294 294
 		 * @return string
295 295
 		 */
296
-		public function email_preview_header( $email_preview_header, $email ) {
297
-			if( $this->config['id'] === $email->config['id'] ) {
296
+		public function email_preview_header($email_preview_header, $email) {
297
+			if ($this->config['id'] === $email->config['id']) {
298 298
 				$email_preview_header = '';
299 299
 			}
300 300
 
Please login to merge, or discard this patch.
includes/admin/emails/class-offline-donation-instruction-email.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -12,11 +12,11 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if access directly.
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
19
-if ( ! class_exists( 'Give_Offline_Donation_Instruction_Email' ) ) :
19
+if ( ! class_exists('Give_Offline_Donation_Instruction_Email')) :
20 20
 
21 21
 	/**
22 22
 	 * Give_Offline_Donation_Instruction_Email
@@ -36,32 +36,32 @@  discard block
 block discarded – undo
36 36
 		 */
37 37
 		public function init() {
38 38
 			// Initialize empty payment.
39
-			$this->payment = new Give_Payment( 0 );
39
+			$this->payment = new Give_Payment(0);
40 40
 
41
-			$this->load( array(
41
+			$this->load(array(
42 42
 				'id'                           => 'offline-donation-instruction',
43
-				'label'                        => __( 'Offline Donation Instructions', 'give' ),
44
-				'description'                  => __( 'Sent to the donor when they submit an offline donation.', 'give' ),
45
-				'notification_status'          => give_is_gateway_active( 'offline' ) ? 'enabled' : 'disabled',
43
+				'label'                        => __('Offline Donation Instructions', 'give'),
44
+				'description'                  => __('Sent to the donor when they submit an offline donation.', 'give'),
45
+				'notification_status'          => give_is_gateway_active('offline') ? 'enabled' : 'disabled',
46 46
 				'form_metabox_setting'         => true,
47 47
 				'notification_status_editable' => false,
48 48
 				'preview_email_tag_values'     => array(
49
-					'payment_method' => esc_html__( 'Offline', 'give' ),
49
+					'payment_method' => esc_html__('Offline', 'give'),
50 50
 				),
51
-				'default_email_subject'        => esc_attr__( '{donation} - Offline Donation Instructions', 'give' ),
51
+				'default_email_subject'        => esc_attr__('{donation} - Offline Donation Instructions', 'give'),
52 52
 				'default_email_message'        => give_get_default_offline_donation_email_content(),
53 53
 				'notices' => array(
54 54
 					'non-notification-status-editable' => sprintf(
55 55
 						'%1$s <a href="%2$s">%3$s &raquo;</a>',
56
-						__( 'This notification is automatically toggled based on whether the gateway is enabled or not.', 'give' ),
57
-						esc_url( admin_url('edit.php?post_type=give_forms&page=give-settings&tab=gateways&section=offline-donations') ),
58
-						__( 'Edit Setting', 'give' )
56
+						__('This notification is automatically toggled based on whether the gateway is enabled or not.', 'give'),
57
+						esc_url(admin_url('edit.php?post_type=give_forms&page=give-settings&tab=gateways&section=offline-donations')),
58
+						__('Edit Setting', 'give')
59 59
 					)
60 60
 				),
61
-			) );
61
+			));
62 62
 
63
-			add_action( 'give_insert_payment', array( $this, 'setup_email_notification' ) );
64
-			add_action( 'give_save_settings_give_settings', array( $this, 'set_notification_status' ), 10, 2 );
63
+			add_action('give_insert_payment', array($this, 'setup_email_notification'));
64
+			add_action('give_save_settings_give_settings', array($this, 'set_notification_status'), 10, 2);
65 65
 		}
66 66
 
67 67
 
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
 		 *
75 75
 		 * @return string
76 76
 		 */
77
-		public function get_email_message( $form_id = null ) {
77
+		public function get_email_message($form_id = null) {
78 78
 			$message = Give_Email_Notification_Util::get_value(
79 79
 				$this,
80
-				Give_Email_Setting_Field::get_prefix( $this, $form_id ) . 'email_message',
80
+				Give_Email_Setting_Field::get_prefix($this, $form_id).'email_message',
81 81
 				$form_id,
82 82
 				$this->config['default_email_message']
83 83
 			);
@@ -106,11 +106,11 @@  discard block
 block discarded – undo
106 106
 		 *
107 107
 		 * @return string
108 108
 		 */
109
-		public function get_email_subject( $form_id = null ) {
109
+		public function get_email_subject($form_id = null) {
110 110
 			$subject = wp_strip_all_tags(
111 111
 				Give_Email_Notification_Util::get_value(
112 112
 					$this,
113
-					Give_Email_Setting_Field::get_prefix( $this, $form_id ) . 'email_subject',
113
+					Give_Email_Setting_Field::get_prefix($this, $form_id).'email_subject',
114 114
 					$form_id,
115 115
 					$this->config['default_email_subject']
116 116
 				)
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 		 * @param int $form_id
140 140
 		 * @return array
141 141
 		 */
142
-		public function get_email_attachments( $form_id = null ) {
142
+		public function get_email_attachments($form_id = null) {
143 143
 			/**
144 144
 			 * Filter the attachments.
145 145
 			 * Note: This filter will deprecate soon.
@@ -202,10 +202,10 @@  discard block
 block discarded – undo
202 202
 				$this->payment->payment_meta
203 203
 			);
204 204
 
205
-			Give()->emails->__set( 'from_name', $from_name );
206
-			Give()->emails->__set( 'from_email', $from_email );
207
-			Give()->emails->__set( 'heading', __( 'Offline Donation Instructions', 'give' ) );
208
-			Give()->emails->__set( 'headers', apply_filters( 'give_receipt_headers', Give()->emails->get_headers(), $this->payment->ID, $this->payment->payment_meta ) );
205
+			Give()->emails->__set('from_name', $from_name);
206
+			Give()->emails->__set('from_email', $from_email);
207
+			Give()->emails->__set('heading', __('Offline Donation Instructions', 'give'));
208
+			Give()->emails->__set('headers', apply_filters('give_receipt_headers', Give()->emails->get_headers(), $this->payment->ID, $this->payment->payment_meta));
209 209
 		}
210 210
 
211 211
 		/**
@@ -216,11 +216,11 @@  discard block
 block discarded – undo
216 216
 		 *
217 217
 		 * @param int $payment_id
218 218
 		 */
219
-		public function setup_email_notification( $payment_id ) {
220
-			$this->payment = new Give_Payment( $payment_id );
219
+		public function setup_email_notification($payment_id) {
220
+			$this->payment = new Give_Payment($payment_id);
221 221
 
222 222
 			// Exit if not donation was not with offline donation.
223
-			if ( 'offline' !== $this->payment->gateway ) {
223
+			if ('offline' !== $this->payment->gateway) {
224 224
 				return;
225 225
 			}
226 226
 
@@ -228,9 +228,9 @@  discard block
 block discarded – undo
228 228
 			$this->setup_email_data();
229 229
 
230 230
 			// Send email.
231
-			$this->send_email_notification( array(
231
+			$this->send_email_notification(array(
232 232
 				'payment_id' => $this->payment->ID,
233
-			) );
233
+			));
234 234
 		}
235 235
 
236 236
 		/**
@@ -242,18 +242,18 @@  discard block
 block discarded – undo
242 242
 		 * @param $update_options
243 243
 		 * @param $option_name
244 244
 		 */
245
-		public function set_notification_status( $update_options, $option_name ) {
245
+		public function set_notification_status($update_options, $option_name) {
246 246
 			// Get updated settings.
247 247
 			$update_options = give_get_settings();
248 248
 
249
-			$notification_status = isset( $update_options['gateways']['offline'] ) ? 'enabled' : 'disabled';
249
+			$notification_status = isset($update_options['gateways']['offline']) ? 'enabled' : 'disabled';
250 250
 
251 251
 			if (
252
-				empty( $update_options["{$this->config['id']}_notification"] )
252
+				empty($update_options["{$this->config['id']}_notification"])
253 253
 				|| $notification_status !== $update_options["{$this->config['id']}_notification"]
254 254
 			) {
255 255
 				$update_options["{$this->config['id']}_notification"] = $notification_status;
256
-				update_option( $option_name, $update_options );
256
+				update_option($option_name, $update_options);
257 257
 			}
258 258
 		}
259 259
 
@@ -269,12 +269,12 @@  discard block
 block discarded – undo
269 269
 		 *
270 270
 		 * @return array
271 271
 		 */
272
-		public function add_metabox_setting_field( $settings, $form_id ) {
273
-			if ( in_array( 'offline', array_keys( give_get_enabled_payment_gateways($form_id) ) ) ) {
272
+		public function add_metabox_setting_field($settings, $form_id) {
273
+			if (in_array('offline', array_keys(give_get_enabled_payment_gateways($form_id)))) {
274 274
 				$settings[] = array(
275 275
 					'id'     => $this->config['id'],
276 276
 					'title'  => $this->config['label'],
277
-					'fields' => $this->get_setting_fields( $form_id ),
277
+					'fields' => $this->get_setting_fields($form_id),
278 278
 				);
279 279
 			}
280 280
 
Please login to merge, or discard this patch.
includes/admin/emails/class-email-notification-table.php 1 patch
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -36,10 +36,10 @@  discard block
 block discarded – undo
36 36
 	 * @access public
37 37
 	 */
38 38
 	public function __construct() {
39
-		parent::__construct( array(
40
-			'singular' => __( 'Give Email Notification', 'give' ),
41
-			'plural'   => __( 'Give Email Notifications', 'give' ),
42
-		) );
39
+		parent::__construct(array(
40
+			'singular' => __('Give Email Notification', 'give'),
41
+			'plural'   => __('Give Email Notifications', 'give'),
42
+		));
43 43
 
44 44
 		$this->email_notifications = Give_Email_Notifications::get_instance();
45 45
 	}
@@ -59,13 +59,13 @@  discard block
 block discarded – undo
59 59
 		 *
60 60
 		 * @since 2.0
61 61
 		 */
62
-		return apply_filters( 'give_email_notification_setting_columns', array(
63
-			'cb'         => __( 'Email Status', 'give' ),
64
-			'name'       => __( 'Email', 'give' ),
65
-			'email_type' => __( 'Content Type', 'give' ),
66
-			'recipient'  => __( 'Recipient(s)', 'give' ),
67
-			'setting'    => __( 'Edit Email', 'give' ),
68
-		) );
62
+		return apply_filters('give_email_notification_setting_columns', array(
63
+			'cb'         => __('Email Status', 'give'),
64
+			'name'       => __('Email', 'give'),
65
+			'email_type' => __('Content Type', 'give'),
66
+			'recipient'  => __('Recipient(s)', 'give'),
67
+			'setting'    => __('Edit Email', 'give'),
68
+		));
69 69
 	}
70 70
 
71 71
 	/**
@@ -78,19 +78,19 @@  discard block
 block discarded – undo
78 78
 	 *
79 79
 	 * @return  string
80 80
 	 */
81
-	public function column_name( $email ) {
82
-		$edit_url = esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=emails&section=' . $email->config['id'] ) );
83
-		$actions  = $this->get_row_actions( $email );
81
+	public function column_name($email) {
82
+		$edit_url = esc_url(admin_url('edit.php?post_type=give_forms&page=give-settings&tab=emails&section='.$email->config['id']));
83
+		$actions  = $this->get_row_actions($email);
84 84
 
85 85
 		ob_start();
86 86
 		?>
87 87
 		<a class="row-title" href="<?php echo $edit_url; ?>"><?php echo $email->config['label']; ?></a>
88 88
 
89
-		<?php if ( $desc = $email->config['description'] ) : ?>
90
-			<?php echo Give()->tooltips->render_help( esc_attr( $desc ) ); ?>
89
+		<?php if ($desc = $email->config['description']) : ?>
90
+			<?php echo Give()->tooltips->render_help(esc_attr($desc)); ?>
91 91
 		<?php endif; ?>
92 92
 
93
-		<?php echo $this->row_actions( $actions ); ?>
93
+		<?php echo $this->row_actions($actions); ?>
94 94
 		<?php
95 95
 		return ob_get_clean();
96 96
 	}
@@ -105,18 +105,18 @@  discard block
 block discarded – undo
105 105
 	 *
106 106
 	 * @return string
107 107
 	 */
108
-	public function column_recipient( $email ) {
108
+	public function column_recipient($email) {
109 109
 		ob_start();
110 110
 
111
-		if( Give_Email_Notification_Util::has_recipient_field( $email ) ) {
111
+		if (Give_Email_Notification_Util::has_recipient_field($email)) {
112 112
 			$recipients = $email->get_recipient();
113
-			if ( is_array( $recipients ) ) {
114
-				$recipients = implode( '<br>', $recipients );
113
+			if (is_array($recipients)) {
114
+				$recipients = implode('<br>', $recipients);
115 115
 			}
116 116
 
117 117
 			echo $recipients;
118 118
 
119
-		} elseif ( ! empty( $email->config['recipient_group_name'] ) ) {
119
+		} elseif ( ! empty($email->config['recipient_group_name'])) {
120 120
 			echo $email->config['recipient_group_name'];
121 121
 		}
122 122
 
@@ -133,10 +133,10 @@  discard block
 block discarded – undo
133 133
 	 *
134 134
 	 * @return string
135 135
 	 */
136
-	public function column_cb( $email ) {
136
+	public function column_cb($email) {
137 137
 		$notification_status  = $email->get_notification_status();
138
-		$user_can_edit_status = (int) Give_Email_Notification_Util::is_notification_status_editable( $email );
139
-		$icon_classes         = Give_Email_Notification_Util::is_email_notification_active( $email )
138
+		$user_can_edit_status = (int) Give_Email_Notification_Util::is_notification_status_editable($email);
139
+		$icon_classes         = Give_Email_Notification_Util::is_email_notification_active($email)
140 140
 			? 'dashicons dashicons-yes'
141 141
 			: 'dashicons dashicons-no-alt';
142 142
 		$attributes           = array(
@@ -146,15 +146,15 @@  discard block
 block discarded – undo
146 146
 			'data-edit'   => $user_can_edit_status,
147 147
 		);
148 148
 
149
-		if ( ! $user_can_edit_status ) {
150
-			$icon_classes         = 'dashicons dashicons-lock';
149
+		if ( ! $user_can_edit_status) {
150
+			$icon_classes = 'dashicons dashicons-lock';
151 151
 
152
-			$attributes['data-notice'] = esc_attr( $email->config['notices']['non-notification-status-editable'] );
152
+			$attributes['data-notice'] = esc_attr($email->config['notices']['non-notification-status-editable']);
153 153
 		}
154 154
 
155 155
 		$html = sprintf(
156 156
 			'<span %1$s><i class="%2$s"></i></span></span><span class="spinner"></span>',
157
-			give_get_attribute_str( $attributes ),
157
+			give_get_attribute_str($attributes),
158 158
 			$icon_classes
159 159
 		);
160 160
 
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
 	 *
173 173
 	 * @return string
174 174
 	 */
175
-	public function column_email_type( Give_Email_Notification $email ) {
176
-		return Give_Email_Notification_Util::get_formatted_email_type( $email->config['content_type'] );
175
+	public function column_email_type(Give_Email_Notification $email) {
176
+		return Give_Email_Notification_Util::get_formatted_email_type($email->config['content_type']);
177 177
 	}
178 178
 
179 179
 	/**
@@ -186,15 +186,15 @@  discard block
 block discarded – undo
186 186
 	 *
187 187
 	 * @return string
188 188
 	 */
189
-	public function column_setting( Give_Email_Notification $email ) {
190
-		return Give()->tooltips->render_link( array(
191
-			'label'       => __( 'Edit', 'give' ) . " {$email->config['label']}",
189
+	public function column_setting(Give_Email_Notification $email) {
190
+		return Give()->tooltips->render_link(array(
191
+			'label'       => __('Edit', 'give')." {$email->config['label']}",
192 192
 			'tag_content' => '<span class="dashicons dashicons-admin-generic"></span>',
193
-			'link'        => esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=emails&section=' . $email->config['id'] ) ),
193
+			'link'        => esc_url(admin_url('edit.php?post_type=give_forms&page=give-settings&tab=emails&section='.$email->config['id'])),
194 194
 			'attributes'  => array(
195 195
 				'class' => 'button button-small',
196 196
 			),
197
-		) );
197
+		));
198 198
 	}
199 199
 
200 200
 
@@ -208,8 +208,8 @@  discard block
 block discarded – undo
208 208
 	 *
209 209
 	 * @return array
210 210
 	 */
211
-	private function get_row_actions( $email ) {
212
-		$edit_url = esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=emails&section=' . $email->config['id'] ) );
211
+	private function get_row_actions($email) {
212
+		$edit_url = esc_url(admin_url('edit.php?post_type=give_forms&page=give-settings&tab=emails&section='.$email->config['id']));
213 213
 
214 214
 		/**
215 215
 		 * Filter the row actions
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 		$row_actions = apply_filters(
222 222
 			'give_email_notification_row_actions',
223 223
 			array(
224
-				'edit' => "<a href=\"{$edit_url}\">" . __( 'Edit', 'give' ) . '</a>',
224
+				'edit' => "<a href=\"{$edit_url}\">".__('Edit', 'give').'</a>',
225 225
 			),
226 226
 			$email
227 227
 		);
@@ -242,22 +242,22 @@  discard block
 block discarded – undo
242 242
 		$hidden                = array();
243 243
 		$email_notifications   = array();
244 244
 		$sortable              = $this->get_sortable_columns();
245
-		$this->_column_headers = array( $columns, $hidden, $sortable, $this->get_primary_column_name() );
245
+		$this->_column_headers = array($columns, $hidden, $sortable, $this->get_primary_column_name());
246 246
 
247 247
 		// Set email notifications.
248 248
 		/* @var Give_Email_Notification $email_notification */
249
-		foreach ( $this->email_notifications->get_email_notifications() as $email_notification ) {
250
-			if ( Give_Email_Notification_Util::is_show_on_emails_setting_page( $email_notification ) ) {
249
+		foreach ($this->email_notifications->get_email_notifications() as $email_notification) {
250
+			if (Give_Email_Notification_Util::is_show_on_emails_setting_page($email_notification)) {
251 251
 				$email_notifications[] = $email_notification;
252 252
 			}
253 253
 		}
254 254
 
255
-		$totalItems  = count( $email_notifications );
255
+		$totalItems  = count($email_notifications);
256 256
 		$this->items = $email_notifications;
257
-		$this->set_pagination_args( array(
257
+		$this->set_pagination_args(array(
258 258
 			'total_items' => $totalItems,
259 259
 			'per_page'    => $this->per_page,
260
-		) );
260
+		));
261 261
 	}
262 262
 
263 263
 	/**
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 	 * @access public
268 268
 	 */
269 269
 	public function no_items() {
270
-		_e( 'No give email notification found.' );
270
+		_e('No give email notification found.');
271 271
 	}
272 272
 
273 273
 	/**
Please login to merge, or discard this patch.
includes/admin/emails/class-new-donation-email.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@  discard block
 block discarded – undo
13 13
  */
14 14
 
15 15
 // Exit if access directly.
16
-if ( ! defined( 'ABSPATH' ) ) {
16
+if ( ! defined('ABSPATH')) {
17 17
 	exit;
18 18
 }
19 19
 
20
-if ( ! class_exists( 'Give_New_Donation_Email' ) ) :
20
+if ( ! class_exists('Give_New_Donation_Email')) :
21 21
 
22 22
 	/**
23 23
 	 * Give_New_Donation_Email
@@ -37,21 +37,21 @@  discard block
 block discarded – undo
37 37
 		 */
38 38
 		public function init() {
39 39
 			// Initialize empty payment.
40
-			$this->payment = new Give_Payment( 0 );
40
+			$this->payment = new Give_Payment(0);
41 41
 
42
-			$this->load( array(
42
+			$this->load(array(
43 43
 				'id'                    => 'new-donation',
44
-				'label'                 => __( 'New Donation', 'give' ),
45
-				'description'           => __( 'Sent to designated recipient(s) when a new donation is received or a pending donation is marked as complete.', 'give' ),
44
+				'label'                 => __('New Donation', 'give'),
45
+				'description'           => __('Sent to designated recipient(s) when a new donation is received or a pending donation is marked as complete.', 'give'),
46 46
 				'has_recipient_field'   => true,
47 47
 				'notification_status'   => 'enabled',
48 48
 				'form_metabox_setting'  => true,
49
-				'default_email_subject' => esc_attr__( 'New Donation - #{payment_id}', 'give' ),
49
+				'default_email_subject' => esc_attr__('New Donation - #{payment_id}', 'give'),
50 50
 				'default_email_message' => give_get_default_donation_notification_email(),
51 51
 
52
-			) );
52
+			));
53 53
 
54
-			add_action( "give_{$this->config['id']}_email_notification", array( $this, 'setup_email_notification' ) );
54
+			add_action("give_{$this->config['id']}_email_notification", array($this, 'setup_email_notification'));
55 55
 		}
56 56
 
57 57
 
@@ -65,11 +65,11 @@  discard block
 block discarded – undo
65 65
 		 *
66 66
 		 * @return string
67 67
 		 */
68
-		public function get_email_subject( $form_id = null ) {
68
+		public function get_email_subject($form_id = null) {
69 69
 			$subject = wp_strip_all_tags(
70 70
 				Give_Email_Notification_Util::get_value(
71 71
 					$this,
72
-					Give_Email_Setting_Field::get_prefix( $this, $form_id ) . 'email_subject',
72
+					Give_Email_Setting_Field::get_prefix($this, $form_id).'email_subject',
73 73
 					$form_id,
74 74
 					$this->config['default_email_subject']
75 75
 				)
@@ -81,14 +81,14 @@  discard block
 block discarded – undo
81 81
 			 *
82 82
 			 * @since 1.0
83 83
 			 */
84
-			$subject = apply_filters( 'give_admin_donation_notification_subject', $subject, $this->payment->ID );
84
+			$subject = apply_filters('give_admin_donation_notification_subject', $subject, $this->payment->ID);
85 85
 
86 86
 			/**
87 87
 			 * Filters the donation notification subject.
88 88
 			 *
89 89
 			 * @since 2.0
90 90
 			 */
91
-			$subject = apply_filters( "give_{$this->config['id']}_get_email_subject", $subject, $this, $form_id );
91
+			$subject = apply_filters("give_{$this->config['id']}_get_email_subject", $subject, $this, $form_id);
92 92
 
93 93
 			return $subject;
94 94
 		}
@@ -104,10 +104,10 @@  discard block
 block discarded – undo
104 104
 		 *
105 105
 		 * @return string
106 106
 		 */
107
-		public function get_email_message( $form_id = null ) {
107
+		public function get_email_message($form_id = null) {
108 108
 			$message = Give_Email_Notification_Util::get_value(
109 109
 				$this,
110
-				Give_Email_Setting_Field::get_prefix( $this, $form_id ) . 'email_message',
110
+				Give_Email_Setting_Field::get_prefix($this, $form_id).'email_message',
111 111
 				$form_id,
112 112
 				$this->config['default_email_message']
113 113
 			);
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 		 * @param int $form_id
151 151
 		 * @return array
152 152
 		 */
153
-		public function get_email_attachments( $form_id = null ) {
153
+		public function get_email_attachments($form_id = null) {
154 154
 			/**
155 155
 			 * Filters the donation notification email attachments.
156 156
 			 * By default, there is no attachment but plugins can hook in to provide one more multiple.
@@ -213,9 +213,9 @@  discard block
 block discarded – undo
213 213
 				$this->payment->payment_meta
214 214
 			);
215 215
 
216
-			Give()->emails->__set( 'from_name', $from_name );
217
-			Give()->emails->__set( 'from_email', $from_email );
218
-			Give()->emails->__set( 'heading', esc_html__( 'New Donation!', 'give' ) );
216
+			Give()->emails->__set('from_name', $from_name);
217
+			Give()->emails->__set('from_email', $from_email);
218
+			Give()->emails->__set('heading', esc_html__('New Donation!', 'give'));
219 219
 			/**
220 220
 			 * Filters the donation notification email headers.
221 221
 			 *
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 				$this->payment->payment_meta
229 229
 			);
230 230
 
231
-			Give()->emails->__set( 'headers', $headers );
231
+			Give()->emails->__set('headers', $headers);
232 232
 		}
233 233
 
234 234
 		/**
@@ -239,16 +239,16 @@  discard block
 block discarded – undo
239 239
 		 *
240 240
 		 * @param int $payment_id
241 241
 		 */
242
-		public function setup_email_notification( $payment_id ) {
243
-			$this->payment = new Give_Payment( $payment_id );
242
+		public function setup_email_notification($payment_id) {
243
+			$this->payment = new Give_Payment($payment_id);
244 244
 
245 245
 			// Set email data.
246 246
 			$this->setup_email_data();
247 247
 
248 248
 			// Send email.
249
-			$this->send_email_notification( array(
249
+			$this->send_email_notification(array(
250 250
 				'payment_id' => $payment_id,
251
-			) );
251
+			));
252 252
 		}
253 253
 	}
254 254
 
Please login to merge, or discard this patch.
includes/admin/emails/ajax-handler.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,12 +16,12 @@
 block discarded – undo
16 16
  * @since 2.0
17 17
  */
18 18
 function give_set_notification_status_handler() {
19
-	$notification_id = isset( $_POST['notification_id'] ) ? give_clean( $_POST['notification_id'] ) : '';
20
-	if ( ! empty( $notification_id ) && give_update_option( "{$notification_id}_notification", give_clean( $_POST['status'] ) ) ) {
19
+	$notification_id = isset($_POST['notification_id']) ? give_clean($_POST['notification_id']) : '';
20
+	if ( ! empty($notification_id) && give_update_option("{$notification_id}_notification", give_clean($_POST['status']))) {
21 21
 		wp_send_json_success();
22 22
 	}
23 23
 
24 24
 	wp_send_json_error();
25 25
 }
26 26
 
27
-add_action( 'wp_ajax_give_set_notification_status', 'give_set_notification_status_handler' );
27
+add_action('wp_ajax_give_set_notification_status', 'give_set_notification_status_handler');
Please login to merge, or discard this patch.
includes/admin/emails/class-donation-receipt-email.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 // Exit if access directly.
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit;
16 16
 }
17 17
 
18
-if ( ! class_exists( 'Give_Donation_Receipt_Email' ) ) :
18
+if ( ! class_exists('Give_Donation_Receipt_Email')) :
19 19
 
20 20
 	/**
21 21
 	 * Give_Donation_Receipt_Email
@@ -35,21 +35,21 @@  discard block
 block discarded – undo
35 35
 		 */
36 36
 		public function init() {
37 37
 			// Initialize empty payment.
38
-			$this->payment = new Give_Payment( 0 );
38
+			$this->payment = new Give_Payment(0);
39 39
 
40
-			$this->load( array(
40
+			$this->load(array(
41 41
 				'id'                   => 'donation-receipt',
42
-				'label'                => __( 'Donation Receipt', 'give' ),
43
-				'description'          => __( 'Sent to the donor when their donation completes or a pending donation is marked as complete.', 'give' ),
42
+				'label'                => __('Donation Receipt', 'give'),
43
+				'description'          => __('Sent to the donor when their donation completes or a pending donation is marked as complete.', 'give'),
44 44
 				'notification_status'  => 'enabled',
45 45
 				'form_metabox_setting' => true,
46
-				'recipient_group_name' => __( 'Donor', 'give' ),
47
-				'default_email_subject' => esc_attr__( 'Donation Receipt', 'give' ),
46
+				'recipient_group_name' => __('Donor', 'give'),
47
+				'default_email_subject' => esc_attr__('Donation Receipt', 'give'),
48 48
 				'default_email_message' => give_get_default_donation_receipt_email()
49
-			) );
49
+			));
50 50
 
51
-			add_action( "give_{$this->config['id']}_email_notification", array( $this, 'send_donation_receipt' ) );
52
-			add_action( 'give_email_links', array( $this, 'resend_donation_receipt' ) );
51
+			add_action("give_{$this->config['id']}_email_notification", array($this, 'send_donation_receipt'));
52
+			add_action('give_email_links', array($this, 'resend_donation_receipt'));
53 53
 		}
54 54
 
55 55
 
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 		 * @param int $form_id
63 63
 		 * @return string
64 64
 		 */
65
-		public function get_email_subject( $form_id = null ) {
65
+		public function get_email_subject($form_id = null) {
66 66
 			$subject = wp_strip_all_tags(
67 67
 				Give_Email_Notification_Util::get_value(
68 68
 					$this,
69
-					Give_Email_Setting_Field::get_prefix( $this, $form_id ) . 'email_subject',
69
+					Give_Email_Setting_Field::get_prefix($this, $form_id).'email_subject',
70 70
 					$form_id,
71 71
 					$this->config['default_email_subject']
72 72
 				)
@@ -109,10 +109,10 @@  discard block
 block discarded – undo
109 109
 		 * @param int $form_id
110 110
 		 * @return string
111 111
 		 */
112
-		public function get_email_message( $form_id = null ) {
112
+		public function get_email_message($form_id = null) {
113 113
 			$message = Give_Email_Notification_Util::get_value(
114 114
 				$this,
115
-				Give_Email_Setting_Field::get_prefix( $this, $form_id ) . 'email_message',
115
+				Give_Email_Setting_Field::get_prefix($this, $form_id).'email_message',
116 116
 				$form_id,
117 117
 				$this->config['default_email_message']
118 118
 			);
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 			 * @since 1.0
125 125
 			 */
126 126
 			$message = apply_filters(
127
-				'give_donation_receipt_' . Give()->emails->get_template(),
127
+				'give_donation_receipt_'.Give()->emails->get_template(),
128 128
 				$message,
129 129
 				$this->payment->ID,
130 130
 				$this->payment->payment_meta
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 		 * @param int $form_id
168 168
 		 * @return array
169 169
 		 */
170
-		public function get_email_attachments( $form_id = null) {
170
+		public function get_email_attachments($form_id = null) {
171 171
 			/**
172 172
 			 * Filter the attachments.
173 173
 			 * Note: this filter will deprecate soon.
@@ -236,9 +236,9 @@  discard block
 block discarded – undo
236 236
 				$this->payment->payment_meta
237 237
 			);
238 238
 
239
-			Give()->emails->__set( 'from_name', $from_name );
240
-			Give()->emails->__set( 'from_email', $from_email );
241
-			Give()->emails->__set( 'heading', esc_html__( 'Donation Receipt', 'give' ) );
239
+			Give()->emails->__set('from_name', $from_name);
240
+			Give()->emails->__set('from_email', $from_email);
241
+			Give()->emails->__set('heading', esc_html__('Donation Receipt', 'give'));
242 242
 
243 243
 			/**
244 244
 			 * Filters the donation receipt's email headers.
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 				$this->payment->payment_meta
256 256
 			);
257 257
 
258
-			Give()->emails->__set( 'headers', $headers );
258
+			Give()->emails->__set('headers', $headers);
259 259
 		}
260 260
 
261 261
 		/**
@@ -266,16 +266,16 @@  discard block
 block discarded – undo
266 266
 		 *
267 267
 		 * @param $payment_id
268 268
 		 */
269
-		public function send_donation_receipt( $payment_id ) {
270
-			$this->payment = new Give_Payment( $payment_id );
269
+		public function send_donation_receipt($payment_id) {
270
+			$this->payment = new Give_Payment($payment_id);
271 271
 
272 272
 			// Setup email data.
273 273
 			$this->setup_email_data();
274 274
 
275 275
 			// Send email.
276
-			$this->send_email_notification( array(
276
+			$this->send_email_notification(array(
277 277
 				'payment_id' => $this->payment->ID,
278
-			) );
278
+			));
279 279
 		}
280 280
 
281 281
 		/**
@@ -286,35 +286,35 @@  discard block
 block discarded – undo
286 286
 		 *
287 287
 		 * @param array $data
288 288
 		 */
289
-		public function resend_donation_receipt( $data ) {
290
-			$purchase_id = absint( $data['purchase_id'] );
289
+		public function resend_donation_receipt($data) {
290
+			$purchase_id = absint($data['purchase_id']);
291 291
 
292
-			if ( empty( $purchase_id ) ) {
292
+			if (empty($purchase_id)) {
293 293
 				return;
294 294
 			}
295 295
 
296 296
 			// Get donation payment information.
297
-			$this->payment = new Give_Payment( $purchase_id );
297
+			$this->payment = new Give_Payment($purchase_id);
298 298
 
299
-			if ( ! current_user_can( 'edit_give_payments', $this->payment->ID ) ) {
300
-				wp_die( esc_html__( 'You do not have permission to edit donations.', 'give' ), esc_html__( 'Error', 'give' ), array(
299
+			if ( ! current_user_can('edit_give_payments', $this->payment->ID)) {
300
+				wp_die(esc_html__('You do not have permission to edit donations.', 'give'), esc_html__('Error', 'give'), array(
301 301
 					'response' => 403,
302
-				) );
302
+				));
303 303
 			}
304 304
 
305 305
 			// Setup email data.
306 306
 			$this->setup_email_data();
307 307
 
308 308
 			// Send email.
309
-			$this->send_email_notification( array(
309
+			$this->send_email_notification(array(
310 310
 				'payment_id' => $this->payment->ID,
311
-			) );
311
+			));
312 312
 
313
-			wp_redirect( add_query_arg( array(
313
+			wp_redirect(add_query_arg(array(
314 314
 				'give-message' => 'email_sent',
315 315
 				'give-action'  => false,
316 316
 				'purchase_id'  => false,
317
-			) ) );
317
+			)));
318 318
 			exit;
319 319
 		}
320 320
 	}
Please login to merge, or discard this patch.
includes/admin/emails/backward-compatibility.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -11,15 +11,15 @@  discard block
 block discarded – undo
11 11
  *
12 12
  * @return string
13 13
  */
14
-function _give_bc_offline_donation_instruction_notification_status( $notification_status, $email, $form_id ) {
14
+function _give_bc_offline_donation_instruction_notification_status($notification_status, $email, $form_id) {
15 15
 	// Bailout.
16
-	if ( ! $form_id ) {
16
+	if ( ! $form_id) {
17 17
 		return $notification_status;
18 18
 	}
19 19
 
20
-	if ( ! get_post_meta( $form_id, '_give_offline-donation-instruction_notification', true ) ) {
21
-		$old_value           = get_post_meta( $form_id, '_give_customize_offline_donations', true );
22
-		$notification_status = give_is_setting_enabled( $old_value, array( 'enabled', 'global' ) )
20
+	if ( ! get_post_meta($form_id, '_give_offline-donation-instruction_notification', true)) {
21
+		$old_value           = get_post_meta($form_id, '_give_customize_offline_donations', true);
22
+		$notification_status = give_is_setting_enabled($old_value, array('enabled', 'global'))
23 23
 			? $old_value
24 24
 			: 'global';
25 25
 	}
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	return $notification_status;
29 29
 }
30 30
 
31
-add_filter( 'give__give_offline-donation-instruction_get_notification_status', '_give_bc_offline_donation_instruction_notification_status', 10, 3 );
31
+add_filter('give__give_offline-donation-instruction_get_notification_status', '_give_bc_offline_donation_instruction_notification_status', 10, 3);
32 32
 
33 33
 
34 34
 /**
@@ -43,22 +43,22 @@  discard block
 block discarded – undo
43 43
  *
44 44
  * @return mixed
45 45
  */
46
-function _give_bc_offline_donation_instruction_email_setting_values( $option_value, $option_name, $email, $form_id ) {
46
+function _give_bc_offline_donation_instruction_email_setting_values($option_value, $option_name, $email, $form_id) {
47 47
 	// Bailout.
48
-	if ( empty( $form_id ) || 'offline-donation-instruction' !== $email->config['id'] ) {
48
+	if (empty($form_id) || 'offline-donation-instruction' !== $email->config['id']) {
49 49
 		return $option_value;
50 50
 	}
51 51
 
52
-	switch ( $option_name ) {
52
+	switch ($option_name) {
53 53
 		case '_give_offline-donation-instruction_email_message':
54
-			if ( ! get_post_meta( $form_id, $option_name, true ) && give_is_setting_enabled( $email->get_notification_status( $form_id ) ) ) {
55
-				$option_value = get_post_meta( $form_id, '_give_offline_donation_email', true );
54
+			if ( ! get_post_meta($form_id, $option_name, true) && give_is_setting_enabled($email->get_notification_status($form_id))) {
55
+				$option_value = get_post_meta($form_id, '_give_offline_donation_email', true);
56 56
 			}
57 57
 			break;
58 58
 
59 59
 		case '_give_offline-donation-instruction_email_subject':
60
-			if ( ! get_post_meta( $form_id, $option_name, true ) && give_is_setting_enabled( $email->get_notification_status( $form_id ) ) ) {
61
-				$option_value = get_post_meta( $form_id, '_give_offline_donation_subject', true );
60
+			if ( ! get_post_meta($form_id, $option_name, true) && give_is_setting_enabled($email->get_notification_status($form_id))) {
61
+				$option_value = get_post_meta($form_id, '_give_offline_donation_subject', true);
62 62
 			}
63 63
 			break;
64 64
 	}
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	return $option_value;
67 67
 }
68 68
 
69
-add_filter( 'give_email_setting_value', '_give_bc_offline_donation_instruction_email_setting_values', 10, 4 );
69
+add_filter('give_email_setting_value', '_give_bc_offline_donation_instruction_email_setting_values', 10, 4);
70 70
 
71 71
 
72 72
 /**
@@ -80,10 +80,10 @@  discard block
 block discarded – undo
80 80
  *
81 81
  * @return string
82 82
  */
83
-function _give_bc_offline_instruction_status_setting_value( $field_value, $field, $form_id ) {
84
-	if ( ! get_post_meta( $form_id, $field['id'], true ) ) {
85
-		$old_value   = get_post_meta( $form_id, '_give_customize_offline_donations', true );
86
-		$field_value = give_is_setting_enabled( $old_value, array( 'enabled', 'global' ) )
83
+function _give_bc_offline_instruction_status_setting_value($field_value, $field, $form_id) {
84
+	if ( ! get_post_meta($form_id, $field['id'], true)) {
85
+		$old_value   = get_post_meta($form_id, '_give_customize_offline_donations', true);
86
+		$field_value = give_is_setting_enabled($old_value, array('enabled', 'global'))
87 87
 			? $old_value
88 88
 			: 'global';
89 89
 	}
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	return $field_value;
92 92
 }
93 93
 
94
-add_filter( '_give_offline-donation-instruction_notification_field_value', '_give_bc_offline_instruction_status_setting_value', 10, 3 );
94
+add_filter('_give_offline-donation-instruction_notification_field_value', '_give_bc_offline_instruction_status_setting_value', 10, 3);
95 95
 
96 96
 
97 97
 /**
@@ -105,15 +105,15 @@  discard block
 block discarded – undo
105 105
  *
106 106
  * @return string
107 107
  */
108
-function _offline_donation_instruction_email_subject_setting_value( $field_value, $field, $form_id ) {
109
-	if ( ! get_post_meta( $form_id, $field['id'], true ) ) {
110
-		$field_value = get_post_meta( $form_id, '_give_offline_donation_subject', true );
108
+function _offline_donation_instruction_email_subject_setting_value($field_value, $field, $form_id) {
109
+	if ( ! get_post_meta($form_id, $field['id'], true)) {
110
+		$field_value = get_post_meta($form_id, '_give_offline_donation_subject', true);
111 111
 	}
112 112
 
113 113
 	return $field_value;
114 114
 }
115 115
 
116
-add_filter( '_give_offline-donation-instruction_email_subject_field_value', '_offline_donation_instruction_email_subject_setting_value', 10, 3 );
116
+add_filter('_give_offline-donation-instruction_email_subject_field_value', '_offline_donation_instruction_email_subject_setting_value', 10, 3);
117 117
 
118 118
 
119 119
 /**
@@ -127,12 +127,12 @@  discard block
 block discarded – undo
127 127
  *
128 128
  * @return string
129 129
  */
130
-function _give_bc_offline_donation_instruction_email_message_setting_value( $field_value, $field, $form_id ) {
131
-	if ( ! get_post_meta( $form_id, $field['id'], true ) ) {
132
-		$field_value = get_post_meta( $form_id, '_give_offline_donation_email', true );
130
+function _give_bc_offline_donation_instruction_email_message_setting_value($field_value, $field, $form_id) {
131
+	if ( ! get_post_meta($form_id, $field['id'], true)) {
132
+		$field_value = get_post_meta($form_id, '_give_offline_donation_email', true);
133 133
 	}
134 134
 
135 135
 	return $field_value;
136 136
 }
137 137
 
138
-add_filter( '_give_offline-donation-instruction_email_message_field_value', '_give_bc_offline_donation_instruction_email_message_setting_value', 10, 3 );
139 138
\ No newline at end of file
139
+add_filter('_give_offline-donation-instruction_email_message_field_value', '_give_bc_offline_donation_instruction_email_message_setting_value', 10, 3);
140 140
\ No newline at end of file
Please login to merge, or discard this patch.