Test Failed
Push — issue/3417 ( 9726e4 )
by Ravinder
1141:09 queued 1139:41
created
includes/admin/shortcodes/abstract-shortcode-generator.php 1 patch
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 // Exit if accessed directly.
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit;
16 16
 }
17 17
 
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 	 *
63 63
 	 * @since 1.0
64 64
 	 */
65
-	public function __construct( $shortcode ) {
65
+	public function __construct($shortcode) {
66 66
 
67 67
 		$this->shortcode_tag = $shortcode;
68 68
 
69
-		add_action( 'admin_init', array( $this, 'init' ) );
69
+		add_action('admin_init', array($this, 'init'));
70 70
 
71 71
 	}
72 72
 
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
 	 */
78 78
 	public function init() {
79 79
 
80
-		if ( $this->shortcode_tag ) {
80
+		if ($this->shortcode_tag) {
81 81
 
82
-			$this->self = get_class( $this );
82
+			$this->self = get_class($this);
83 83
 
84 84
 			$this->errors   = array();
85 85
 			$this->required = array();
@@ -88,18 +88,18 @@  discard block
 block discarded – undo
88 88
 			$fields = $this->get_fields();
89 89
 
90 90
 			$defaults = array(
91
-				'btn_close' => esc_html__( 'Close', 'give' ),
92
-				'btn_okay'  => esc_html__( 'Insert Shortcode', 'give' ),
91
+				'btn_close' => esc_html__('Close', 'give'),
92
+				'btn_okay'  => esc_html__('Insert Shortcode', 'give'),
93 93
 				'errors'    => $this->errors,
94 94
 				'fields'    => $fields,
95
-				'label'     => '[' . $this->shortcode_tag . ']',
95
+				'label'     => '['.$this->shortcode_tag.']',
96 96
 				'required'  => $this->required,
97
-				'title'     => esc_html__( 'Insert Shortcode', 'give' ),
97
+				'title'     => esc_html__('Insert Shortcode', 'give'),
98 98
 			);
99 99
 
100
-			if ( user_can_richedit() ) {
100
+			if (user_can_richedit()) {
101 101
 
102
-				Give_Shortcode_Button::$shortcodes[ $this->shortcode_tag ] = wp_parse_args( $this->shortcode, $defaults );
102
+				Give_Shortcode_Button::$shortcodes[$this->shortcode_tag] = wp_parse_args($this->shortcode, $defaults);
103 103
 
104 104
 			}
105 105
 		}
@@ -128,13 +128,13 @@  discard block
 block discarded – undo
128 128
 	 *
129 129
 	 * @since 1.0
130 130
 	 */
131
-	protected function generate_fields( $defined_fields ) {
131
+	protected function generate_fields($defined_fields) {
132 132
 
133 133
 		$fields = array();
134 134
 
135
-		if ( is_array( $defined_fields ) ) {
135
+		if (is_array($defined_fields)) {
136 136
 
137
-			foreach ( $defined_fields as $field ) {
137
+			foreach ($defined_fields as $field) {
138 138
 
139 139
 				$defaults = array(
140 140
 					'label'       => false,
@@ -145,14 +145,14 @@  discard block
 block discarded – undo
145 145
 					'type'        => '',
146 146
 				);
147 147
 
148
-				$field  = wp_parse_args( (array) $field, $defaults );
149
-				$method = 'generate_' . strtolower( $field['type'] );
148
+				$field  = wp_parse_args((array) $field, $defaults);
149
+				$method = 'generate_'.strtolower($field['type']);
150 150
 
151
-				if ( method_exists( $this, $method ) ) {
151
+				if (method_exists($this, $method)) {
152 152
 
153
-					$field = call_user_func( array( $this, $method ), $field );
153
+					$field = call_user_func(array($this, $method), $field);
154 154
 
155
-					if ( $field ) {
155
+					if ($field) {
156 156
 						$fields[] = $field;
157 157
 					}
158 158
 				}
@@ -172,23 +172,23 @@  discard block
 block discarded – undo
172 172
 	protected function get_fields() {
173 173
 
174 174
 		$defined_fields   = $this->define_fields();
175
-		$generated_fields = $this->generate_fields( $defined_fields );
175
+		$generated_fields = $this->generate_fields($defined_fields);
176 176
 
177 177
 		$errors = array();
178 178
 
179
-		if ( ! empty( $this->errors ) ) {
180
-			foreach ( $this->required as $name => $alert ) {
179
+		if ( ! empty($this->errors)) {
180
+			foreach ($this->required as $name => $alert) {
181 181
 				// Using WordPress function in place of array_column wp_list_pluck as it support older version as well.
182
-				if ( false === array_search( $name, give_list_pluck( $generated_fields, 'name' ) ) ) {
182
+				if (false === array_search($name, give_list_pluck($generated_fields, 'name'))) {
183 183
 
184
-					$errors[] = $this->errors[ $name ];
184
+					$errors[] = $this->errors[$name];
185 185
 				}
186 186
 			}
187 187
 
188 188
 			$this->errors = $errors;
189 189
 		}
190 190
 
191
-		if ( ! empty( $errors ) ) {
191
+		if ( ! empty($errors)) {
192 192
 
193 193
 			return $errors;
194 194
 		}
@@ -205,9 +205,9 @@  discard block
 block discarded – undo
205 205
 	 *
206 206
 	 * @since 1.0
207 207
 	 */
208
-	protected function generate_container( $field ) {
208
+	protected function generate_container($field) {
209 209
 
210
-		if ( array_key_exists( 'html', $field ) ) {
210
+		if (array_key_exists('html', $field)) {
211 211
 
212 212
 			return array(
213 213
 				'type' => $field['type'],
@@ -227,9 +227,9 @@  discard block
 block discarded – undo
227 227
 	 *
228 228
 	 * @since 1.0
229 229
 	 */
230
-	protected function generate_listbox( $field ) {
230
+	protected function generate_listbox($field) {
231 231
 
232
-		$listbox = shortcode_atts( array(
232
+		$listbox = shortcode_atts(array(
233 233
 			'label'    => '',
234 234
 			'minWidth' => '',
235 235
 			'name'     => false,
@@ -237,27 +237,27 @@  discard block
 block discarded – undo
237 237
 			'type'     => '',
238 238
 			'value'    => '',
239 239
 			'classes'  => ''
240
-		), $field );
240
+		), $field);
241 241
 
242
-		if ( $this->validate( $field ) ) {
242
+		if ($this->validate($field)) {
243 243
 
244 244
 			$new_listbox = array();
245 245
 
246
-			foreach ( $listbox as $key => $value ) {
246
+			foreach ($listbox as $key => $value) {
247 247
 
248
-				if ( $key == 'value' && empty( $value ) ) {
249
-					$new_listbox[ $key ] = $listbox['name'];
250
-				} else if ( $value ) {
251
-					$new_listbox[ $key ] = $value;
248
+				if ($key == 'value' && empty($value)) {
249
+					$new_listbox[$key] = $listbox['name'];
250
+				} else if ($value) {
251
+					$new_listbox[$key] = $value;
252 252
 				}
253 253
 			}
254 254
 
255 255
 			// do not reindex array!
256 256
 			$field['options'] = array(
257
-				                    '' => ( $field['placeholder'] ? $field['placeholder'] : esc_attr__( '- Select -', 'give' ) ),
257
+				                    '' => ($field['placeholder'] ? $field['placeholder'] : esc_attr__('- Select -', 'give')),
258 258
 			                    ) + $field['options'];
259 259
 
260
-			foreach ( $field['options'] as $value => $text ) {
260
+			foreach ($field['options'] as $value => $text) {
261 261
 				$new_listbox['values'][] = array(
262 262
 					'text'  => $text,
263 263
 					'value' => $value,
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 	 *
280 280
 	 * @since 1.0
281 281
 	 */
282
-	protected function generate_post( $field ) {
282
+	protected function generate_post($field) {
283 283
 
284 284
 		$args = array(
285 285
 			'post_type'        => 'post',
@@ -289,26 +289,26 @@  discard block
 block discarded – undo
289 289
 			'suppress_filters' => false,
290 290
 		);
291 291
 
292
-		$args    = wp_parse_args( (array) $field['query_args'], $args );
292
+		$args    = wp_parse_args((array) $field['query_args'], $args);
293 293
 
294
-		$posts   = get_posts( $args );
294
+		$posts   = get_posts($args);
295 295
 		$options = array();
296 296
 
297
-		if ( ! empty( $posts ) ) {
298
-			foreach ( $posts as $post ) {
299
-				$options[ absint( $post->ID ) ] = empty( $post->post_title )
300
-					? sprintf( __( 'Untitled (#%s)', 'give' ), $post->ID )
301
-					: apply_filters( 'the_title', $post->post_title );
297
+		if ( ! empty($posts)) {
298
+			foreach ($posts as $post) {
299
+				$options[absint($post->ID)] = empty($post->post_title)
300
+					? sprintf(__('Untitled (#%s)', 'give'), $post->ID)
301
+					: apply_filters('the_title', $post->post_title);
302 302
 			}
303 303
 
304 304
 			$field['type']    = 'listbox';
305 305
 			$field['options'] = $options;
306 306
 
307
-			return $this->generate_listbox( $field );
307
+			return $this->generate_listbox($field);
308 308
 		}
309 309
 
310 310
 		// perform validation here before returning false
311
-		$this->validate( $field );
311
+		$this->validate($field);
312 312
 
313 313
 		return false;
314 314
 	}
@@ -322,9 +322,9 @@  discard block
 block discarded – undo
322 322
 	 *
323 323
 	 * @since 1.0
324 324
 	 */
325
-	protected function generate_textbox( $field ) {
325
+	protected function generate_textbox($field) {
326 326
 
327
-		$textbox = shortcode_atts( array(
327
+		$textbox = shortcode_atts(array(
328 328
 			'label'       => '',
329 329
 			'maxLength'   => '',
330 330
 			'minHeight'   => '',
@@ -336,15 +336,15 @@  discard block
 block discarded – undo
336 336
 			'value'       => '',
337 337
 			'classes'     => '',
338 338
 			'placeholder' => ''
339
-		), $field );
339
+		), $field);
340 340
 
341 341
 		// Remove empty placeholder.
342
-		if( empty( $textbox['placeholder'] ) ) {
343
-			unset( $textbox['placeholder'] );
342
+		if (empty($textbox['placeholder'])) {
343
+			unset($textbox['placeholder']);
344 344
 		}
345 345
 
346
-		if ( $this->validate( $field ) ) {
347
-			return array_filter( $textbox, array( $this, 'return_textbox_value' ) );
346
+		if ($this->validate($field)) {
347
+			return array_filter($textbox, array($this, 'return_textbox_value'));
348 348
 		}
349 349
 
350 350
 		return false;
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
 	 *
358 358
 	 * @return bool
359 359
 	 */
360
-	function return_textbox_value( $value ) {
360
+	function return_textbox_value($value) {
361 361
 		return $value !== '';
362 362
 	}
363 363
 
@@ -373,9 +373,9 @@  discard block
 block discarded – undo
373 373
 	 *
374 374
 	 * @since 1.0
375 375
 	 */
376
-	protected function validate( $field ) {
376
+	protected function validate($field) {
377 377
 
378
-		extract( shortcode_atts(
378
+		extract(shortcode_atts(
379 379
 				array(
380 380
 					'name'     => false,
381 381
 					'required' => false,
@@ -383,36 +383,36 @@  discard block
 block discarded – undo
383 383
 				), $field )
384 384
 		);
385 385
 
386
-		if ( $name ) {
386
+		if ($name) {
387 387
 
388
-			if ( isset( $required['error'] ) ) {
388
+			if (isset($required['error'])) {
389 389
 
390 390
 				$error = array(
391 391
 					'type' => 'container',
392 392
 					'html' => $required['error'],
393 393
 				);
394 394
 
395
-				$this->errors[ $name ] = $this->generate_container( $error );
395
+				$this->errors[$name] = $this->generate_container($error);
396 396
 			}
397 397
 
398
-			if ( ! ! $required || is_array( $required ) ) {
398
+			if ( ! ! $required || is_array($required)) {
399 399
 
400
-				$alert = esc_html__( 'Some of the shortcode options are required.', 'give' );
400
+				$alert = esc_html__('Some of the shortcode options are required.', 'give');
401 401
 
402
-				if ( isset( $required['alert'] ) ) {
402
+				if (isset($required['alert'])) {
403 403
 
404 404
 					$alert = $required['alert'];
405 405
 
406
-				} else if ( ! empty( $label ) ) {
406
+				} else if ( ! empty($label)) {
407 407
 
408 408
 					$alert = sprintf(
409 409
 					/* translators: %s: option label */
410
-						esc_html__( 'The "%s" option is required.', 'give' ),
411
-						str_replace( ':', '', $label )
410
+						esc_html__('The "%s" option is required.', 'give'),
411
+						str_replace(':', '', $label)
412 412
 					);
413 413
 				}
414 414
 
415
-				$this->required[ $name ] = $alert;
415
+				$this->required[$name] = $alert;
416 416
 			}
417 417
 
418 418
 			return true;
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-gateways.php 1 patch
Spacing   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Gateways' ) ) :
16
+if ( ! class_exists('Give_Settings_Gateways')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Gateways.
@@ -27,15 +27,15 @@  discard block
 block discarded – undo
27 27
 		 */
28 28
 		public function __construct() {
29 29
 			$this->id    = 'gateways';
30
-			$this->label = esc_html__( 'Payment Gateways', 'give' );
30
+			$this->label = esc_html__('Payment Gateways', 'give');
31 31
 
32 32
 			$this->default_tab = 'gateways-settings';
33 33
 
34 34
 			parent::__construct();
35 35
 
36 36
 			// Do not use main form for this tab.
37
-			if ( give_get_current_setting_tab() === $this->id ) {
38
-				add_action( 'give_admin_field_enabled_gateways', array( $this, 'render_enabled_gateways' ), 10, 2 );
37
+			if (give_get_current_setting_tab() === $this->id) {
38
+				add_action('give_admin_field_enabled_gateways', array($this, 'render_enabled_gateways'), 10, 2);
39 39
 			}
40 40
 		}
41 41
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 			$settings        = array();
50 50
 			$current_section = give_get_current_setting_section();
51 51
 
52
-			switch ( $current_section ) {
52
+			switch ($current_section) {
53 53
 				case 'paypal-standard':
54 54
 					$settings = array(
55 55
 						// Section 2: PayPal Standard.
@@ -58,55 +58,55 @@  discard block
 block discarded – undo
58 58
 							'id'   => 'give_title_gateway_settings_2',
59 59
 						),
60 60
 						array(
61
-							'name' => __( 'PayPal Email', 'give' ),
62
-							'desc' => __( 'Enter your PayPal account\'s email.', 'give' ),
61
+							'name' => __('PayPal Email', 'give'),
62
+							'desc' => __('Enter your PayPal account\'s email.', 'give'),
63 63
 							'id'   => 'paypal_email',
64 64
 							'type' => 'email',
65 65
 						),
66 66
 						array(
67
-							'name' => __( 'PayPal Page Style', 'give' ),
68
-							'desc' => __( 'Enter the name of the PayPal page style to use, or leave blank to use the default.', 'give' ),
67
+							'name' => __('PayPal Page Style', 'give'),
68
+							'desc' => __('Enter the name of the PayPal page style to use, or leave blank to use the default.', 'give'),
69 69
 							'id'   => 'paypal_page_style',
70 70
 							'type' => 'text',
71 71
 						),
72 72
 						array(
73
-							'name'    => __( 'PayPal Transaction Type', 'give' ),
74
-							'desc'    => __( 'Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give' ),
73
+							'name'    => __('PayPal Transaction Type', 'give'),
74
+							'desc'    => __('Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give'),
75 75
 							'id'      => 'paypal_button_type',
76 76
 							'type'    => 'radio_inline',
77 77
 							'options' => array(
78
-								'donation' => __( 'Donation', 'give' ),
79
-								'standard' => __( 'Standard Transaction', 'give' )
78
+								'donation' => __('Donation', 'give'),
79
+								'standard' => __('Standard Transaction', 'give')
80 80
 							),
81 81
 							'default' => 'donation',
82 82
 						),
83 83
 						array(
84
-							'name'    => __( 'Billing Details', 'give' ),
85
-							'desc'    => __( 'This option will enable the billing details section for PayPal Standard which requires the donor\'s address to complete the donation. These fields are not required by PayPal to process the transaction, but you may have a need to collect the data.', 'give' ),
84
+							'name'    => __('Billing Details', 'give'),
85
+							'desc'    => __('This option will enable the billing details section for PayPal Standard which requires the donor\'s address to complete the donation. These fields are not required by PayPal to process the transaction, but you may have a need to collect the data.', 'give'),
86 86
 							'id'      => 'paypal_standard_billing_details',
87 87
 							'type'    => 'radio_inline',
88 88
 							'default' => 'disabled',
89 89
 							'options' => array(
90
-								'enabled'  => __( 'Enabled', 'give' ),
91
-								'disabled' => __( 'Disabled', 'give' ),
90
+								'enabled'  => __('Enabled', 'give'),
91
+								'disabled' => __('Disabled', 'give'),
92 92
 							)
93 93
 						),
94 94
 						array(
95
-							'name'    => __( 'PayPal IPN Verification', 'give' ),
96
-							'desc'    => __( 'If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give' ),
95
+							'name'    => __('PayPal IPN Verification', 'give'),
96
+							'desc'    => __('If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give'),
97 97
 							'id'      => 'paypal_verification',
98 98
 							'type'    => 'radio_inline',
99 99
 							'default' => 'enabled',
100 100
 							'options' => array(
101
-								'enabled'  => __( 'Enabled', 'give' ),
102
-								'disabled' => __( 'Disabled', 'give' ),
101
+								'enabled'  => __('Enabled', 'give'),
102
+								'disabled' => __('Disabled', 'give'),
103 103
 							)
104 104
 						),
105 105
 						array(
106
-							'name'  => __( 'PayPal Standard Gateway Settings Docs Link', 'give' ),
106
+							'name'  => __('PayPal Standard Gateway Settings Docs Link', 'give'),
107 107
 							'id'    => 'paypal_standard_gateway_settings_docs_link',
108
-							'url'   => esc_url( 'http://docs.givewp.com/settings-gateway-paypal-standard' ),
109
-							'title' => __( 'PayPal Standard Gateway Settings', 'give' ),
108
+							'url'   => esc_url('http://docs.givewp.com/settings-gateway-paypal-standard'),
109
+							'title' => __('PayPal Standard Gateway Settings', 'give'),
110 110
 							'type'  => 'give_docs_link',
111 111
 						),
112 112
 						array(
@@ -124,19 +124,19 @@  discard block
 block discarded – undo
124 124
 							'id'   => 'give_title_gateway_settings_3',
125 125
 						),
126 126
 						array(
127
-							'name'    => __( 'Collect Billing Details', 'give' ),
128
-							'desc'    => __( 'Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give' ),
127
+							'name'    => __('Collect Billing Details', 'give'),
128
+							'desc'    => __('Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give'),
129 129
 							'id'      => 'give_offline_donation_enable_billing_fields',
130 130
 							'type'    => 'radio_inline',
131 131
 							'default' => 'disabled',
132 132
 							'options' => array(
133
-								'enabled'  => __( 'Enabled', 'give' ),
134
-								'disabled' => __( 'Disabled', 'give' )
133
+								'enabled'  => __('Enabled', 'give'),
134
+								'disabled' => __('Disabled', 'give')
135 135
 							)
136 136
 						),
137 137
 						array(
138
-							'name'    => __( 'Offline Donation Instructions', 'give' ),
139
-							'desc'    => __( 'The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give' ),
138
+							'name'    => __('Offline Donation Instructions', 'give'),
139
+							'desc'    => __('The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give'),
140 140
 							'id'      => 'global_offline_donation_content',
141 141
 							'default' => give_get_default_offline_donation_content(),
142 142
 							'type'    => 'wysiwyg',
@@ -145,10 +145,10 @@  discard block
 block discarded – undo
145 145
 							)
146 146
 						),
147 147
 						array(
148
-							'name'  => esc_html__( 'Offline Donations Settings Docs Link', 'give' ),
148
+							'name'  => esc_html__('Offline Donations Settings Docs Link', 'give'),
149 149
 							'id'    => 'offline_gateway_settings_docs_link',
150
-							'url'   => esc_url( 'http://docs.givewp.com/offlinegateway' ),
151
-							'title' => __( 'Offline Gateway Settings', 'give' ),
150
+							'url'   => esc_url('http://docs.givewp.com/offlinegateway'),
151
+							'title' => __('Offline Gateway Settings', 'give'),
152 152
 							'type'  => 'give_docs_link',
153 153
 						),
154 154
 						array(
@@ -166,19 +166,19 @@  discard block
 block discarded – undo
166 166
 							'type' => 'title'
167 167
 						),
168 168
 						array(
169
-							'name'    => __( 'Test Mode', 'give' ),
170
-							'desc'    => __( 'While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give' ),
169
+							'name'    => __('Test Mode', 'give'),
170
+							'desc'    => __('While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give'),
171 171
 							'id'      => 'test_mode',
172 172
 							'type'    => 'radio_inline',
173 173
 							'default' => 'disabled',
174 174
 							'options' => array(
175
-								'enabled'  => __( 'Enabled', 'give' ),
176
-								'disabled' => __( 'Disabled', 'give' ),
175
+								'enabled'  => __('Enabled', 'give'),
176
+								'disabled' => __('Disabled', 'give'),
177 177
 							)
178 178
 						),
179 179
 						array(
180
-							'name' => __( 'Enabled Gateways', 'give' ),
181
-							'desc' => __( 'Enable your payment gateway. Can be ordered by dragging.', 'give' ),
180
+							'name' => __('Enabled Gateways', 'give'),
181
+							'desc' => __('Enable your payment gateway. Can be ordered by dragging.', 'give'),
182 182
 							'id'   => 'gateways',
183 183
 							'type' => 'enabled_gateways'
184 184
 						),
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 						 * This setting will not render on admin setting screen but help internal code to recognize "gateways_label"  setting and add them to give setting when save.
191 191
 						 */
192 192
 						array(
193
-							'name' => __( 'Gateways Label', 'give' ),
193
+							'name' => __('Gateways Label', 'give'),
194 194
 							'desc' => '',
195 195
 							'id'   => 'gateways_label',
196 196
 							'type' => 'gateways_label_hidden'
@@ -203,17 +203,17 @@  discard block
 block discarded – undo
203 203
 						 * This setting will not render on admin setting screen but help internal code to recognize "default_gateway"  setting and add them to give setting when save.
204 204
 						 */
205 205
 						array(
206
-							'name' => __( 'Default Gateway', 'give' ),
207
-							'desc' => __( 'The gateway that will be selected by default.', 'give' ),
206
+							'name' => __('Default Gateway', 'give'),
207
+							'desc' => __('The gateway that will be selected by default.', 'give'),
208 208
 							'id'   => 'default_gateway',
209 209
 							'type' => 'default_gateway_hidden'
210 210
 						),
211 211
 
212 212
 						array(
213
-							'name'  => __( 'Gateways Docs Link', 'give' ),
213
+							'name'  => __('Gateways Docs Link', 'give'),
214 214
 							'id'    => 'gateway_settings_docs_link',
215
-							'url'   => esc_url( 'http://docs.givewp.com/settings-gateways' ),
216
-							'title' => __( 'Gateway Settings', 'give' ),
215
+							'url'   => esc_url('http://docs.givewp.com/settings-gateways'),
216
+							'title' => __('Gateway Settings', 'give'),
217 217
 							'type'  => 'give_docs_link',
218 218
 						),
219 219
 						array(
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 			 * Filter the payment gateways settings.
229 229
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
230 230
 			 */
231
-			$settings = apply_filters( 'give_settings_gateways', $settings );
231
+			$settings = apply_filters('give_settings_gateways', $settings);
232 232
 
233 233
 			/**
234 234
 			 * Filter the settings.
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 			 *
238 238
 			 * @param  array $settings
239 239
 			 */
240
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
240
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
241 241
 
242 242
 			// Output.
243 243
 			return $settings;
@@ -251,12 +251,12 @@  discard block
 block discarded – undo
251 251
 		 */
252 252
 		public function get_sections() {
253 253
 			$sections = array(
254
-				'gateways-settings' => __( 'Gateways', 'give' ),
255
-				'paypal-standard'   => __( 'PayPal Standard', 'give' ),
256
-				'offline-donations' => __( 'Offline Donations', 'give' )
254
+				'gateways-settings' => __('Gateways', 'give'),
255
+				'paypal-standard'   => __('PayPal Standard', 'give'),
256
+				'offline-donations' => __('Offline Donations', 'give')
257 257
 			);
258 258
 
259
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
259
+			return apply_filters('give_get_sections_'.$this->id, $sections);
260 260
 		}
261 261
 
262 262
 
@@ -269,11 +269,11 @@  discard block
 block discarded – undo
269 269
 		 * @param $field
270 270
 		 * @param $settings
271 271
 		 */
272
-		public function render_enabled_gateways( $field, $settings ) {
272
+		public function render_enabled_gateways($field, $settings) {
273 273
 			$id              = $field['id'];
274
-			$gateways        = give_get_ordered_payment_gateways( give_get_payment_gateways() );
275
-			$gateways_label  = give_get_option( 'gateways_label', array() );
276
-			$default_gateway = give_get_option( 'default_gateway', current( array_keys( $gateways ) ) );
274
+			$gateways        = give_get_ordered_payment_gateways(give_get_payment_gateways());
275
+			$gateways_label  = give_get_option('gateways_label', array());
276
+			$default_gateway = give_get_option('default_gateway', current(array_keys($gateways)));
277 277
 
278 278
 			ob_start();
279 279
 
@@ -288,51 +288,51 @@  discard block
 block discarded – undo
288 288
 						<span>%3$s</span>
289 289
 						<span>%4$s</span>
290 290
 						',
291
-				__( 'Gateway', 'give' ),
292
-				__( 'Label', 'give' ),
293
-				__( 'Default', 'give' ),
294
-				__( 'Enabled', 'give' )
291
+				__('Gateway', 'give'),
292
+				__('Label', 'give'),
293
+				__('Default', 'give'),
294
+				__('Enabled', 'give')
295 295
 			);
296 296
 			echo '</div>';
297 297
 
298 298
 			echo '<ul class="give-checklist-fields give-payment-gatways-list">';
299
-			foreach ( $gateways as $key => $option ) :
299
+			foreach ($gateways as $key => $option) :
300 300
 				$enabled = null;
301
-				if ( is_array( $settings ) && array_key_exists( $key, $settings ) ) {
301
+				if (is_array($settings) && array_key_exists($key, $settings)) {
302 302
 					$enabled = '1';
303 303
 				}
304 304
 
305 305
 				echo '<li>';
306
-				printf( '<span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span>' );
307
-				printf( '<span class="admin-label">%s</span>', esc_html( $option['admin_label'] ) );
306
+				printf('<span class="give-drag-handle"><span class="dashicons dashicons-menu"></span></span>');
307
+				printf('<span class="admin-label">%s</span>', esc_html($option['admin_label']));
308 308
 
309 309
 				$label = '';
310
-				if ( ! empty( $gateways_label[ $key ] ) ) {
311
-					$label = $gateways_label[ $key ];
310
+				if ( ! empty($gateways_label[$key])) {
311
+					$label = $gateways_label[$key];
312 312
 				}
313 313
 
314 314
 				printf(
315 315
 					'<input class="checkout-label" type="text" id="%1$s[%2$s]" name="%1$s[%2$s]" value="%3$s" placeholder="%4$s"/>',
316 316
 					'gateways_label',
317
-					esc_attr( $key ),
318
-					esc_html( $label ),
319
-					esc_html( $option['checkout_label'] )
317
+					esc_attr($key),
318
+					esc_html($label),
319
+					esc_html($option['checkout_label'])
320 320
 				);
321 321
 
322 322
 				printf(
323 323
 					'<input class="gateways-radio" type="radio" name="%1$s" value="%2$s" %3$s %4$s>',
324 324
 					'default_gateway',
325 325
 					$key,
326
-					checked( $key, $default_gateway, false ),
327
-					disabled( NULL, $enabled, false )
326
+					checked($key, $default_gateway, false),
327
+					disabled(NULL, $enabled, false)
328 328
 				);
329 329
 
330 330
 				printf(
331 331
 					'<input class="gateways-checkbox" name="%1$s[%2$s]" id="%1$s[%2$s]" type="checkbox" value="1" %3$s data-payment-gateway="%4$s"/>',
332
-					esc_attr( $id ),
333
-					esc_attr( $key ),
334
-					checked( '1', $enabled, false ),
335
-					esc_html( $option['admin_label'] )
332
+					esc_attr($id),
333
+					esc_attr($key),
334
+					checked('1', $enabled, false),
335
+					esc_html($option['admin_label'])
336 336
 				);
337 337
 				echo '</li>';
338 338
 			endforeach;
Please login to merge, or discard this patch.
includes/admin/welcome.php 1 patch
Spacing   +108 added lines, -108 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 // Exit if accessed directly.
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit;
16 16
 }
17 17
 
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
 	 * @since 1.0
36 36
 	 */
37 37
 	public function __construct() {
38
-		add_action( 'admin_menu', array( $this, 'admin_menus' ) );
39
-		add_action( 'admin_head', array( $this, 'admin_head' ) );
40
-		add_action( 'admin_init', array( $this, 'welcome' ) );
38
+		add_action('admin_menu', array($this, 'admin_menus'));
39
+		add_action('admin_head', array($this, 'admin_head'));
40
+		add_action('admin_init', array($this, 'welcome'));
41 41
 	}
42 42
 
43 43
 	/**
@@ -49,45 +49,45 @@  discard block
 block discarded – undo
49 49
 	 * @return void
50 50
 	 */
51 51
 	public function admin_menus() {
52
-		list( $display_version ) = explode( '-', GIVE_VERSION );
52
+		list($display_version) = explode('-', GIVE_VERSION);
53 53
 
54 54
 		// About Page
55 55
 		add_dashboard_page(
56 56
 		/* translators: %s: Give version */
57
-			sprintf( esc_html__( 'Welcome to Give %s', 'give' ), $display_version ),
58
-			esc_html__( 'Welcome to Give', 'give' ),
57
+			sprintf(esc_html__('Welcome to Give %s', 'give'), $display_version),
58
+			esc_html__('Welcome to Give', 'give'),
59 59
 			$this->minimum_capability,
60 60
 			'give-about',
61
-			array( $this, 'about_screen' )
61
+			array($this, 'about_screen')
62 62
 		);
63 63
 
64 64
 		// Changelog Page
65 65
 		add_dashboard_page(
66
-			esc_html__( 'Give Changelog', 'give' ),
67
-			esc_html__( 'Give Changelog', 'give' ),
66
+			esc_html__('Give Changelog', 'give'),
67
+			esc_html__('Give Changelog', 'give'),
68 68
 			$this->minimum_capability,
69 69
 			'give-changelog',
70
-			array( $this, 'changelog_screen' )
70
+			array($this, 'changelog_screen')
71 71
 		);
72 72
 
73 73
 		// Getting Started Page
74 74
 		add_dashboard_page(
75 75
 		/* translators: %s: Give version */
76
-			sprintf( esc_html__( 'Give %s - Getting Started Guide', 'give' ), $display_version ),
77
-			esc_html__( 'Getting started with Give', 'give' ),
76
+			sprintf(esc_html__('Give %s - Getting Started Guide', 'give'), $display_version),
77
+			esc_html__('Getting started with Give', 'give'),
78 78
 			$this->minimum_capability,
79 79
 			'give-getting-started',
80
-			array( $this, 'getting_started_screen' )
80
+			array($this, 'getting_started_screen')
81 81
 		);
82 82
 
83 83
 		// Credits Page
84 84
 		add_dashboard_page(
85 85
 		/* translators: %s: Give version */
86
-			sprintf( esc_html__( 'Give %s - Credits', 'give' ), $display_version ),
87
-			esc_html__( 'The people that build Give', 'give' ),
86
+			sprintf(esc_html__('Give %s - Credits', 'give'), $display_version),
87
+			esc_html__('The people that build Give', 'give'),
88 88
 			$this->minimum_capability,
89 89
 			'give-credits',
90
-			array( $this, 'credits_screen' )
90
+			array($this, 'credits_screen')
91 91
 		);
92 92
 	}
93 93
 
@@ -100,10 +100,10 @@  discard block
 block discarded – undo
100 100
 	 */
101 101
 	public function admin_head() {
102 102
 
103
-		remove_submenu_page( 'index.php', 'give-about' );
104
-		remove_submenu_page( 'index.php', 'give-changelog' );
105
-		remove_submenu_page( 'index.php', 'give-getting-started' );
106
-		remove_submenu_page( 'index.php', 'give-credits' );
103
+		remove_submenu_page('index.php', 'give-about');
104
+		remove_submenu_page('index.php', 'give-changelog');
105
+		remove_submenu_page('index.php', 'give-getting-started');
106
+		remove_submenu_page('index.php', 'give-credits');
107 107
 
108 108
 	}
109 109
 
@@ -115,24 +115,24 @@  discard block
 block discarded – undo
115 115
 	 * @return void
116 116
 	 */
117 117
 	public function tabs() {
118
-		$selected = isset( $_GET['page'] ) ? $_GET['page'] : 'give-about';
118
+		$selected = isset($_GET['page']) ? $_GET['page'] : 'give-about';
119 119
 		?>
120 120
 		<h2 class="nav-tab-wrapper">
121 121
 			<a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>"
122
-			   href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-about' ), 'index.php' ) ) ); ?>">
123
-				<?php esc_html_e( 'About Give', 'give' ); ?>
122
+			   href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-about'), 'index.php'))); ?>">
123
+				<?php esc_html_e('About Give', 'give'); ?>
124 124
 			</a>
125 125
 			<a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>"
126
-			   href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-getting-started' ), 'index.php' ) ) ); ?>">
127
-				<?php esc_html_e( 'Getting Started', 'give' ); ?>
126
+			   href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-getting-started'), 'index.php'))); ?>">
127
+				<?php esc_html_e('Getting Started', 'give'); ?>
128 128
 			</a>
129 129
 			<a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>"
130
-			   href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-credits' ), 'index.php' ) ) ); ?>">
131
-				<?php esc_html_e( 'Credits', 'give' ); ?>
130
+			   href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-credits'), 'index.php'))); ?>">
131
+				<?php esc_html_e('Credits', 'give'); ?>
132 132
 			</a>
133 133
 			<a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>"
134
-			   href="<?php echo esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-addons' ) ); ?>">
135
-				<?php esc_html_e( 'Add-ons', 'give' ); ?>
134
+			   href="<?php echo esc_url(admin_url('edit.php?post_type=give_forms&page=give-addons')); ?>">
135
+				<?php esc_html_e('Add-ons', 'give'); ?>
136 136
 			</a>
137 137
 		</h2>
138 138
 		<?php
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	 * @return void
147 147
 	 */
148 148
 	public function about_screen() {
149
-		list( $display_version ) = explode( '-', GIVE_VERSION );
149
+		list($display_version) = explode('-', GIVE_VERSION);
150 150
 		?>
151 151
 		<div class="wrap about-wrap">
152 152
 
@@ -155,8 +155,8 @@  discard block
 block discarded – undo
155 155
 			<p class="about-text"><?php
156 156
 				printf(
157 157
 				/* translators: %s: http://docs.givewp.com/docs */
158
-					__( 'Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. We encourage you to check out the <a href="%s" target="_blank">plugin documentation</a> and getting started guide below.', 'give' ),
159
-					esc_url( 'http://docs.givewp.com/docs' )
158
+					__('Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. We encourage you to check out the <a href="%s" target="_blank">plugin documentation</a> and getting started guide below.', 'give'),
159
+					esc_url('http://docs.givewp.com/docs')
160 160
 				);
161 161
 				?></p>
162 162
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 			<div class="give-badge"><?php
166 166
 				printf(
167 167
 				/* translators: %s: Give version */
168
-					esc_html__( 'Version %s', 'give' ),
168
+					esc_html__('Version %s', 'give'),
169 169
 					$display_version
170 170
 				);
171 171
 				?></div>
@@ -175,17 +175,17 @@  discard block
 block discarded – undo
175 175
 			<div class="feature-section clearfix introduction">
176 176
 
177 177
 				<div class="video feature-section-item">
178
-					<img src="<?php echo GIVE_PLUGIN_URL . 'assets/dist/images/give-logo-photo-mashup.png' ?>"
179
-						 alt="<?php esc_attr_e( 'Give', 'give' ); ?>">
178
+					<img src="<?php echo GIVE_PLUGIN_URL.'assets/dist/images/give-logo-photo-mashup.png' ?>"
179
+						 alt="<?php esc_attr_e('Give', 'give'); ?>">
180 180
 				</div>
181 181
 
182 182
 				<div class="content feature-section-item last-feature">
183 183
 
184
-					<h3><?php esc_html_e( 'Give - Democratizing Generosity', 'give' ); ?></h3>
184
+					<h3><?php esc_html_e('Give - Democratizing Generosity', 'give'); ?></h3>
185 185
 
186
-					<p><?php esc_html_e( 'Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give' ); ?></p>
186
+					<p><?php esc_html_e('Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give'); ?></p>
187 187
 					<a href="https://givewp.com" target="_blank" class="button-secondary">
188
-						<?php esc_html_e( 'Learn More', 'give' ); ?>
188
+						<?php esc_html_e('Learn More', 'give'); ?>
189 189
 						<span class="dashicons dashicons-external"></span>
190 190
 					</a>
191 191
 
@@ -198,25 +198,25 @@  discard block
 block discarded – undo
198 198
 
199 199
 				<div class="content feature-section-item">
200 200
 
201
-					<h3><?php esc_html_e( 'Getting to Know Give', 'give' ); ?></h3>
201
+					<h3><?php esc_html_e('Getting to Know Give', 'give'); ?></h3>
202 202
 
203
-					<p><?php esc_html_e( 'Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have a question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give' ); ?></p>
203
+					<p><?php esc_html_e('Before you get started with Give we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have a question, issue or bug with the Core plugin please submit an issue on the Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give'); ?></p>
204 204
 
205 205
 					<h4>Find Out More:</h4>
206 206
 					<ul class="ul-disc">
207 207
 						<li><a href="https://givewp.com/"
208
-							   target="_blank"><?php esc_html_e( 'Visit the Give Website', 'give' ); ?></a></li>
208
+							   target="_blank"><?php esc_html_e('Visit the Give Website', 'give'); ?></a></li>
209 209
 						<li><a href="https://givewp.com/features/"
210
-							   target="_blank"><?php esc_html_e( 'View the Give Features', 'give' ); ?></a></li>
210
+							   target="_blank"><?php esc_html_e('View the Give Features', 'give'); ?></a></li>
211 211
 						<li><a href="https://givewp.com/documentation/"
212
-							   target="_blank"><?php esc_html_e( 'Read the Documentation', 'give' ); ?></a></li>
212
+							   target="_blank"><?php esc_html_e('Read the Documentation', 'give'); ?></a></li>
213 213
 					</ul>
214 214
 
215 215
 				</div>
216 216
 
217 217
 				<div class="content  feature-section-item last-feature">
218
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/dist/images/admin/give-form-mockup.png' ?>"
219
-						 alt="<?php esc_attr_e( 'A Give donation form', 'give' ); ?>">
218
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/dist/images/admin/give-form-mockup.png' ?>"
219
+						 alt="<?php esc_attr_e('A Give donation form', 'give'); ?>">
220 220
 				</div>
221 221
 
222 222
 			</div>
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 	 * @return void
236 236
 	 */
237 237
 	public function changelog_screen() {
238
-		list( $display_version ) = explode( '-', GIVE_VERSION );
238
+		list($display_version) = explode('-', GIVE_VERSION);
239 239
 		?>
240 240
 		<div class="wrap about-wrap">
241 241
 			<h1><?php echo get_admin_page_title(); ?></h1>
@@ -243,14 +243,14 @@  discard block
 block discarded – undo
243 243
 			<p class="about-text"><?php
244 244
 				printf(
245 245
 				/* translators: %s: Give version */
246
-					esc_html__( 'Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give' ),
246
+					esc_html__('Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give'),
247 247
 					$display_version
248 248
 				);
249 249
 				?></p>
250 250
 			<div class="give-badge"><?php
251 251
 				printf(
252 252
 				/* translators: %s: Give version */
253
-					esc_html__( 'Version %s', 'give' ),
253
+					esc_html__('Version %s', 'give'),
254 254
 					$display_version
255 255
 				);
256 256
 				?></div>
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 			<?php $this->tabs(); ?>
259 259
 
260 260
 			<div class="changelog">
261
-				<h3><?php esc_html_e( 'Full Changelog', 'give' ); ?></h3>
261
+				<h3><?php esc_html_e('Full Changelog', 'give'); ?></h3>
262 262
 
263 263
 				<div class="feature-section">
264 264
 					<?php echo $this->parse_readme(); ?>
@@ -266,10 +266,10 @@  discard block
 block discarded – undo
266 266
 			</div>
267 267
 
268 268
 			<div class="return-to-dashboard">
269
-				<a href="<?php echo esc_url( admin_url( add_query_arg( array(
269
+				<a href="<?php echo esc_url(admin_url(add_query_arg(array(
270 270
 					'post_type' => 'give_forms',
271 271
 					'page'      => 'give-settings'
272
-				), 'edit.php' ) ) ); ?>"><?php esc_html_e( 'Give Settings', 'give' ); ?></a>
272
+				), 'edit.php'))); ?>"><?php esc_html_e('Give Settings', 'give'); ?></a>
273 273
 			</div>
274 274
 		</div>
275 275
 		<?php
@@ -283,36 +283,36 @@  discard block
 block discarded – undo
283 283
 	 * @return void
284 284
 	 */
285 285
 	public function getting_started_screen() {
286
-		list( $display_version ) = explode( '-', GIVE_VERSION );
286
+		list($display_version) = explode('-', GIVE_VERSION);
287 287
 		?>
288 288
 		<div class="wrap about-wrap get-started">
289 289
 
290 290
 			<?php $this->get_welcome_header() ?>
291 291
 
292
-			<p class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></p>
292
+			<p class="about-text"><?php esc_html_e('Welcome to the getting started guide.', 'give'); ?></p>
293 293
 
294 294
 			<?php give_get_newsletter(); ?>
295 295
 
296 296
 			<div class="give-badge"><?php
297 297
 				printf(
298 298
 				/* translators: %s: Give version */
299
-					esc_html__( 'Version %s', 'give' ),
299
+					esc_html__('Version %s', 'give'),
300 300
 					$display_version
301 301
 				);
302 302
 				?></div>
303 303
 
304 304
 			<?php $this->tabs(); ?>
305 305
 
306
-			<p class="about-text"><?php printf( esc_html__( 'Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give' ), $display_version ); ?></p>
306
+			<p class="about-text"><?php printf(esc_html__('Getting started with Give is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give'), $display_version); ?></p>
307 307
 
308 308
 			<div class="feature-section clearfix">
309 309
 
310 310
 				<div class="content feature-section-item">
311
-					<h3><?php esc_html_e( 'STEP 1: Create a New Form', 'give' ); ?></h3>
311
+					<h3><?php esc_html_e('STEP 1: Create a New Form', 'give'); ?></h3>
312 312
 
313
-					<p><?php esc_html_e( 'Give is driven by its powerful donation form building features. However, it is much more than just a "donation form." From the "Add Form" page you\'ll be able to choose how and where you want to receive your donations. You will also be able to set the preferred donation amounts.', 'give' ); ?></p>
313
+					<p><?php esc_html_e('Give is driven by its powerful donation form building features. However, it is much more than just a "donation form." From the "Add Form" page you\'ll be able to choose how and where you want to receive your donations. You will also be able to set the preferred donation amounts.', 'give'); ?></p>
314 314
 
315
-					<p><?php esc_html_e( 'All of these features begin by simply going to the menu and choosing "Donations > Add Form."', 'give' ); ?></p>
315
+					<p><?php esc_html_e('All of these features begin by simply going to the menu and choosing "Donations > Add Form."', 'give'); ?></p>
316 316
 				</div>
317 317
 
318 318
 				<div class="content feature-section-item last-feature">
@@ -329,9 +329,9 @@  discard block
 block discarded – undo
329 329
 				</div>
330 330
 
331 331
 				<div class="content feature-section-item last-feature">
332
-					<h3><?php esc_html_e( 'STEP 2: Customize Your Donation Forms', 'give' ); ?></h3>
332
+					<h3><?php esc_html_e('STEP 2: Customize Your Donation Forms', 'give'); ?></h3>
333 333
 
334
-					<p><?php esc_html_e( 'Each donation form you create can be customized to receive either a pre-determined set donation amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the donation levels view where you can add as many levels as you\'d like with your own custom names and suggested amounts. As well, you can allow donors to give a custom amount and even set up donation goals.', 'give' ); ?></p>
334
+					<p><?php esc_html_e('Each donation form you create can be customized to receive either a pre-determined set donation amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the donation levels view where you can add as many levels as you\'d like with your own custom names and suggested amounts. As well, you can allow donors to give a custom amount and even set up donation goals.', 'give'); ?></p>
335 335
 				</div>
336 336
 
337 337
 			</div>
@@ -340,11 +340,11 @@  discard block
 block discarded – undo
340 340
 			<div class="feature-section clearfix">
341 341
 
342 342
 				<div class="content feature-section-item add-content">
343
-					<h3><?php esc_html_e( 'STEP 3: Add Additional Content', 'give' ); ?></h3>
343
+					<h3><?php esc_html_e('STEP 3: Add Additional Content', 'give'); ?></h3>
344 344
 
345
-					<p><?php esc_html_e( 'Every donation form you create with Give can be used on its own stand-alone page, or it can be inserted into any other page or post throughout your site via a shortcode or widget.', 'give' ); ?></p>
345
+					<p><?php esc_html_e('Every donation form you create with Give can be used on its own stand-alone page, or it can be inserted into any other page or post throughout your site via a shortcode or widget.', 'give'); ?></p>
346 346
 
347
-					<p><?php esc_html_e( 'You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give' ); ?></p>
347
+					<p><?php esc_html_e('You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the donation form on a page, or if you choose "None" perhaps you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give'); ?></p>
348 348
 				</div>
349 349
 
350 350
 				<div class="content feature-section-item last-feature">
@@ -361,9 +361,9 @@  discard block
 block discarded – undo
361 361
 				</div>
362 362
 
363 363
 				<div class="content feature-section-item last-feature">
364
-					<h3><?php esc_html_e( 'STEP 4: Configure Your Display Options', 'give' ); ?></h3>
364
+					<h3><?php esc_html_e('STEP 4: Configure Your Display Options', 'give'); ?></h3>
365 365
 
366
-					<p><?php esc_html_e( 'Lastly, you can present the form in a number of different ways that each create their own unique donor experience. The "Modal" display mode opens the credit card fieldset within a popup window. The "Reveal" mode will slide into place the additional fields. If you\'re looking for a simple button, then "Button" more is the way to go. This allows you to create a customizable "Donate Now" button which will open the donation form upon clicking. There\'s tons of possibilities here, give it a try!', 'give' ); ?></p>
366
+					<p><?php esc_html_e('Lastly, you can present the form in a number of different ways that each create their own unique donor experience. The "Modal" display mode opens the credit card fieldset within a popup window. The "Reveal" mode will slide into place the additional fields. If you\'re looking for a simple button, then "Button" more is the way to go. This allows you to create a customizable "Donate Now" button which will open the donation form upon clicking. There\'s tons of possibilities here, give it a try!', 'give'); ?></p>
367 367
 				</div>
368 368
 
369 369
 
@@ -383,20 +383,20 @@  discard block
 block discarded – undo
383 383
 	 * @return void
384 384
 	 */
385 385
 	public function credits_screen() {
386
-		list( $display_version ) = explode( '-', GIVE_VERSION );
386
+		list($display_version) = explode('-', GIVE_VERSION);
387 387
 		?>
388 388
 		<div class="wrap about-wrap">
389 389
 
390 390
 			<?php $this->get_welcome_header() ?>
391 391
 
392
-			<p class="about-text"><?php esc_html_e( 'Thanks to all those who have contributed code directly or indirectly.', 'give' ); ?></p>
392
+			<p class="about-text"><?php esc_html_e('Thanks to all those who have contributed code directly or indirectly.', 'give'); ?></p>
393 393
 
394 394
 			<?php give_get_newsletter(); ?>
395 395
 
396 396
 			<div class="give-badge"><?php
397 397
 				printf(
398 398
 				/* translators: %s: Give version */
399
-					esc_html__( 'Version %s', 'give' ),
399
+					esc_html__('Version %s', 'give'),
400 400
 					$display_version
401 401
 				);
402 402
 				?></div>
@@ -406,8 +406,8 @@  discard block
 block discarded – undo
406 406
 			<p class="about-description"><?php
407 407
 				printf(
408 408
 				/* translators: %s: https://github.com/WordImpress/give */
409
-					__( 'Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give' ),
410
-					esc_url( 'https://github.com/WordImpress/give' )
409
+					__('Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give'),
410
+					esc_url('https://github.com/WordImpress/give')
411 411
 				);
412 412
 				?></p>
413 413
 
@@ -424,21 +424,21 @@  discard block
 block discarded – undo
424 424
 	 * @return string $readme HTML formatted readme file
425 425
 	 */
426 426
 	public function parse_readme() {
427
-		$file = file_exists( GIVE_PLUGIN_DIR . 'readme.txt' ) ? GIVE_PLUGIN_DIR . 'readme.txt' : null;
427
+		$file = file_exists(GIVE_PLUGIN_DIR.'readme.txt') ? GIVE_PLUGIN_DIR . 'readme.txt' : null;
428 428
 
429
-		if ( ! $file ) {
430
-			$readme = '<p>' . esc_html__( 'No valid changlog was found.', 'give' ) . '</p>';
429
+		if ( ! $file) {
430
+			$readme = '<p>'.esc_html__('No valid changlog was found.', 'give').'</p>';
431 431
 		} else {
432
-			$readme = file_get_contents( $file );
433
-			$readme = nl2br( esc_html( $readme ) );
434
-			$readme = explode( '== Changelog ==', $readme );
435
-			$readme = end( $readme );
436
-
437
-			$readme = preg_replace( '/`(.*?)`/', '<code>\\1</code>', $readme );
438
-			$readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme );
439
-			$readme = preg_replace( '/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme );
440
-			$readme = preg_replace( '/= (.*?) =/', '<h4>\\1</h4>', $readme );
441
-			$readme = preg_replace( '/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme );
432
+			$readme = file_get_contents($file);
433
+			$readme = nl2br(esc_html($readme));
434
+			$readme = explode('== Changelog ==', $readme);
435
+			$readme = end($readme);
436
+
437
+			$readme = preg_replace('/`(.*?)`/', '<code>\\1</code>', $readme);
438
+			$readme = preg_replace('/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme);
439
+			$readme = preg_replace('/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme);
440
+			$readme = preg_replace('/= (.*?) =/', '<h4>\\1</h4>', $readme);
441
+			$readme = preg_replace('/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme);
442 442
 		}
443 443
 
444 444
 		return $readme;
@@ -455,24 +455,24 @@  discard block
 block discarded – undo
455 455
 	public function contributors() {
456 456
 		$contributors = $this->get_contributors();
457 457
 
458
-		if ( empty( $contributors ) ) {
458
+		if (empty($contributors)) {
459 459
 			return '';
460 460
 		}
461 461
 
462 462
 		$contributor_list = '<ul class="wp-people-group">';
463 463
 
464
-		foreach ( $contributors as $contributor ) {
464
+		foreach ($contributors as $contributor) {
465 465
 			$contributor_list .= '<li class="wp-person">';
466 466
 			$contributor_list .= sprintf(
467 467
 				'<a href="%1$s" target="_blank"><img src="%2$s" width="64" height="64" class="gravatar" alt="%3$s" /></a>',
468
-				esc_url( 'https://github.com/' . $contributor->login ),
469
-				esc_url( $contributor->avatar_url ),
470
-				esc_attr( $contributor->login )
468
+				esc_url('https://github.com/'.$contributor->login),
469
+				esc_url($contributor->avatar_url),
470
+				esc_attr($contributor->login)
471 471
 			);
472 472
 			$contributor_list .= sprintf(
473 473
 				'<a class="web" target="_blank" href="%1$s">%2$s</a>',
474
-				esc_url( 'https://github.com/' . $contributor->login ),
475
-				esc_html( $contributor->login )
474
+				esc_url('https://github.com/'.$contributor->login),
475
+				esc_html($contributor->login)
476 476
 			);
477 477
 			$contributor_list .= '</li>';
478 478
 		}
@@ -490,25 +490,25 @@  discard block
 block discarded – undo
490 490
 	 * @return array $contributors List of contributors
491 491
 	 */
492 492
 	public function get_contributors() {
493
-		$contributors = Give_Cache::get( 'give_contributors', true );
493
+		$contributors = Give_Cache::get('give_contributors', true);
494 494
 
495
-		if ( false !== $contributors ) {
495
+		if (false !== $contributors) {
496 496
 			return $contributors;
497 497
 		}
498 498
 
499
-		$response = wp_remote_get( 'https://api.github.com/repos/WordImpress/Give/contributors', array( 'sslverify' => false ) );
499
+		$response = wp_remote_get('https://api.github.com/repos/WordImpress/Give/contributors', array('sslverify' => false));
500 500
 
501
-		if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
501
+		if (is_wp_error($response) || 200 != wp_remote_retrieve_response_code($response)) {
502 502
 			return array();
503 503
 		}
504 504
 
505
-		$contributors = json_decode( wp_remote_retrieve_body( $response ) );
505
+		$contributors = json_decode(wp_remote_retrieve_body($response));
506 506
 
507
-		if ( ! is_array( $contributors ) ) {
507
+		if ( ! is_array($contributors)) {
508 508
 			return array();
509 509
 		}
510 510
 
511
-		Give_Cache::set( 'give_contributors', $contributors, HOUR_IN_SECONDS, true );
511
+		Give_Cache::set('give_contributors', $contributors, HOUR_IN_SECONDS, true);
512 512
 
513 513
 		return $contributors;
514 514
 	}
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
 	 */
521 521
 	public function get_welcome_header() {
522 522
 		// Badge for welcome page
523
-		$badge_url = GIVE_PLUGIN_URL . 'assets/dist/images/give-badge.png';
523
+		$badge_url = GIVE_PLUGIN_URL.'assets/dist/images/give-badge.png';
524 524
 		?>
525 525
 		<h1 class="welcome-h1"><?php echo get_admin_page_title(); ?></h1>
526 526
 		<?php $this->social_media_elements(); ?>
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
 			<a href="https://twitter.com/givewp" class="twitter-follow-button" data-show-count="false"><?php
614 614
 				printf(
615 615
 				/* translators: %s: Give twitter user @givewp */
616
-					esc_html_e( 'Follow %s', 'give' ),
616
+					esc_html_e('Follow %s', 'give'),
617 617
 					'@givewp'
618 618
 				);
619 619
 				?></a>
@@ -647,27 +647,27 @@  discard block
 block discarded – undo
647 647
 	public function welcome() {
648 648
 
649 649
 		// Bail if no activation redirect
650
-		if ( ! Give_Cache::get( '_give_activation_redirect', true ) || wp_doing_ajax() ) {
650
+		if ( ! Give_Cache::get('_give_activation_redirect', true) || wp_doing_ajax()) {
651 651
 			return;
652 652
 		}
653 653
 
654 654
 		// Delete the redirect transient
655
-		Give_Cache::delete( Give_Cache::get_key( '_give_activation_redirect' ) );
655
+		Give_Cache::delete(Give_Cache::get_key('_give_activation_redirect'));
656 656
 
657 657
 		// Bail if activating from network, or bulk
658
-		if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
658
+		if (is_network_admin() || isset($_GET['activate-multi'])) {
659 659
 			return;
660 660
 		}
661 661
 
662
-		$upgrade = get_option( 'give_version_upgraded_from' );
662
+		$upgrade = get_option('give_version_upgraded_from');
663 663
 
664
-		if ( ! $upgrade ) { // First time install
665
-			wp_safe_redirect( admin_url( 'index.php?page=give-about' ) );
664
+		if ( ! $upgrade) { // First time install
665
+			wp_safe_redirect(admin_url('index.php?page=give-about'));
666 666
 			exit;
667
-		} elseif ( ! give_is_setting_enabled( give_get_option( 'welcome' ) ) ) { // Welcome is disabled in settings
667
+		} elseif ( ! give_is_setting_enabled(give_get_option('welcome'))) { // Welcome is disabled in settings
668 668
 
669 669
 		} else { // Welcome is NOT disabled in settings
670
-			wp_safe_redirect( admin_url( 'index.php?page=give-about' ) );
670
+			wp_safe_redirect(admin_url('index.php?page=give-about'));
671 671
 			exit;
672 672
 		}
673 673
 	}
Please login to merge, or discard this patch.
includes/admin/emails/class-new-donor-register-email.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -10,11 +10,11 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if access directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
17
-if ( ! class_exists( 'Give_New_Donor_Register_Email' ) ) :
17
+if ( ! class_exists('Give_New_Donor_Register_Email')) :
18 18
 
19 19
 	/**
20 20
 	 * Give_New_Donor_Register_Email
@@ -31,35 +31,35 @@  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'                    => 'new-donor-register',
36
-				'label'                 => __( 'New User Registration', 'give' ),
37
-				'description'           => __( 'Sent to designated recipient(s) when a new user registers on the site via a donation form.', 'give' ),
36
+				'label'                 => __('New User Registration', 'give'),
37
+				'description'           => __('Sent to designated recipient(s) when a new user registers on the site via a donation form.', 'give'),
38 38
 				'has_recipient_field'   => true,
39 39
 				'notification_status'   => 'enabled',
40 40
 				'has_preview_header'    => true,
41
-				'email_tag_context'     => array( 'donor', 'general' ),
41
+				'email_tag_context'     => array('donor', 'general'),
42 42
 				'form_metabox_setting'  => false,
43 43
 				'default_email_subject' => sprintf(
44 44
 					/* translators: %s: site name */
45
-					esc_attr__( '[%s] New User Registration', 'give' ),
46
-					get_bloginfo( 'name' )
45
+					esc_attr__('[%s] New User Registration', 'give'),
46
+					get_bloginfo('name')
47 47
 				),
48 48
 				'default_email_message' => $this->get_default_email_message(),
49
-				'default_email_header'  => __( 'New User Registration', 'give' ),
50
-			) );
49
+				'default_email_header'  => __('New User Registration', 'give'),
50
+			));
51 51
 
52 52
 			// Setup action hook.
53 53
 			add_action(
54 54
 				"give_{$this->config['id']}_email_notification",
55
-				array( $this, 'setup_email_notification' ),
55
+				array($this, 'setup_email_notification'),
56 56
 				10,
57 57
 				2
58 58
 			);
59 59
 
60 60
 			add_filter(
61 61
 				'give_email_preview_header',
62
-				array( $this, 'email_preview_header' ),
62
+				array($this, 'email_preview_header'),
63 63
 				10,
64 64
 				2
65 65
 			);
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
 		 * @return string
75 75
 		 */
76 76
 		function get_default_email_message() {
77
-			$message = esc_attr__( 'New user registration on your site {sitename}:', 'give' ) . "\r\n\r\n";
78
-			$message .= esc_attr__( 'Username: {username}', 'give' ) . "\r\n\r\n";
79
-			$message .= esc_attr__( 'Email: {user_email}', 'give' ) . "\r\n";
77
+			$message = esc_attr__('New user registration on your site {sitename}:', 'give')."\r\n\r\n";
78
+			$message .= esc_attr__('Username: {username}', 'give')."\r\n\r\n";
79
+			$message .= esc_attr__('Email: {user_email}', 'give')."\r\n";
80 80
 
81 81
 			/**
82 82
 			 * Filter the default email message
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 		 * @since 2.0
97 97
 		 */
98 98
 		public function setup_email_data() {
99
-			Give()->emails->__set( 'heading', $this->get_email_header() );
99
+			Give()->emails->__set('heading', $this->get_email_header());
100 100
 		}
101 101
 
102 102
 
@@ -111,12 +111,12 @@  discard block
 block discarded – undo
111 111
 		 *
112 112
 		 * @return string
113 113
 		 */
114
-		public function setup_email_notification( $user_id, $user_data ) {
114
+		public function setup_email_notification($user_id, $user_data) {
115 115
 			$this->setup_email_data();
116 116
 
117
-			$this->send_email_notification( array(
117
+			$this->send_email_notification(array(
118 118
 				'user_id' => $user_id,
119
-			) );
119
+			));
120 120
 		}
121 121
 
122 122
 
@@ -130,42 +130,42 @@  discard block
 block discarded – undo
130 130
 		 * @param Give_New_Donor_Register_Email $email
131 131
 		 * @return string
132 132
 		 */
133
-		public function email_preview_header( $email_preview_header, $email ) {
133
+		public function email_preview_header($email_preview_header, $email) {
134 134
 			// Bailout.
135
-			if ( $this->config['id'] !== $email->config['id'] ) {
135
+			if ($this->config['id'] !== $email->config['id']) {
136 136
 				return $email_preview_header;
137 137
 			}
138 138
 
139 139
 			// Payment receipt switcher
140
-			$user_id = give_check_variable( give_clean( $_GET ), 'isset', 0, 'user_id' );
140
+			$user_id = give_check_variable(give_clean($_GET), 'isset', 0, 'user_id');
141 141
 
142 142
 			// Get payments.
143 143
 			$donors  = new Give_API();
144
-			$donors  = give_check_variable( $donors->get_donors(), 'empty', array(), 'donors' );
144
+			$donors  = give_check_variable($donors->get_donors(), 'empty', array(), 'donors');
145 145
 			$options = array();
146 146
 
147 147
 			// Default option.
148
-			$options[0] = esc_html__( 'No donor(s) found.', 'give' );
148
+			$options[0] = esc_html__('No donor(s) found.', 'give');
149 149
 
150 150
 			// Provide nice human readable options.
151
-			if ( $donors ) {
152
-				$options[0] = esc_html__( '- Select a donor -', 'give' );
153
-				foreach ( $donors as $donor ) {
151
+			if ($donors) {
152
+				$options[0] = esc_html__('- Select a donor -', 'give');
153
+				foreach ($donors as $donor) {
154 154
 					// Exclude customers for which wp user not exist.
155
-					if ( ! $donor['info']['user_id'] ) {
155
+					if ( ! $donor['info']['user_id']) {
156 156
 						continue;
157 157
 					}
158
-					$options[ $donor['info']['user_id'] ] = esc_html( '#' . $donor['info']['donor_id'] . ' - ' . $donor['info']['email'] );
158
+					$options[$donor['info']['user_id']] = esc_html('#'.$donor['info']['donor_id'].' - '.$donor['info']['email']);
159 159
 				}
160 160
 			}
161 161
 
162
-			$request_url_data = wp_parse_url( $_SERVER['REQUEST_URI'] );
162
+			$request_url_data = wp_parse_url($_SERVER['REQUEST_URI']);
163 163
 			$query            = $request_url_data['query'];
164 164
 
165 165
 			// Remove user id query param if set from request url.
166
-			$query = remove_query_arg( array( 'user_id' ), $query );
166
+			$query = remove_query_arg(array('user_id'), $query);
167 167
 
168
-			$request_url = home_url( '/?' . str_replace( '', '', $query ) );
168
+			$request_url = home_url('/?'.str_replace('', '', $query));
169 169
 			?>
170 170
 			<script type="text/javascript">
171 171
 				function change_preview() {
@@ -199,12 +199,12 @@  discard block
 block discarded – undo
199 199
 			<div class="give_preview_email_user_id_main">
200 200
 
201 201
 				<label for="give_preview_email_user_id" class="give_preview_email_user_id_label">
202
-					<?php echo esc_html__( 'Preview email with a donor:', 'give' ); ?>
202
+					<?php echo esc_html__('Preview email with a donor:', 'give'); ?>
203 203
 				</label>
204 204
 
205 205
 				<?php
206 206
 				// The select field with 100 latest transactions
207
-				echo Give()->html->select( array(
207
+				echo Give()->html->select(array(
208 208
 					'name'             => 'preview_email_user_id',
209 209
 					'selected'         => $user_id,
210 210
 					'id'               => 'give_preview_email_user_id',
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 					'select_atts'      => 'onchange="change_preview()"',
215 215
 					'show_option_all'  => false,
216 216
 					'show_option_none' => false,
217
-				) );
217
+				));
218 218
 				?>
219 219
 				<!-- Closing tag-->
220 220
 			</div>
Please login to merge, or discard this patch.
includes/admin/emails/class-new-donation-email.php 1 patch
Spacing   +25 added lines, -25 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
-				'default_email_header'  => __( 'New Donation!', 'give' ),
52
-			) );
51
+				'default_email_header'  => __('New Donation!', 'give'),
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
 		/**
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
 		 *
65 65
 		 * @return string
66 66
 		 */
67
-		public function get_email_subject( $form_id = null ) {
67
+		public function get_email_subject($form_id = null) {
68 68
 			$subject = wp_strip_all_tags(
69 69
 				Give_Email_Notification_Util::get_value(
70 70
 					$this,
71
-					Give_Email_Setting_Field::get_prefix( $this, $form_id ) . 'email_subject',
71
+					Give_Email_Setting_Field::get_prefix($this, $form_id).'email_subject',
72 72
 					$form_id,
73 73
 					$this->config['default_email_subject']
74 74
 				)
@@ -80,14 +80,14 @@  discard block
 block discarded – undo
80 80
 			 *
81 81
 			 * @since 1.0
82 82
 			 */
83
-			$subject = apply_filters( 'give_admin_donation_notification_subject', $subject, $this->payment->ID );
83
+			$subject = apply_filters('give_admin_donation_notification_subject', $subject, $this->payment->ID);
84 84
 
85 85
 			/**
86 86
 			 * Filters the donation notification subject.
87 87
 			 *
88 88
 			 * @since 2.0
89 89
 			 */
90
-			$subject = apply_filters( "give_{$this->config['id']}_get_email_subject", $subject, $this, $form_id );
90
+			$subject = apply_filters("give_{$this->config['id']}_get_email_subject", $subject, $this, $form_id);
91 91
 
92 92
 			return $subject;
93 93
 		}
@@ -103,10 +103,10 @@  discard block
 block discarded – undo
103 103
 		 *
104 104
 		 * @return string
105 105
 		 */
106
-		public function get_email_message( $form_id = null ) {
106
+		public function get_email_message($form_id = null) {
107 107
 			$message = Give_Email_Notification_Util::get_value(
108 108
 				$this,
109
-				Give_Email_Setting_Field::get_prefix( $this, $form_id ) . 'email_message',
109
+				Give_Email_Setting_Field::get_prefix($this, $form_id).'email_message',
110 110
 				$form_id,
111 111
 				$this->config['default_email_message']
112 112
 			);
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 		 * @param int $form_id
150 150
 		 * @return array
151 151
 		 */
152
-		public function get_email_attachments( $form_id = null ) {
152
+		public function get_email_attachments($form_id = null) {
153 153
 			/**
154 154
 			 * Filters the donation notification email attachments.
155 155
 			 * By default, there is no attachment but plugins can hook in to provide one more multiple.
@@ -212,9 +212,9 @@  discard block
 block discarded – undo
212 212
 				$this->payment->payment_meta
213 213
 			);
214 214
 
215
-			Give()->emails->__set( 'from_name', $from_name );
216
-			Give()->emails->__set( 'from_email', $from_email );
217
-			Give()->emails->__set( 'heading', $this->get_email_header() );
215
+			Give()->emails->__set('from_name', $from_name);
216
+			Give()->emails->__set('from_email', $from_email);
217
+			Give()->emails->__set('heading', $this->get_email_header());
218 218
 
219 219
 			/**
220 220
 			 * Filters the donation notification email headers.
@@ -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/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,10 +172,10 @@  discard block
 block discarded – undo
172 172
 	 *
173 173
 	 * @return string
174 174
 	 */
175
-	public function column_email_type( Give_Email_Notification $email ) {
175
+	public function column_email_type(Give_Email_Notification $email) {
176 176
 		$email_content_type_label = apply_filters(
177 177
 			"give_email_list_render_{$email->config['id']}_email_content_type",
178
-			Give_Email_Notification_Util::get_formatted_email_type( $email->config['content_type'] ),
178
+			Give_Email_Notification_Util::get_formatted_email_type($email->config['content_type']),
179 179
 			$email
180 180
 		);
181 181
 
@@ -192,15 +192,15 @@  discard block
 block discarded – undo
192 192
 	 *
193 193
 	 * @return string
194 194
 	 */
195
-	public function column_setting( Give_Email_Notification $email ) {
196
-		return Give()->tooltips->render_link( array(
197
-			'label'       => __( 'Edit', 'give' ) . " {$email->config['label']}",
195
+	public function column_setting(Give_Email_Notification $email) {
196
+		return Give()->tooltips->render_link(array(
197
+			'label'       => __('Edit', 'give')." {$email->config['label']}",
198 198
 			'tag_content' => '<span class="dashicons dashicons-admin-generic"></span>',
199
-			'link'        => esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=emails&section=' . $email->config['id'] ) ),
199
+			'link'        => esc_url(admin_url('edit.php?post_type=give_forms&page=give-settings&tab=emails&section='.$email->config['id'])),
200 200
 			'attributes'  => array(
201 201
 				'class' => 'button button-small',
202 202
 			),
203
-		) );
203
+		));
204 204
 	}
205 205
 
206 206
 
@@ -214,8 +214,8 @@  discard block
 block discarded – undo
214 214
 	 *
215 215
 	 * @return array
216 216
 	 */
217
-	private function get_row_actions( $email ) {
218
-		$edit_url = esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=emails&section=' . $email->config['id'] ) );
217
+	private function get_row_actions($email) {
218
+		$edit_url = esc_url(admin_url('edit.php?post_type=give_forms&page=give-settings&tab=emails&section='.$email->config['id']));
219 219
 
220 220
 		/**
221 221
 		 * Filter the row actions
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 		$row_actions = apply_filters(
228 228
 			'give_email_notification_row_actions',
229 229
 			array(
230
-				'edit' => "<a href=\"{$edit_url}\">" . __( 'Edit', 'give' ) . '</a>',
230
+				'edit' => "<a href=\"{$edit_url}\">".__('Edit', 'give').'</a>',
231 231
 			),
232 232
 			$email
233 233
 		);
@@ -248,22 +248,22 @@  discard block
 block discarded – undo
248 248
 		$hidden                = array();
249 249
 		$email_notifications   = array();
250 250
 		$sortable              = $this->get_sortable_columns();
251
-		$this->_column_headers = array( $columns, $hidden, $sortable, $this->get_primary_column_name() );
251
+		$this->_column_headers = array($columns, $hidden, $sortable, $this->get_primary_column_name());
252 252
 
253 253
 		// Set email notifications.
254 254
 		/* @var Give_Email_Notification $email_notification */
255
-		foreach ( $this->email_notifications->get_email_notifications() as $email_notification ) {
256
-			if ( Give_Email_Notification_Util::is_show_on_emails_setting_page( $email_notification ) ) {
255
+		foreach ($this->email_notifications->get_email_notifications() as $email_notification) {
256
+			if (Give_Email_Notification_Util::is_show_on_emails_setting_page($email_notification)) {
257 257
 				$email_notifications[] = $email_notification;
258 258
 			}
259 259
 		}
260 260
 
261
-		$totalItems  = count( $email_notifications );
261
+		$totalItems  = count($email_notifications);
262 262
 		$this->items = $email_notifications;
263
-		$this->set_pagination_args( array(
263
+		$this->set_pagination_args(array(
264 264
 			'total_items' => $totalItems,
265 265
 			'per_page'    => $this->per_page,
266
-		) );
266
+		));
267 267
 	}
268 268
 
269 269
 	/**
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 	 * @access public
274 274
 	 */
275 275
 	public function no_items() {
276
-		_e( 'No give email notification found.', 'give' );
276
+		_e('No give email notification found.', 'give');
277 277
 	}
278 278
 
279 279
 	/**
Please login to merge, or discard this patch.
includes/admin/emails/class-email-setting-field.php 1 patch
Spacing   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -21,30 +21,30 @@  discard block
 block discarded – undo
21 21
 	 *
22 22
 	 * @return array
23 23
 	 */
24
-	public static function get_setting_fields( Give_Email_Notification $email, $form_id = null ) {
25
-		$setting_fields = self::get_default_setting_fields( $email, $form_id );
24
+	public static function get_setting_fields(Give_Email_Notification $email, $form_id = null) {
25
+		$setting_fields = self::get_default_setting_fields($email, $form_id);
26 26
 
27 27
 		// Recipient field.
28
-		$setting_fields[] = self::get_recipient_setting_field( $email, $form_id, Give_Email_Notification_Util::has_recipient_field( $email ) );
28
+		$setting_fields[] = self::get_recipient_setting_field($email, $form_id, Give_Email_Notification_Util::has_recipient_field($email));
29 29
 
30 30
 		// Add extra setting field.
31
-		if ( $extra_setting_field = $email->get_extra_setting_fields( $form_id ) ) {
32
-			$setting_fields = array_merge( $setting_fields, $extra_setting_field );
31
+		if ($extra_setting_field = $email->get_extra_setting_fields($form_id)) {
32
+			$setting_fields = array_merge($setting_fields, $extra_setting_field);
33 33
 		}
34 34
 
35 35
 		// Preview field.
36
-		if ( Give_Email_Notification_Util::has_preview( $email ) ) {
37
-			$setting_fields[] = self::get_preview_setting_field( $email, $form_id );
36
+		if (Give_Email_Notification_Util::has_preview($email)) {
37
+			$setting_fields[] = self::get_preview_setting_field($email, $form_id);
38 38
 		}
39 39
 
40
-		$setting_fields = self::add_section_end( $email, $setting_fields );
40
+		$setting_fields = self::add_section_end($email, $setting_fields);
41 41
 
42 42
 		/**
43 43
 		 * Filter the email notification settings.
44 44
 		 *
45 45
 		 * @since 2.0
46 46
 		 */
47
-		return apply_filters( 'give_email_notification_setting_fields', $setting_fields, $email, $form_id );
47
+		return apply_filters('give_email_notification_setting_fields', $setting_fields, $email, $form_id);
48 48
 	}
49 49
 
50 50
 
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
 	 *
59 59
 	 * @return bool
60 60
 	 */
61
-	public static function has_section_end( $setting ) {
62
-		$last_field      = end( $setting );
61
+	public static function has_section_end($setting) {
62
+		$last_field      = end($setting);
63 63
 		$has_section_end = false;
64 64
 
65
-		if ( 'sectionend' === $last_field['type'] ) {
65
+		if ('sectionend' === $last_field['type']) {
66 66
 			$has_section_end = true;
67 67
 		}
68 68
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	 *
81 81
 	 * @return array
82 82
 	 */
83
-	public static function get_section_start( Give_Email_Notification $email, $form_id = null ) {
83
+	public static function get_section_start(Give_Email_Notification $email, $form_id = null) {
84 84
 		// Add section end field.
85 85
 		$setting = array(
86 86
 			'id'    => "give_title_email_settings_{$email->config['id']}",
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
 	 *
103 103
 	 * @return array
104 104
 	 */
105
-	public static function add_section_end( Give_Email_Notification $email, $setting ) {
106
-		if ( ! self::has_section_end( $setting ) ) {
105
+	public static function add_section_end(Give_Email_Notification $email, $setting) {
106
+		if ( ! self::has_section_end($setting)) {
107 107
 			// Add section end field.
108 108
 			$setting[] = array(
109 109
 				'id'   => "give_title_email_settings_{$email->config['id']}",
@@ -125,26 +125,26 @@  discard block
 block discarded – undo
125 125
 	 *
126 126
 	 * @return array
127 127
 	 */
128
-	public static function get_default_setting_fields( Give_Email_Notification $email, $form_id = null ) {
129
-		$settings[] = self::get_section_start( $email, $form_id );
130
-		$settings[] = self::get_notification_status_field( $email, $form_id );
128
+	public static function get_default_setting_fields(Give_Email_Notification $email, $form_id = null) {
129
+		$settings[] = self::get_section_start($email, $form_id);
130
+		$settings[] = self::get_notification_status_field($email, $form_id);
131 131
 
132
-		if ( ! Give_Email_Notification_Util::is_notification_status_editable( $email ) ) {
133
-			if ( $form_id || give_is_add_new_form_page() ) {
132
+		if ( ! Give_Email_Notification_Util::is_notification_status_editable($email)) {
133
+			if ($form_id || give_is_add_new_form_page()) {
134 134
 				// Do not allow admin to disable notification on perform basis.
135
-				unset( $settings[1]['options']['disabled'] );
135
+				unset($settings[1]['options']['disabled']);
136 136
 			} else {
137 137
 				// Do not allow admin to edit notification status globally.
138
-				unset( $settings[1] );
138
+				unset($settings[1]);
139 139
 			}
140 140
 		}
141 141
 
142
-		$settings[] = self::get_email_subject_field( $email, $form_id );
143
-		$settings[] = self::get_email_header_field( $email, $form_id );
144
-		$settings[] = self::get_email_message_field( $email, $form_id );
142
+		$settings[] = self::get_email_subject_field($email, $form_id);
143
+		$settings[] = self::get_email_header_field($email, $form_id);
144
+		$settings[] = self::get_email_message_field($email, $form_id);
145 145
 
146
-		if ( Give_Email_Notification_Util::is_content_type_editable( $email ) ) {
147
-			$settings[] = self::get_email_content_type_field( $email, $form_id );
146
+		if (Give_Email_Notification_Util::is_content_type_editable($email)) {
147
+			$settings[] = self::get_email_content_type_field($email, $form_id);
148 148
 		}
149 149
 
150 150
 		return $settings;
@@ -161,31 +161,31 @@  discard block
 block discarded – undo
161 161
 	 *
162 162
 	 * @return array
163 163
 	 */
164
-	public static function get_notification_status_field( Give_Email_Notification $email, $form_id = null ) {
164
+	public static function get_notification_status_field(Give_Email_Notification $email, $form_id = null) {
165 165
 		$option = array(
166
-			'enabled'  => __( 'Enabled', 'give' ),
167
-			'disabled' => __( 'Disabled', 'give' ),
166
+			'enabled'  => __('Enabled', 'give'),
167
+			'disabled' => __('Disabled', 'give'),
168 168
 		);
169 169
 
170 170
 		$default_value = $email->get_notification_status();
171 171
 
172 172
 		// Add global options.
173
-		if ( $form_id || give_is_add_new_form_page() ) {
173
+		if ($form_id || give_is_add_new_form_page()) {
174 174
 			$option = array(
175
-				'global'   => __( 'Global Options' ),
176
-				'enabled'  => __( 'Customize', 'give' ),
177
-				'disabled' => __( 'Disabled', 'give' ),
175
+				'global'   => __('Global Options'),
176
+				'enabled'  => __('Customize', 'give'),
177
+				'disabled' => __('Disabled', 'give'),
178 178
 			);
179 179
 
180 180
 			$default_value = 'global';
181 181
 		}
182 182
 
183
-		$description = isset( $_GET['page'] ) && 'give-settings' === $_GET['page'] ? __( 'Choose whether you want this email enabled or not.', 'give' ) : sprintf( __( 'Global Options are set <a href="%s">in Give settings</a>. You may override them for this form here.', 'give' ), admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=emails' ) );
183
+		$description = isset($_GET['page']) && 'give-settings' === $_GET['page'] ? __('Choose whether you want this email enabled or not.', 'give') : sprintf(__('Global Options are set <a href="%s">in Give settings</a>. You may override them for this form here.', 'give'), admin_url('edit.php?post_type=give_forms&page=give-settings&tab=emails'));
184 184
 
185 185
 		return array(
186
-			'name'          => esc_html__( 'Notification', 'give' ),
186
+			'name'          => esc_html__('Notification', 'give'),
187 187
 			'desc'          => $description,
188
-			'id'            => self::get_prefix( $email, $form_id ) . 'notification',
188
+			'id'            => self::get_prefix($email, $form_id).'notification',
189 189
 			'type'          => 'radio_inline',
190 190
 			'default'       => $default_value,
191 191
 			'options'       => $option,
@@ -204,11 +204,11 @@  discard block
 block discarded – undo
204 204
 	 *
205 205
 	 * @return array
206 206
 	 */
207
-	public static function get_email_subject_field( Give_Email_Notification $email, $form_id = null ) {
207
+	public static function get_email_subject_field(Give_Email_Notification $email, $form_id = null) {
208 208
 		return array(
209
-			'id'      => self::get_prefix( $email, $form_id ) . 'email_subject',
210
-			'name'    => esc_html__( 'Email Subject', 'give' ),
211
-			'desc'    => esc_html__( 'Enter the email subject line.', 'give' ),
209
+			'id'      => self::get_prefix($email, $form_id).'email_subject',
210
+			'name'    => esc_html__('Email Subject', 'give'),
211
+			'desc'    => esc_html__('Enter the email subject line.', 'give'),
212 212
 			'default' => $email->config['default_email_subject'],
213 213
 			'type'    => 'text',
214 214
 		);
@@ -224,11 +224,11 @@  discard block
 block discarded – undo
224 224
 	 *
225 225
 	 * @return array
226 226
 	 */
227
-	public static function get_email_header_field( Give_Email_Notification $email, $form_id = null ) {
227
+	public static function get_email_header_field(Give_Email_Notification $email, $form_id = null) {
228 228
 		return array(
229
-			'id'      => self::get_prefix( $email, $form_id ) . 'email_header',
230
-			'name'    => esc_html__( 'Email Header', 'give' ),
231
-			'desc'    => esc_html__( 'Enter the email header that appears at the top of the email.', 'give' ),
229
+			'id'      => self::get_prefix($email, $form_id).'email_header',
230
+			'name'    => esc_html__('Email Header', 'give'),
231
+			'desc'    => esc_html__('Enter the email header that appears at the top of the email.', 'give'),
232 232
 			'default' => $email->config['default_email_header'],
233 233
 			'type'    => 'text',
234 234
 		);
@@ -245,28 +245,28 @@  discard block
 block discarded – undo
245 245
 	 *
246 246
 	 * @return array
247 247
 	 */
248
-	public static function get_email_message_field( Give_Email_Notification $email, $form_id = null ) {
249
-		$desc = esc_html__( 'Enter the email message.', 'give' );
248
+	public static function get_email_message_field(Give_Email_Notification $email, $form_id = null) {
249
+		$desc = esc_html__('Enter the email message.', 'give');
250 250
 
251
-		if ( $email_tag_list = $email->get_allowed_email_tags( true ) ) {
251
+		if ($email_tag_list = $email->get_allowed_email_tags(true)) {
252 252
 			$desc = sprintf(
253 253
 				'%1$s <br> %2$s: %3$s %4$s',
254
-				__( 'The email that is sent to users after completing a successful donation. HTML is accepted.', 'give' ),
255
-				__( 'Available template tags', 'give' ),
254
+				__('The email that is sent to users after completing a successful donation. HTML is accepted.', 'give'),
255
+				__('Available template tags', 'give'),
256 256
 				$email_tag_list,
257 257
 				sprintf(
258 258
 					'<br><a href="%1$s" target="_blank">%2$s</a> %3$s',
259
-					esc_url( 'http://docs.givewp.com/meta-email-tags' ),
260
-					__( 'See our documentation', 'give' ),
261
-					__( 'for examples of how to use custom meta email tags to output additional donor or donation information in your Give emails.', 'give' )
259
+					esc_url('http://docs.givewp.com/meta-email-tags'),
260
+					__('See our documentation', 'give'),
261
+					__('for examples of how to use custom meta email tags to output additional donor or donation information in your Give emails.', 'give')
262 262
 				)
263 263
 			);
264 264
 
265 265
 		}
266 266
 
267 267
 		return array(
268
-			'id'      => self::get_prefix( $email, $form_id ) . 'email_message',
269
-			'name'    => esc_html__( 'Email message', 'give' ),
268
+			'id'      => self::get_prefix($email, $form_id).'email_message',
269
+			'name'    => esc_html__('Email message', 'give'),
270 270
 			'desc'    => $desc,
271 271
 			'type'    => 'wysiwyg',
272 272
 			'default' => $email->config['default_email_message'],
@@ -284,15 +284,15 @@  discard block
 block discarded – undo
284 284
 	 *
285 285
 	 * @return array
286 286
 	 */
287
-	public static function get_email_content_type_field( Give_Email_Notification $email, $form_id = null ) {
287
+	public static function get_email_content_type_field(Give_Email_Notification $email, $form_id = null) {
288 288
 		return array(
289
-			'id'      => self::get_prefix( $email, $form_id ) . 'email_content_type',
290
-			'name'    => esc_html__( 'Email Content Type', 'give' ),
291
-			'desc'    => __( 'Choose email type.', 'give' ),
289
+			'id'      => self::get_prefix($email, $form_id).'email_content_type',
290
+			'name'    => esc_html__('Email Content Type', 'give'),
291
+			'desc'    => __('Choose email type.', 'give'),
292 292
 			'type'    => 'select',
293 293
 			'options' => array(
294
-				'text/html'  => Give_Email_Notification_Util::get_formatted_email_type( 'text/html' ),
295
-				'text/plain' => Give_Email_Notification_Util::get_formatted_email_type( 'text/plain' ),
294
+				'text/html'  => Give_Email_Notification_Util::get_formatted_email_type('text/html'),
295
+				'text/plain' => Give_Email_Notification_Util::get_formatted_email_type('text/plain'),
296 296
 			),
297 297
 			'default' => $email->config['content_type'],
298 298
 		);
@@ -312,29 +312,29 @@  discard block
 block discarded – undo
312 312
 	 *
313 313
 	 * @return array
314 314
 	 */
315
-	public static function get_recipient_setting_field( Give_Email_Notification $email, $form_id = null, $edit_recipient = true ) {
315
+	public static function get_recipient_setting_field(Give_Email_Notification $email, $form_id = null, $edit_recipient = true) {
316 316
 		$recipient = array(
317
-			'id'               => self::get_prefix( $email, $form_id ) . 'recipient',
318
-			'name'             => esc_html__( 'Email Recipients', 'give' ),
319
-			'desc'             => __( 'Enter the email address(es) that should receive a notification.', 'give' ),
317
+			'id'               => self::get_prefix($email, $form_id).'recipient',
318
+			'name'             => esc_html__('Email Recipients', 'give'),
319
+			'desc'             => __('Enter the email address(es) that should receive a notification.', 'give'),
320 320
 			'type'             => 'email',
321
-			'default'          => get_bloginfo( 'admin_email' ),
321
+			'default'          => get_bloginfo('admin_email'),
322 322
 			'repeat'           => true,
323
-			'repeat_btn_title' => esc_html__( 'Add Recipient', 'give' ),
323
+			'repeat_btn_title' => esc_html__('Add Recipient', 'give'),
324 324
 		);
325 325
 
326
-		if ( $form_id || give_is_add_new_form_page() ) {
327
-			$recipient['name']    = __( 'Email', 'give' );
326
+		if ($form_id || give_is_add_new_form_page()) {
327
+			$recipient['name']    = __('Email', 'give');
328 328
 			$recipient['default'] = '';
329 329
 			$recipient['id']      = 'email';
330
-			$recipient['desc']    = __( 'Enter the email address that should receive a notification.', 'give' );
330
+			$recipient['desc']    = __('Enter the email address that should receive a notification.', 'give');
331 331
 
332 332
 			$recipient = array(
333
-				'id'      => self::get_prefix( $email, $form_id ) . 'recipient',
333
+				'id'      => self::get_prefix($email, $form_id).'recipient',
334 334
 				'type'    => 'group',
335 335
 				'options' => array(
336
-					'add_button'    => __( 'Add Email', 'give' ),
337
-					'header_title'  => __( 'Email Recipient', 'give' ),
336
+					'add_button'    => __('Add Email', 'give'),
337
+					'header_title'  => __('Email Recipient', 'give'),
338 338
 					'remove_button' => '<span class="dashicons dashicons-no"></span>',
339 339
 				),
340 340
 				'fields'  => array(
@@ -345,16 +345,16 @@  discard block
 block discarded – undo
345 345
 
346 346
 		// Disable field if email donor has recipient field.
347 347
 		// @see https://github.com/WordImpress/Give/issues/2657
348
-		if ( ! $edit_recipient ) {
349
-			if ( 'group' == $recipient['type'] ) {
350
-				$recipient         = current( $recipient['fields'] );
348
+		if ( ! $edit_recipient) {
349
+			if ('group' == $recipient['type']) {
350
+				$recipient         = current($recipient['fields']);
351 351
 				$recipient['type'] = 'text';
352 352
 			}
353 353
 
354 354
 			$recipient['attributes']['disabled'] = 'disabled';
355 355
 			$recipient['value']                  = $recipient['default'] = '{donor_email}';
356 356
 			$recipient['repeat']                 = false;
357
-			$recipient['desc']                   = __( 'This email is automatically sent to the donor and the recipient cannot be customized.', 'give' );
357
+			$recipient['desc']                   = __('This email is automatically sent to the donor and the recipient cannot be customized.', 'give');
358 358
 		}
359 359
 
360 360
 		return $recipient;
@@ -371,12 +371,12 @@  discard block
 block discarded – undo
371 371
 	 *
372 372
 	 * @return array
373 373
 	 */
374
-	public static function get_preview_setting_field( Give_Email_Notification $email, $form_id = null ) {
374
+	public static function get_preview_setting_field(Give_Email_Notification $email, $form_id = null) {
375 375
 		return array(
376
-			'name' => __( 'Preview Email', 'give' ),
377
-			'desc' => __( 'Click the "Preview Email" button to preview the email in your browser. Click the "Send Test Email" button to send a test email directly to your inbox.',
378
-				'give' ),
379
-			'id'   => self::get_prefix( $email, $form_id ) . 'preview_buttons',
376
+			'name' => __('Preview Email', 'give'),
377
+			'desc' => __('Click the "Preview Email" button to preview the email in your browser. Click the "Send Test Email" button to send a test email directly to your inbox.',
378
+				'give'),
379
+			'id'   => self::get_prefix($email, $form_id).'preview_buttons',
380 380
 			'type' => 'email_preview_buttons',
381 381
 		);
382 382
 	}
@@ -393,10 +393,10 @@  discard block
 block discarded – undo
393 393
 	 *
394 394
 	 * @return string
395 395
 	 */
396
-	public static function get_prefix( Give_Email_Notification $email, $form_id = null ) {
396
+	public static function get_prefix(Give_Email_Notification $email, $form_id = null) {
397 397
 		$meta_key = "{$email->config['id']}_";
398 398
 
399
-		if ( $form_id || give_is_add_new_form_page() ) {
399
+		if ($form_id || give_is_add_new_form_page()) {
400 400
 			$meta_key = "_give_{$email->config['id']}_";
401 401
 		}
402 402
 
Please login to merge, or discard this patch.
templates/shortcode-profile-editor.php 1 patch
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -10,25 +10,25 @@  discard block
 block discarded – undo
10 10
 
11 11
 $current_user = wp_get_current_user();
12 12
 
13
-if ( is_user_logged_in() ) :
13
+if (is_user_logged_in()) :
14 14
 	$user_id = get_current_user_id();
15
-	$first_name   = get_user_meta( $user_id, 'first_name', true );
16
-	$last_name    = get_user_meta( $user_id, 'last_name', true );
17
-	$last_name    = get_user_meta( $user_id, 'last_name', true );
15
+	$first_name   = get_user_meta($user_id, 'first_name', true);
16
+	$last_name    = get_user_meta($user_id, 'last_name', true);
17
+	$last_name    = get_user_meta($user_id, 'last_name', true);
18 18
 	$display_name = $current_user->display_name;
19
-	$donor        = new Give_Donor( $user_id, true );
20
-	$address      = $donor->get_donor_address( array( 'address_type' => 'personal' ) );
21
-	$company_name = $donor->get_meta( '_give_donor_company', true );
22
-
23
-	if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] && ! give_get_errors() ) {
24
-		if ( isset( $_GET['update_code'] ) ) {
25
-			if ( 1 === absint( $_GET['update_code'] ) ) {
26
-				printf( '<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__( 'Success:', 'give' ), esc_html__( 'Your profile has been updated.', 'give' ) );
19
+	$donor        = new Give_Donor($user_id, true);
20
+	$address      = $donor->get_donor_address(array('address_type' => 'personal'));
21
+	$company_name = $donor->get_meta('_give_donor_company', true);
22
+
23
+	if (isset($_GET['updated']) && 'true' === $_GET['updated'] && ! give_get_errors()) {
24
+		if (isset($_GET['update_code'])) {
25
+			if (1 === absint($_GET['update_code'])) {
26
+				printf('<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__('Success:', 'give'), esc_html__('Your profile has been updated.', 'give'));
27 27
 			}
28 28
 		}
29 29
 	}
30 30
 
31
-	Give()->notices->render_frontend_notices( 0 );
31
+	Give()->notices->render_frontend_notices(0);
32 32
 
33 33
 	/**
34 34
 	 * Fires in the profile editor shortcode, before the form.
@@ -37,57 +37,57 @@  discard block
 block discarded – undo
37 37
 	 *
38 38
 	 * @since 1.0
39 39
 	 */
40
-	do_action( 'give_profile_editor_before' );
40
+	do_action('give_profile_editor_before');
41 41
 	?>
42 42
 
43 43
 	<form id="give_profile_editor_form" class="give-form" action="<?php echo give_get_current_page_url(); ?>" method="post">
44 44
 		<fieldset>
45
-			<legend id="give_profile_name_label"><?php _e( 'Profile', 'give' ); ?></legend>
45
+			<legend id="give_profile_name_label"><?php _e('Profile', 'give'); ?></legend>
46 46
 
47 47
 			<h3 id="give_personal_information_label"
48
-			    class="give-section-break"><?php _e( 'Change your Name', 'give' ); ?></h3>
48
+			    class="give-section-break"><?php _e('Change your Name', 'give'); ?></h3>
49 49
 
50 50
 			<p id="give_profile_first_name_wrap" class="form-row form-row-first form-row-responsive">
51 51
 				<label for="give_first_name">
52
-					<?php _e( 'First Name', 'give' ); ?>
52
+					<?php _e('First Name', 'give'); ?>
53 53
 					<span class="give-required-indicator  ">*</span>
54 54
 				</label>
55 55
 				<input name="give_first_name" id="give_first_name" class="text give-input" type="text"
56
-				       value="<?php echo esc_attr( $first_name ); ?>"/>
56
+				       value="<?php echo esc_attr($first_name); ?>"/>
57 57
 			</p>
58 58
 
59 59
 			<p id="give_profile_last_name_wrap" class="form-row form-row-last form-row-responsive">
60
-				<label for="give_last_name"><?php _e( 'Last Name', 'give' ); ?></label>
60
+				<label for="give_last_name"><?php _e('Last Name', 'give'); ?></label>
61 61
 				<input name="give_last_name" id="give_last_name" class="text give-input" type="text"
62
-				       value="<?php echo esc_attr( $last_name ); ?>"/>
62
+				       value="<?php echo esc_attr($last_name); ?>"/>
63 63
 			</p>
64 64
 
65
-			<?php if ( ! empty( $company_name ) ) : ?>
65
+			<?php if ( ! empty($company_name)) : ?>
66 66
 				<p id="give_profile_company_name_wrap" class="form-row form-row-wide">
67
-					<label for="give_company_name"><?php _e( 'Company Name', 'give' ); ?></label>
67
+					<label for="give_company_name"><?php _e('Company Name', 'give'); ?></label>
68 68
 					<input name="give_company_name" id="give_company_name" class="text give-input" type="text"
69
-					       value="<?php echo esc_attr( $company_name ); ?>"/>
69
+					       value="<?php echo esc_attr($company_name); ?>"/>
70 70
 				</p>
71 71
 			<?php endif; ?>
72 72
 
73 73
 			<p id="give_profile_display_name_wrap" class="form-row form-row-first form-row-responsive">
74
-				<label for="give_display_name"><?php _e( 'Display Name', 'give' ); ?></label>
74
+				<label for="give_display_name"><?php _e('Display Name', 'give'); ?></label>
75 75
 				<select name="give_display_name" id="give_display_name" class="select give-select">
76
-					<?php if ( ! empty( $current_user->first_name ) ): ?>
77
-						<option <?php selected( $display_name, $current_user->first_name ); ?>
78
-							value="<?php echo esc_attr( $current_user->first_name ); ?>"><?php echo esc_html( $current_user->first_name ); ?></option>
76
+					<?php if ( ! empty($current_user->first_name)): ?>
77
+						<option <?php selected($display_name, $current_user->first_name); ?>
78
+							value="<?php echo esc_attr($current_user->first_name); ?>"><?php echo esc_html($current_user->first_name); ?></option>
79 79
 					<?php endif; ?>
80
-					<option <?php selected( $display_name, $current_user->user_nicename ); ?>
81
-						value="<?php echo esc_attr( $current_user->user_nicename ); ?>"><?php echo esc_html( $current_user->user_nicename ); ?></option>
82
-					<?php if ( ! empty( $current_user->last_name ) ): ?>
83
-						<option <?php selected( $display_name, $current_user->last_name ); ?>
84
-							value="<?php echo esc_attr( $current_user->last_name ); ?>"><?php echo esc_html( $current_user->last_name ); ?></option>
80
+					<option <?php selected($display_name, $current_user->user_nicename); ?>
81
+						value="<?php echo esc_attr($current_user->user_nicename); ?>"><?php echo esc_html($current_user->user_nicename); ?></option>
82
+					<?php if ( ! empty($current_user->last_name)): ?>
83
+						<option <?php selected($display_name, $current_user->last_name); ?>
84
+							value="<?php echo esc_attr($current_user->last_name); ?>"><?php echo esc_html($current_user->last_name); ?></option>
85 85
 					<?php endif; ?>
86
-					<?php if ( ! empty( $current_user->first_name ) && ! empty( $current_user->last_name ) ): ?>
87
-						<option <?php selected( $display_name, $current_user->first_name . ' ' . $current_user->last_name ); ?>
88
-							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>
89
-						<option <?php selected( $display_name, $current_user->last_name . ' ' . $current_user->first_name ); ?>
90
-							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>
86
+					<?php if ( ! empty($current_user->first_name) && ! empty($current_user->last_name)): ?>
87
+						<option <?php selected($display_name, $current_user->first_name.' '.$current_user->last_name); ?>
88
+							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>
89
+						<option <?php selected($display_name, $current_user->last_name.' '.$current_user->first_name); ?>
90
+							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>
91 91
 					<?php endif; ?>
92 92
 				</select>
93 93
 				<?php
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 				 *
99 99
 				 * @since 1.0
100 100
 				 */
101
-				do_action( 'give_profile_editor_name' );
101
+				do_action('give_profile_editor_name');
102 102
 				?>
103 103
 			</p>
104 104
 
@@ -110,16 +110,16 @@  discard block
 block discarded – undo
110 110
 			 *
111 111
 			 * @since 1.0
112 112
 			 */
113
-			do_action( 'give_profile_editor_after_name' );
113
+			do_action('give_profile_editor_after_name');
114 114
 			?>
115 115
 
116 116
 			<p class="form-row form-row-last form-row-responsive">
117 117
 				<label for="give_email">
118
-					<?php _e( 'Email Address', 'give' ); ?>
118
+					<?php _e('Email Address', 'give'); ?>
119 119
 					<span class="give-required-indicator  ">*</span>
120 120
 				</label>
121 121
 				<input name="give_email" id="give_email" class="text give-input required" type="email"
122
-				       value="<?php echo esc_attr( $current_user->user_email ); ?>" required aria-required="true"/>
122
+				       value="<?php echo esc_attr($current_user->user_email); ?>" required aria-required="true"/>
123 123
 				<?php
124 124
 				/**
125 125
 				 * Fires in the profile editor shortcode, to the email section.
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 				 *
129 129
 				 * @since 1.0
130 130
 				 */
131
-				do_action( 'give_profile_editor_email' );
131
+				do_action('give_profile_editor_email');
132 132
 				?>
133 133
 			</p>
134 134
 
@@ -140,21 +140,21 @@  discard block
 block discarded – undo
140 140
 			 *
141 141
 			 * @since 1.0
142 142
 			 */
143
-			do_action( 'give_profile_editor_after_email' );
143
+			do_action('give_profile_editor_after_email');
144 144
 			?>
145 145
 
146 146
 			<h3 id="give_profile_password_label"
147
-			    class="give-section-break"><?php _e( 'Change your Password', 'give' ); ?></h3>
147
+			    class="give-section-break"><?php _e('Change your Password', 'give'); ?></h3>
148 148
 
149 149
 			<div id="give_profile_password_wrap" class="give-clearfix">
150 150
 				<p id="give_profile_password_wrap_1" class="form-row form-row-first form-row-responsive">
151
-					<label for="give_new_user_pass1"><?php _e( 'New Password', 'give' ); ?></label>
151
+					<label for="give_new_user_pass1"><?php _e('New Password', 'give'); ?></label>
152 152
 					<input name="give_new_user_pass1" id="give_new_user_pass1" class="password give-input"
153 153
 					       type="password"/>
154 154
 				</p>
155 155
 
156 156
 				<p id="give_profile_password_wrap_2" class="form-row form-row-last form-row-responsive">
157
-					<label for="give_new_user_pass2"><?php _e( 'Re-enter Password', 'give' ); ?></label>
157
+					<label for="give_new_user_pass2"><?php _e('Re-enter Password', 'give'); ?></label>
158 158
 					<input name="give_new_user_pass2" id="give_new_user_pass2" class="password give-input"
159 159
 					       type="password"/>
160 160
 					<?php
@@ -165,12 +165,12 @@  discard block
 block discarded – undo
165 165
 					 *
166 166
 					 * @since 1.0
167 167
 					 */
168
-					do_action( 'give_profile_editor_password' );
168
+					do_action('give_profile_editor_password');
169 169
 					?>
170 170
 				</p>
171 171
 			</div>
172 172
 
173
-			<p class="give_password_change_notice"><?php _e( 'Please note after changing your password, you must log back in.', 'give' ); ?></p>
173
+			<p class="give_password_change_notice"><?php _e('Please note after changing your password, you must log back in.', 'give'); ?></p>
174 174
 
175 175
 			<?php
176 176
 			/**
@@ -180,17 +180,17 @@  discard block
 block discarded – undo
180 180
 			 *
181 181
 			 * @since 1.0
182 182
 			 */
183
-			do_action( 'give_profile_editor_after_password' );
183
+			do_action('give_profile_editor_after_password');
184 184
 			?>
185 185
 
186 186
 			<p id="give_profile_submit_wrap">
187 187
 				<input type="hidden" name="give_profile_editor_nonce"
188
-				       value="<?php echo wp_create_nonce( 'give-profile-editor-nonce' ); ?>"/>
188
+				       value="<?php echo wp_create_nonce('give-profile-editor-nonce'); ?>"/>
189 189
 				<input type="hidden" name="give_action" value="edit_user_profile"/>
190 190
 				<input type="hidden" name="give_redirect"
191
-				       value="<?php echo esc_url( give_get_current_page_url() ); ?>"/>
191
+				       value="<?php echo esc_url(give_get_current_page_url()); ?>"/>
192 192
 				<input name="give_profile_editor_submit" id="give_profile_editor_submit" type="submit"
193
-				       class="give_submit" value="<?php _e( 'Save Changes', 'give' ); ?>"/>
193
+				       class="give_submit" value="<?php _e('Save Changes', 'give'); ?>"/>
194 194
 			</p>
195 195
 
196 196
 		</fieldset>
@@ -205,23 +205,23 @@  discard block
 block discarded – undo
205 205
 	 *
206 206
 	 * @since 1.0
207 207
 	 */
208
-	do_action( 'give_profile_editor_after' );
208
+	do_action('give_profile_editor_after');
209 209
 	?>
210 210
 
211 211
 <?php
212 212
 else :
213
-	if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] && ! give_get_errors() ) {
214
-		if ( isset( $_GET['update_code'] ) ) {
215
-			switch ( $_GET['update_code'] ) {
213
+	if (isset($_GET['updated']) && 'true' === $_GET['updated'] && ! give_get_errors()) {
214
+		if (isset($_GET['update_code'])) {
215
+			switch ($_GET['update_code']) {
216 216
 				case '2':
217
-					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' ) );
218
-					_e( 'Login with your new credentials.', 'give' );
217
+					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'));
218
+					_e('Login with your new credentials.', 'give');
219 219
 					echo give_login_form();
220 220
 					break;
221 221
 
222 222
 				case '3':
223
-					printf( '<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__( 'Success:', 'give' ), esc_html__( 'Your password has been updated.', 'give' ) );
224
-					_e( 'Login with your new credentials.', 'give' );
223
+					printf('<p class="give_success"><strong>%1$s</strong> %2$s</p>', esc_html__('Success:', 'give'), esc_html__('Your password has been updated.', 'give'));
224
+					_e('Login with your new credentials.', 'give');
225 225
 					echo give_login_form();
226 226
 					break;
227 227
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 			}
231 231
 		}
232 232
 	} else {
233
-		_e( 'You need to login to edit your profile.', 'give' );
233
+		_e('You need to login to edit your profile.', 'give');
234 234
 		echo give_login_form();
235 235
 	}
236 236
 endif;
Please login to merge, or discard this patch.
templates/history-donations.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -4,28 +4,28 @@  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
 
@@ -42,35 +42,35 @@  discard block
 block discarded – undo
42 42
 			$message = (string) apply_filters(
43 43
 				'give_email_access_requests_exceed_notice',
44 44
 				sprintf(
45
-					__( 'Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give' ),
46
-					sprintf( _n( '%s minute', '%s minutes', $value, 'give' ), $value )
45
+					__('Too many access email requests detected. Please wait %s before requesting a new donation history access link.', 'give'),
46
+					sprintf(_n('%s minute', '%s minutes', $value, 'give'), $value)
47 47
 				),
48 48
 				$value
49 49
 			);
50 50
 
51
-			give_set_error( 'give-limited-throttle',
51
+			give_set_error('give-limited-throttle',
52 52
 				$message
53 53
 			);
54 54
 		}
55 55
 
56
-		$donations = give_get_users_donations( $email, give_get_limit_display_donations(), true, 'any' );
56
+		$donations = give_get_users_donations($email, give_get_limit_display_donations(), true, 'any');
57 57
 	} else {
58
-		$donations = give_get_users_donations( $email, 20, true, 'any' );
58
+		$donations = give_get_users_donations($email, 20, true, 'any');
59 59
 	}
60 60
 }
61 61
 
62
-Give()->notices->render_frontend_notices( 0 );
62
+Give()->notices->render_frontend_notices(0);
63 63
 
64
-if ( $donations ) : ?>
64
+if ($donations) : ?>
65 65
 	<?php
66 66
 	$table_headings = array(
67
-		'id'             => __( 'ID', 'give' ),
68
-		'date'           => __( 'Date', 'give' ),
69
-		'donor'          => __( 'Donor', 'give' ),
70
-		'amount'         => __( 'Amount', 'give' ),
71
-		'status'         => __( 'Status', 'give' ),
72
-		'payment_method' => __( 'Payment Method', 'give' ),
73
-		'details'        => __( 'Details', 'give' ),
67
+		'id'             => __('ID', 'give'),
68
+		'date'           => __('Date', 'give'),
69
+		'donor'          => __('Donor', 'give'),
70
+		'amount'         => __('Amount', 'give'),
71
+		'status'         => __('Status', 'give'),
72
+		'payment_method' => __('Payment Method', 'give'),
73
+		'details'        => __('Details', 'give'),
74 74
 	);
75 75
 	?>
76 76
 	<div class="give_user_history_main" >
@@ -86,14 +86,14 @@  discard block
 block discarded – undo
86 86
 				 *
87 87
 				 * @since 1.7
88 88
 				 */
89
-				do_action( 'give_donation_history_header_before' );
89
+				do_action('give_donation_history_header_before');
90 90
 
91
-				foreach ( $donation_history_args as $index => $value ) {
92
-					if ( filter_var( $donation_history_args[ $index ], FILTER_VALIDATE_BOOLEAN ) ) :
91
+				foreach ($donation_history_args as $index => $value) {
92
+					if (filter_var($donation_history_args[$index], FILTER_VALIDATE_BOOLEAN)) :
93 93
 						echo sprintf(
94 94
 							'<th scope="col" class="give-donation-%1$s>">%2$s</th>',
95 95
 							$index,
96
-							$table_headings[ $index ]
96
+							$table_headings[$index]
97 97
 						);
98 98
 					endif;
99 99
 				}
@@ -105,13 +105,13 @@  discard block
 block discarded – undo
105 105
 				 *
106 106
 				 * @since 1.7
107 107
 				 */
108
-				do_action( 'give_donation_history_header_after' );
108
+				do_action('give_donation_history_header_after');
109 109
 				?>
110 110
 			</tr>
111 111
 			</thead>
112
-			<?php foreach ( $donations as $post ) :
113
-				setup_postdata( $post );
114
-				$donation_data = give_get_payment_meta( $post->ID ); ?>
112
+			<?php foreach ($donations as $post) :
113
+				setup_postdata($post);
114
+				$donation_data = give_get_payment_meta($post->ID); ?>
115 115
 				<tr class="give-donation-row">
116 116
 					<?php
117 117
 					/**
@@ -124,37 +124,37 @@  discard block
 block discarded – undo
124 124
 					 * @param int   $post_id       The ID of the post.
125 125
 					 * @param mixed $donation_data Payment meta data.
126 126
 					 */
127
-					do_action( 'give_donation_history_row_start', $post->ID, $donation_data );
127
+					do_action('give_donation_history_row_start', $post->ID, $donation_data);
128 128
 
129
-					if ( filter_var( $donation_history_args['id'], FILTER_VALIDATE_BOOLEAN ) ) :
129
+					if (filter_var($donation_history_args['id'], FILTER_VALIDATE_BOOLEAN)) :
130 130
 						echo sprintf(
131 131
 							'<td class="give-donation-id"><span class="title-for-mobile">%2$s</span>%1$s</td>',
132
-							give_get_payment_number( $post->ID ), esc_html( $table_headings['id'] )
132
+							give_get_payment_number($post->ID), esc_html($table_headings['id'])
133 133
 						);
134 134
 					endif;
135 135
 
136
-					if ( filter_var( $donation_history_args['date'], FILTER_VALIDATE_BOOLEAN ) ) :
136
+					if (filter_var($donation_history_args['date'], FILTER_VALIDATE_BOOLEAN)) :
137 137
 						echo sprintf(
138 138
 							'<td class="give-donation-date"><span class="title-for-mobile">%2$s</span>%1$s</td>',
139
-							date_i18n( give_date_format(), strtotime( get_post_field( 'post_date', $post->ID ) ) ), esc_html( $table_headings['date'] )
139
+							date_i18n(give_date_format(), strtotime(get_post_field('post_date', $post->ID))), esc_html($table_headings['date'])
140 140
 						);
141 141
 					endif;
142 142
 
143
-					if ( filter_var( $donation_history_args['donor'], FILTER_VALIDATE_BOOLEAN ) ) :
143
+					if (filter_var($donation_history_args['donor'], FILTER_VALIDATE_BOOLEAN)) :
144 144
 						echo sprintf(
145 145
 							'<td class="give-donation-donor"><span class="title-for-mobile">%2$s</span>%1$s</td>',
146
-							give_get_donor_name_by( $post->ID ), $table_headings['donor']
146
+							give_get_donor_name_by($post->ID), $table_headings['donor']
147 147
 						);
148 148
 					endif;
149 149
 					?>
150 150
 
151
-					<?php if ( filter_var( $donation_history_args['amount'], FILTER_VALIDATE_BOOLEAN ) ) : ?>
151
+					<?php if (filter_var($donation_history_args['amount'], FILTER_VALIDATE_BOOLEAN)) : ?>
152 152
 						<td class="give-donation-amount">
153
-						<?php printf( '<span class="title-for-mobile">%1$s</span>', esc_html( $table_headings['amount'] ) ); ?>
153
+						<?php printf('<span class="title-for-mobile">%1$s</span>', esc_html($table_headings['amount'])); ?>
154 154
 						<span class="give-donation-amount">
155 155
 							<?php
156
-							$currency_code   = give_get_payment_currency_code( $post->ID );
157
-							$donation_amount = give_donation_amount( $post->ID, true );
156
+							$currency_code   = give_get_payment_currency_code($post->ID);
157
+							$donation_amount = give_donation_amount($post->ID, true);
158 158
 
159 159
 							/**
160 160
 							 * Filters the donation amount on Donation History Page.
@@ -166,45 +166,45 @@  discard block
 block discarded – undo
166 166
 							 *
167 167
 							 * @return int
168 168
 							 */
169
-							echo apply_filters( 'give_donation_history_row_amount', $donation_amount, $post->ID );
169
+							echo apply_filters('give_donation_history_row_amount', $donation_amount, $post->ID);
170 170
 							?>
171 171
 						</span>
172 172
 						</td>
173 173
 					<?php endif; ?>
174 174
 
175 175
 					<?php
176
-					if ( filter_var( $donation_history_args['status'], FILTER_VALIDATE_BOOLEAN ) ) :
176
+					if (filter_var($donation_history_args['status'], FILTER_VALIDATE_BOOLEAN)) :
177 177
 						echo sprintf(
178 178
 							'<td class="give-donation-status"><span class="title-for-mobile">%2$s</span>%1$s</td>',
179
-							give_get_payment_status( $post, true ),
180
-							esc_html( $table_headings['status'] )
179
+							give_get_payment_status($post, true),
180
+							esc_html($table_headings['status'])
181 181
 						);
182 182
 					endif;
183 183
 
184
-					if ( filter_var( $donation_history_args['payment_method'], FILTER_VALIDATE_BOOLEAN ) ) :
184
+					if (filter_var($donation_history_args['payment_method'], FILTER_VALIDATE_BOOLEAN)) :
185 185
 						echo sprintf(
186 186
 							'<td class="give-donation-payment-method"><span class="title-for-mobile">%2$s</span>%1$s</td>',
187
-							give_get_gateway_checkout_label( give_get_payment_gateway( $post->ID ) ),
188
-							esc_html( $table_headings['payment_method'] )
187
+							give_get_gateway_checkout_label(give_get_payment_gateway($post->ID)),
188
+							esc_html($table_headings['payment_method'])
189 189
 						);
190 190
 					endif;
191 191
 					?>
192 192
 					<td class="give-donation-details">
193 193
 						<?php
194 194
 						// Display View Receipt or.
195
-						if ( 'publish' !== $post->post_status && 'subscription' !== $post->post_status ) :
195
+						if ('publish' !== $post->post_status && 'subscription' !== $post->post_status) :
196 196
 							echo sprintf(
197 197
 								'<span class="title-for-mobile">%4$s</span><a href="%1$s"><span class="give-donation-status %2$s">%3$s</span></a>',
198 198
 								esc_url(
199 199
 									add_query_arg(
200 200
 										'payment_key',
201
-										give_get_payment_key( $post->ID ),
201
+										give_get_payment_key($post->ID),
202 202
 										give_get_history_page_uri()
203 203
 									)
204 204
 								),
205 205
 								$post->post_status,
206
-								__( 'View', 'give' ) . ' ' . give_get_payment_status( $post, true ) . ' &raquo;',
207
-								esc_html( $table_headings['details'] )
206
+								__('View', 'give').' '.give_get_payment_status($post, true).' &raquo;',
207
+								esc_html($table_headings['details'])
208 208
 							);
209 209
 
210 210
 						else :
@@ -213,12 +213,12 @@  discard block
 block discarded – undo
213 213
 								esc_url(
214 214
 									add_query_arg(
215 215
 										'payment_key',
216
-										give_get_payment_key( $post->ID ),
216
+										give_get_payment_key($post->ID),
217 217
 										give_get_history_page_uri()
218 218
 									)
219 219
 								),
220
-								__( 'View Receipt &raquo;', 'give' ),
221
-								esc_html( $table_headings['details'] )
220
+								__('View Receipt &raquo;', 'give'),
221
+								esc_html($table_headings['details'])
222 222
 							);
223 223
 
224 224
 						endif;
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 					 * @param int   $post_id       The ID of the post.
236 236
 					 * @param mixed $donation_data Payment meta data.
237 237
 					 */
238
-					do_action( 'give_donation_history_row_end', $post->ID, $donation_data );
238
+					do_action('give_donation_history_row_end', $post->ID, $donation_data);
239 239
 					?>
240 240
 				</tr>
241 241
 			<?php endforeach; ?>
@@ -248,22 +248,22 @@  discard block
 block discarded – undo
248 248
 			 *
249 249
 			 * @since 1.8.17
250 250
 			 */
251
-			do_action( 'give_donation_history_table_end' );
251
+			do_action('give_donation_history_table_end');
252 252
 			?>
253 253
 		</table>
254 254
 		<div id="give-donation-history-pagination" class="give_pagination navigation">
255 255
 			<?php
256 256
 			$big = 999999;
257
-			echo paginate_links( array(
258
-				'base'    => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
257
+			echo paginate_links(array(
258
+				'base'    => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
259 259
 				'format'  => '?paged=%#%',
260
-				'current' => max( 1, get_query_var( 'paged' ) ),
261
-				'total'   => ceil( give_count_donations_of_donor() / 20 ), // 20 items per page
262
-			) );
260
+				'current' => max(1, get_query_var('paged')),
261
+				'total'   => ceil(give_count_donations_of_donor() / 20), // 20 items per page
262
+			));
263 263
 			?>
264 264
 		</div>
265 265
 	</div>
266 266
 	<?php wp_reset_postdata(); ?>
267 267
 <?php else : ?>
268
-	<?php Give()->notices->print_frontend_notice( __( 'It looks like you haven\'t made any donations.', 'give' ), true, 'success' ); ?>
268
+	<?php Give()->notices->print_frontend_notice(__('It looks like you haven\'t made any donations.', 'give'), true, 'success'); ?>
269 269
 <?php endif;
Please login to merge, or discard this patch.