Test Failed
Push — master ( 25adfe...70178c )
by Devin
01:46
created
includes/admin/settings/class-settings-license.php 1 patch
Spacing   +11 added lines, -11 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_License' ) ) :
16
+if ( ! class_exists('Give_Settings_License')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_License.
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
 		 */
44 44
 		public function __construct() {
45 45
 			$this->id    = 'licenses';
46
-			$this->label = esc_html__( 'Licenses', 'give' );
46
+			$this->label = esc_html__('Licenses', 'give');
47 47
 
48
-			add_filter( 'give-settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
49
-			add_action( "give-settings_settings_{$this->id}_page", array( $this, 'output' ) );
48
+			add_filter('give-settings_tabs_array', array($this, 'add_settings_page'), 20);
49
+			add_action("give-settings_settings_{$this->id}_page", array($this, 'output'));
50 50
 		}
51 51
 
52 52
 		/**
@@ -56,11 +56,11 @@  discard block
 block discarded – undo
56 56
 		 * @param  array $pages Lst of pages.
57 57
 		 * @return array
58 58
 		 */
59
-		public function add_settings_page( $pages ) {
59
+		public function add_settings_page($pages) {
60 60
 			$setting = $this->get_settings();
61 61
 			// Bailout: Do not add licenses setting tab if it does not contain any setting fields.
62
-			if( ! empty( $setting ) ) {
63
-				$pages[ $this->id ] = $this->label;
62
+			if ( ! empty($setting)) {
63
+				$pages[$this->id] = $this->label;
64 64
 			}
65 65
 
66 66
 			return $pages;
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 			 * Filter the licenses settings.
80 80
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
81 81
 			 */
82
-			$settings = apply_filters( 'give_settings_licenses', $settings );
82
+			$settings = apply_filters('give_settings_licenses', $settings);
83 83
 
84 84
 			/**
85 85
 			 * Filter the settings.
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 			 * @since  1.8
88 88
 			 * @param  array $settings
89 89
 			 */
90
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
90
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
91 91
 
92 92
 			// Output.
93 93
 			return $settings;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 		public function output() {
103 103
 			$settings = $this->get_settings();
104 104
 
105
-			Give_Admin_Settings::output_fields( $settings, 'give_settings' );
105
+			Give_Admin_Settings::output_fields($settings, 'give_settings');
106 106
 		}
107 107
 	}
108 108
 
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-addon.php 1 patch
Spacing   +11 added lines, -11 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_Addon' ) ) :
16
+if ( ! class_exists('Give_Settings_Addon')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Addon.
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 		 */
27 27
 		public function __construct() {
28 28
 			$this->id    = 'addons';
29
-			$this->label = esc_html__( 'Add-ons', 'give' );
29
+			$this->label = esc_html__('Add-ons', 'give');
30 30
 
31 31
 			parent::__construct();
32 32
 		}
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
 		 * @param  $setting_tab
39 39
 		 * @return string
40 40
 		 */
41
-		function set_default_setting_tab( $setting_tab ) {
41
+		function set_default_setting_tab($setting_tab) {
42 42
 			$default_tab = '';
43 43
 
44 44
 			// Set default tab to first setting tab.
45
-			if( $sections = array_keys( $this->get_sections() ) ) {
46
-				$default_tab = current( $sections );
45
+			if ($sections = array_keys($this->get_sections())) {
46
+				$default_tab = current($sections);
47 47
 			}
48 48
 			return $default_tab;
49 49
 		}
@@ -55,11 +55,11 @@  discard block
 block discarded – undo
55 55
 		 * @param  array $pages Lst of pages.
56 56
 		 * @return array
57 57
 		 */
58
-		public function add_settings_page( $pages ) {
58
+		public function add_settings_page($pages) {
59 59
 			$setting = $this->get_settings();
60 60
 			// Bailout: Do not add addons setting tab if it does not contain any setting fields.
61
-			if( ! empty( $setting ) ) {
62
-				$pages[ $this->id ] = $this->label;
61
+			if ( ! empty($setting)) {
62
+				$pages[$this->id] = $this->label;
63 63
 			}
64 64
 
65 65
 			return $pages;
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 			 * Filter the addons settings.
79 79
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
80 80
 			 */
81
-			$settings = apply_filters( 'give_settings_addons', $settings );
81
+			$settings = apply_filters('give_settings_addons', $settings);
82 82
 
83 83
 			/**
84 84
 			 * Filter the settings.
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 			 * @since  1.8
87 87
 			 * @param  array $settings
88 88
 			 */
89
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
89
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
90 90
 
91 91
 			// Output.
92 92
 			return $settings;
Please login to merge, or discard this patch.
includes/admin/forms/metabox.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -22,19 +22,19 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function give_add_shortcode_to_publish_metabox() {
24 24
 
25
-	if ( 'give_forms' !== get_post_type() ) {
25
+	if ('give_forms' !== get_post_type()) {
26 26
 		return false;
27 27
 	}
28 28
 	global $post;
29 29
 
30 30
 	//Only enqueue scripts for CPT on post type screen
31
-	if ( 'give_forms' === $post->post_type ) {
31
+	if ('give_forms' === $post->post_type) {
32 32
 		//Shortcode column with select all input
33
-		$shortcode = htmlentities( '[give_form id="' . $post->ID . '"]' );
34
-		echo '<div class="shortcode-wrap box-sizing"><label for="shortcode-input">' . esc_html__( 'Give Form Shortcode:', 'give' ) . '</label><input onClick="this.setSelectionRange(0, this.value.length)" type="text" name="shortcode-input" id="shortcode-input" class="shortcode-input" readonly value="' . $shortcode . '"></div>';
33
+		$shortcode = htmlentities('[give_form id="'.$post->ID.'"]');
34
+		echo '<div class="shortcode-wrap box-sizing"><label for="shortcode-input">'.esc_html__('Give Form Shortcode:', 'give').'</label><input onClick="this.setSelectionRange(0, this.value.length)" type="text" name="shortcode-input" id="shortcode-input" class="shortcode-input" readonly value="'.$shortcode.'"></div>';
35 35
 
36 36
 	}
37 37
 
38 38
 }
39 39
 
40
-add_action( 'post_submitbox_misc_actions', 'give_add_shortcode_to_publish_metabox' );
40
+add_action('post_submitbox_misc_actions', 'give_add_shortcode_to_publish_metabox');
Please login to merge, or discard this patch.
includes/admin/admin-footer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -24,14 +24,14 @@  discard block
 block discarded – undo
24 24
  *
25 25
  * @return      string
26 26
  */
27
-function give_admin_rate_us( $footer_text ) {
27
+function give_admin_rate_us($footer_text) {
28 28
 	global $typenow;
29 29
 
30
-	if ( $typenow == 'give_forms' ) {
30
+	if ($typenow == 'give_forms') {
31 31
 		$rate_text = sprintf(
32 32
 			/* translators: %s: Link to 5 star rating */
33
-			__( 'If you like <strong>Give</strong> please leave us a %s rating. It takes a minute and helps a lot. Thanks in advance!', 'give' ),
34
-			'<a href="https://wordpress.org/support/view/plugin-reviews/give?filter=5#postform" target="_blank" class="give-rating-link" style="text-decoration:none;" data-rated="' . esc_attr__( 'Thanks :)', 'give' ) . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
33
+			__('If you like <strong>Give</strong> please leave us a %s rating. It takes a minute and helps a lot. Thanks in advance!', 'give'),
34
+			'<a href="https://wordpress.org/support/view/plugin-reviews/give?filter=5#postform" target="_blank" class="give-rating-link" style="text-decoration:none;" data-rated="'.esc_attr__('Thanks :)', 'give').'">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
35 35
 		);
36 36
 
37 37
 		return $rate_text;
@@ -40,4 +40,4 @@  discard block
 block discarded – undo
40 40
 	}
41 41
 }
42 42
 
43
-add_filter( 'admin_footer_text', 'give_admin_rate_us' );
43
+add_filter('admin_footer_text', 'give_admin_rate_us');
Please login to merge, or discard this patch.
includes/admin/admin-actions.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
  *
99 99
  * @since 1.8
100 100
  *
101
- * @return bool
101
+ * @return false|null
102 102
  */
103 103
 function give_redirect_to_clean_url_admin_pages() {
104 104
 	// Give admin pages.
Please login to merge, or discard this patch.
Spacing   +153 added lines, -154 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -20,19 +20,19 @@  discard block
 block discarded – undo
20 20
  * @since 1.8
21 21
  */
22 22
 function give_load_wp_editor() {
23
-	if ( ! isset( $_POST['wp_editor'] ) ) {
23
+	if ( ! isset($_POST['wp_editor'])) {
24 24
 		die();
25 25
 	}
26 26
 
27
-	$wp_editor                     = json_decode( base64_decode( $_POST['wp_editor'] ), true );
27
+	$wp_editor                     = json_decode(base64_decode($_POST['wp_editor']), true);
28 28
 	$wp_editor[2]['textarea_name'] = $_POST['textarea_name'];
29 29
 
30
-	wp_editor( $wp_editor[0], $_POST['wp_editor_id'], $wp_editor[2] );
30
+	wp_editor($wp_editor[0], $_POST['wp_editor_id'], $wp_editor[2]);
31 31
 
32 32
 	die();
33 33
 }
34 34
 
35
-add_action( 'wp_ajax_give_load_wp_editor', 'give_load_wp_editor' );
35
+add_action('wp_ajax_give_load_wp_editor', 'give_load_wp_editor');
36 36
 
37 37
 
38 38
 /**
@@ -52,13 +52,13 @@  discard block
 block discarded – undo
52 52
 	);
53 53
 
54 54
 	// Get current page.
55
-	$current_page = isset( $_GET['page'] ) ? esc_attr( $_GET['page'] ) : '';
55
+	$current_page = isset($_GET['page']) ? esc_attr($_GET['page']) : '';
56 56
 
57 57
 	// Bailout.
58 58
 	if (
59
-		empty( $current_page )
60
-		|| empty( $_GET['_wp_http_referer'] )
61
-		|| ! in_array( $current_page, $give_pages )
59
+		empty($current_page)
60
+		|| empty($_GET['_wp_http_referer'])
61
+		|| ! in_array($current_page, $give_pages)
62 62
 	) {
63 63
 		return false;
64 64
 	}
@@ -68,21 +68,21 @@  discard block
 block discarded – undo
68 68
 	 *
69 69
 	 * @since 1.8
70 70
 	 */
71
-	$redirect = apply_filters( "give_validate_{$current_page}", true );
71
+	$redirect = apply_filters("give_validate_{$current_page}", true);
72 72
 
73
-	if ( $redirect ) {
73
+	if ($redirect) {
74 74
 		// Redirect.
75 75
 		wp_redirect(
76 76
 			remove_query_arg(
77
-				array( '_wp_http_referer', '_wpnonce' ),
78
-				wp_unslash( $_SERVER['REQUEST_URI'] )
77
+				array('_wp_http_referer', '_wpnonce'),
78
+				wp_unslash($_SERVER['REQUEST_URI'])
79 79
 			)
80 80
 		);
81 81
 		exit;
82 82
 	}
83 83
 }
84 84
 
85
-add_action( 'admin_init', 'give_redirect_to_clean_url_admin_pages' );
85
+add_action('admin_init', 'give_redirect_to_clean_url_admin_pages');
86 86
 
87 87
 
88 88
 /**
@@ -96,25 +96,25 @@  discard block
 block discarded – undo
96 96
  */
97 97
 function give_hide_outdated_php_notice() {
98 98
 
99
-	if ( ! isset( $_POST['_give_hide_outdated_php_notices_shortly'] ) ) {
99
+	if ( ! isset($_POST['_give_hide_outdated_php_notices_shortly'])) {
100 100
 		give_die();
101 101
 	}
102 102
 
103 103
 	// Transient key name.
104 104
 	$transient_key = "_give_hide_outdated_php_notices_shortly";
105 105
 
106
-	if ( Give_Cache::get( $transient_key, true ) ) {
106
+	if (Give_Cache::get($transient_key, true)) {
107 107
 		return;
108 108
 	}
109 109
 
110 110
 	// Hide notice for 24 hours.
111
-	Give_Cache::set( $transient_key, true, DAY_IN_SECONDS, true );
111
+	Give_Cache::set($transient_key, true, DAY_IN_SECONDS, true);
112 112
 
113 113
 	give_die();
114 114
 
115 115
 }
116 116
 
117
-add_action( 'wp_ajax_give_hide_outdated_php_notice', 'give_hide_outdated_php_notice' );
117
+add_action('wp_ajax_give_hide_outdated_php_notice', 'give_hide_outdated_php_notice');
118 118
 
119 119
 /**
120 120
  * Register admin notices.
@@ -123,23 +123,23 @@  discard block
 block discarded – undo
123 123
  */
124 124
 function _give_register_admin_notices() {
125 125
 	// Bailout.
126
-	if ( ! is_admin() ) {
126
+	if ( ! is_admin()) {
127 127
 		return;
128 128
 	}
129 129
 
130 130
 	// Add payment bulk notice.
131 131
 	if (
132
-		current_user_can( 'edit_give_payments' )
133
-		&& isset( $_GET['action'] )
134
-		&& ! empty( $_GET['action'] )
135
-		&& isset( $_GET['payment'] )
136
-		&& ! empty( $_GET['payment'] )
132
+		current_user_can('edit_give_payments')
133
+		&& isset($_GET['action'])
134
+		&& ! empty($_GET['action'])
135
+		&& isset($_GET['payment'])
136
+		&& ! empty($_GET['payment'])
137 137
 	) {
138
-		$payment_count = isset( $_GET['payment'] ) ? count( $_GET['payment'] ) : 0;
138
+		$payment_count = isset($_GET['payment']) ? count($_GET['payment']) : 0;
139 139
 
140
-		switch ( $_GET['action'] ) {
140
+		switch ($_GET['action']) {
141 141
 			case 'delete':
142
-				Give()->notices->register_notice( array(
142
+				Give()->notices->register_notice(array(
143 143
 					'id'          => 'bulk_action_delete',
144 144
 					'type'        => 'updated',
145 145
 					'description' => sprintf(
@@ -151,12 +151,12 @@  discard block
 block discarded – undo
151 151
 						),
152 152
 						$payment_count ),
153 153
 					'show'        => true,
154
-				) );
154
+				));
155 155
 
156 156
 				break;
157 157
 
158 158
 			case 'resend-receipt':
159
-				Give()->notices->register_notice( array(
159
+				Give()->notices->register_notice(array(
160 160
 					'id'          => 'bulk_action_resend_receipt',
161 161
 					'type'        => 'updated',
162 162
 					'description' => sprintf(
@@ -169,205 +169,205 @@  discard block
 block discarded – undo
169 169
 						$payment_count
170 170
 					),
171 171
 					'show'        => true,
172
-				) );
172
+				));
173 173
 				break;
174 174
 		}
175 175
 	}
176 176
 
177 177
 	// Add give message notices.
178
-	if ( ! empty( $_GET['give-message'] ) ) {
178
+	if ( ! empty($_GET['give-message'])) {
179 179
 		// Donation reports errors.
180
-		if ( current_user_can( 'view_give_reports' ) ) {
181
-			switch ( $_GET['give-message'] ) {
180
+		if (current_user_can('view_give_reports')) {
181
+			switch ($_GET['give-message']) {
182 182
 				case 'donation_deleted' :
183
-					Give()->notices->register_notice( array(
183
+					Give()->notices->register_notice(array(
184 184
 						'id'          => 'give-donation-deleted',
185 185
 						'type'        => 'updated',
186
-						'description' => __( 'The donation has been deleted.', 'give' ),
186
+						'description' => __('The donation has been deleted.', 'give'),
187 187
 						'show'        => true,
188
-					) );
188
+					));
189 189
 					break;
190 190
 				case 'email_sent' :
191
-					Give()->notices->register_notice( array(
191
+					Give()->notices->register_notice(array(
192 192
 						'id'          => 'give-payment-sent',
193 193
 						'type'        => 'updated',
194
-						'description' => __( 'The donation receipt has been resent.', 'give' ),
194
+						'description' => __('The donation receipt has been resent.', 'give'),
195 195
 						'show'        => true,
196
-					) );
196
+					));
197 197
 					break;
198 198
 				case 'refreshed-reports' :
199
-					Give()->notices->register_notice( array(
199
+					Give()->notices->register_notice(array(
200 200
 						'id'          => 'give-refreshed-reports',
201 201
 						'type'        => 'updated',
202
-						'description' => __( 'The reports cache has been cleared.', 'give' ),
202
+						'description' => __('The reports cache has been cleared.', 'give'),
203 203
 						'show'        => true,
204
-					) );
204
+					));
205 205
 					break;
206 206
 				case 'donation-note-deleted' :
207
-					Give()->notices->register_notice( array(
207
+					Give()->notices->register_notice(array(
208 208
 						'id'          => 'give-donation-note-deleted',
209 209
 						'type'        => 'updated',
210
-						'description' => __( 'The donation note has been deleted.', 'give' ),
210
+						'description' => __('The donation note has been deleted.', 'give'),
211 211
 						'show'        => true,
212
-					) );
212
+					));
213 213
 					break;
214 214
 			}
215 215
 		}
216 216
 
217 217
 		// Give settings notices and errors.
218
-		if ( current_user_can( 'manage_give_settings' ) ) {
219
-			switch ( $_GET['give-message'] ) {
218
+		if (current_user_can('manage_give_settings')) {
219
+			switch ($_GET['give-message']) {
220 220
 				case 'settings-imported' :
221
-					Give()->notices->register_notice( array(
221
+					Give()->notices->register_notice(array(
222 222
 						'id'          => 'give-settings-imported',
223 223
 						'type'        => 'updated',
224
-						'description' => __( 'The settings have been imported.', 'give' ),
224
+						'description' => __('The settings have been imported.', 'give'),
225 225
 						'show'        => true,
226
-					) );
226
+					));
227 227
 					break;
228 228
 				case 'api-key-generated' :
229
-					Give()->notices->register_notice( array(
229
+					Give()->notices->register_notice(array(
230 230
 						'id'          => 'give-api-key-generated',
231 231
 						'type'        => 'updated',
232
-						'description' => __( 'API keys have been generated.', 'give' ),
232
+						'description' => __('API keys have been generated.', 'give'),
233 233
 						'show'        => true,
234
-					) );
234
+					));
235 235
 					break;
236 236
 				case 'api-key-exists' :
237
-					Give()->notices->register_notice( array(
237
+					Give()->notices->register_notice(array(
238 238
 						'id'          => 'give-api-key-exists',
239 239
 						'type'        => 'updated',
240
-						'description' => __( 'The specified user already has API keys.', 'give' ),
240
+						'description' => __('The specified user already has API keys.', 'give'),
241 241
 						'show'        => true,
242
-					) );
242
+					));
243 243
 					break;
244 244
 				case 'api-key-regenerated' :
245
-					Give()->notices->register_notice( array(
245
+					Give()->notices->register_notice(array(
246 246
 						'id'          => 'give-api-key-regenerated',
247 247
 						'type'        => 'updated',
248
-						'description' => __( 'API keys have been regenerated.', 'give' ),
248
+						'description' => __('API keys have been regenerated.', 'give'),
249 249
 						'show'        => true,
250
-					) );
250
+					));
251 251
 					break;
252 252
 				case 'api-key-revoked' :
253
-					Give()->notices->register_notice( array(
253
+					Give()->notices->register_notice(array(
254 254
 						'id'          => 'give-api-key-revoked',
255 255
 						'type'        => 'updated',
256
-						'description' => __( 'API keys have been revoked.', 'give' ),
256
+						'description' => __('API keys have been revoked.', 'give'),
257 257
 						'show'        => true,
258
-					) );
258
+					));
259 259
 					break;
260 260
 				case 'sent-test-email' :
261
-					Give()->notices->register_notice( array(
261
+					Give()->notices->register_notice(array(
262 262
 						'id'          => 'give-sent-test-email',
263 263
 						'type'        => 'updated',
264
-						'description' => __( 'The test email has been sent.', 'give' ),
264
+						'description' => __('The test email has been sent.', 'give'),
265 265
 						'show'        => true,
266
-					) );
266
+					));
267 267
 					break;
268 268
 				case 'matched-success-failure-page':
269
-					Give()->notices->register_notice( array(
269
+					Give()->notices->register_notice(array(
270 270
 						'id'          => 'give-matched-success-failure-page',
271 271
 						'type'        => 'updated',
272
-						'description' => __( 'You cannot set the success and failed pages to the same page', 'give' ),
272
+						'description' => __('You cannot set the success and failed pages to the same page', 'give'),
273 273
 						'show'        => true,
274
-					) );
274
+					));
275 275
 					break;
276 276
 			}
277 277
 		}
278 278
 		// Payments errors.
279
-		if ( current_user_can( 'edit_give_payments' ) ) {
280
-			switch ( $_GET['give-message'] ) {
279
+		if (current_user_can('edit_give_payments')) {
280
+			switch ($_GET['give-message']) {
281 281
 				case 'note-added' :
282
-					Give()->notices->register_notice( array(
282
+					Give()->notices->register_notice(array(
283 283
 						'id'          => 'give-note-added',
284 284
 						'type'        => 'updated',
285
-						'description' => __( 'The donation note has been added.', 'give' ),
285
+						'description' => __('The donation note has been added.', 'give'),
286 286
 						'show'        => true,
287
-					) );
287
+					));
288 288
 					break;
289 289
 				case 'payment-updated' :
290
-					Give()->notices->register_notice( array(
290
+					Give()->notices->register_notice(array(
291 291
 						'id'          => 'give-payment-updated',
292 292
 						'type'        => 'updated',
293
-						'description' => __( 'The donation has been updated.', 'give' ),
293
+						'description' => __('The donation has been updated.', 'give'),
294 294
 						'show'        => true,
295
-					) );
295
+					));
296 296
 					break;
297 297
 			}
298 298
 		}
299 299
 
300 300
 		// Donor Notices.
301
-		if ( current_user_can( 'edit_give_payments' ) ) {
302
-			switch ( $_GET['give-message'] ) {
301
+		if (current_user_can('edit_give_payments')) {
302
+			switch ($_GET['give-message']) {
303 303
 				case 'donor-deleted' :
304
-					Give()->notices->register_notice( array(
304
+					Give()->notices->register_notice(array(
305 305
 						'id'          => 'give-donor-deleted',
306 306
 						'type'        => 'updated',
307
-						'description' => __( 'The donor has been deleted.', 'give' ),
307
+						'description' => __('The donor has been deleted.', 'give'),
308 308
 						'show'        => true,
309
-					) );
309
+					));
310 310
 					break;
311 311
 
312 312
 				case 'email-added' :
313
-					Give()->notices->register_notice( array(
313
+					Give()->notices->register_notice(array(
314 314
 						'id'          => 'give-donor-email-added',
315 315
 						'type'        => 'updated',
316
-						'description' => __( 'Donor email added.', 'give' ),
316
+						'description' => __('Donor email added.', 'give'),
317 317
 						'show'        => true,
318
-					) );
318
+					));
319 319
 					break;
320 320
 
321 321
 				case 'email-removed' :
322
-					Give()->notices->register_notice( array(
322
+					Give()->notices->register_notice(array(
323 323
 						'id'          => 'give-donor-email-removed',
324 324
 						'type'        => 'updated',
325
-						'description' => __( 'Donor email removed.', 'give' ),
325
+						'description' => __('Donor email removed.', 'give'),
326 326
 						'show'        => true,
327
-					) );
327
+					));
328 328
 					break;
329 329
 
330 330
 				case 'email-remove-failed' :
331
-					Give()->notices->register_notice( array(
331
+					Give()->notices->register_notice(array(
332 332
 						'id'          => 'give-donor-email-remove-failed',
333 333
 						'type'        => 'updated',
334
-						'description' => __( 'Failed to remove donor email.', 'give' ),
334
+						'description' => __('Failed to remove donor email.', 'give'),
335 335
 						'show'        => true,
336
-					) );
336
+					));
337 337
 					break;
338 338
 
339 339
 				case 'primary-email-updated' :
340
-					Give()->notices->register_notice( array(
340
+					Give()->notices->register_notice(array(
341 341
 						'id'          => 'give-donor-primary-email-updated',
342 342
 						'type'        => 'updated',
343
-						'description' => __( 'Primary email updated for donor.', 'give' ),
343
+						'description' => __('Primary email updated for donor.', 'give'),
344 344
 						'show'        => true,
345
-					) );
345
+					));
346 346
 					break;
347 347
 
348 348
 				case 'primary-email-failed' :
349
-					Give()->notices->register_notice( array(
349
+					Give()->notices->register_notice(array(
350 350
 						'id'          => 'give-donor-primary-email-failed',
351 351
 						'type'        => 'updated',
352
-						'description' => __( 'Failed to set primary email.', 'give' ),
352
+						'description' => __('Failed to set primary email.', 'give'),
353 353
 						'show'        => true,
354
-					) );
354
+					));
355 355
 					break;
356 356
 
357 357
 				case 'reconnect-user' :
358
-					Give()->notices->register_notice( array(
358
+					Give()->notices->register_notice(array(
359 359
 						'id'          => 'give-donor-reconnect-user',
360 360
 						'type'        => 'updated',
361
-						'description' => __( 'User has been successfully connected with Donor.', 'give' ),
361
+						'description' => __('User has been successfully connected with Donor.', 'give'),
362 362
 						'show'        => true,
363
-					) );
363
+					));
364 364
 					break;
365 365
 			}
366 366
 		}
367 367
 	}
368 368
 }
369 369
 
370
-add_action( 'admin_notices', '_give_register_admin_notices', - 1 );
370
+add_action('admin_notices', '_give_register_admin_notices', - 1);
371 371
 
372 372
 
373 373
 /**
@@ -377,31 +377,30 @@  discard block
 block discarded – undo
377 377
  *
378 378
  * @return bool
379 379
  */
380
-function _give_show_test_mode_notice_in_admin_bar( $wp_admin_bar ) {
381
-	$is_test_mode = ! empty( $_POST['test_mode'] ) ?
382
-		give_is_setting_enabled( $_POST['test_mode'] ) :
383
-		give_is_test_mode();
380
+function _give_show_test_mode_notice_in_admin_bar($wp_admin_bar) {
381
+	$is_test_mode = ! empty($_POST['test_mode']) ?
382
+		give_is_setting_enabled($_POST['test_mode']) : give_is_test_mode();
384 383
 
385 384
 	if (
386
-		! current_user_can( 'view_give_reports' ) ||
385
+		! current_user_can('view_give_reports') ||
387 386
 		! $is_test_mode
388 387
 	) {
389 388
 		return false;
390 389
 	}
391 390
 
392 391
 	// Add the main siteadmin menu item.
393
-	$wp_admin_bar->add_menu( array(
392
+	$wp_admin_bar->add_menu(array(
394 393
 		'id'     => 'give-test-notice',
395
-		'href'   => admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=gateways' ),
394
+		'href'   => admin_url('edit.php?post_type=give_forms&page=give-settings&tab=gateways'),
396 395
 		'parent' => 'top-secondary',
397
-		'title'  => esc_html__( 'Give Test Mode Active', 'give' ),
398
-		'meta'   => array( 'class' => 'give-test-mode-active' ),
399
-	) );
396
+		'title'  => esc_html__('Give Test Mode Active', 'give'),
397
+		'meta'   => array('class' => 'give-test-mode-active'),
398
+	));
400 399
 
401 400
 	return true;
402 401
 }
403 402
 
404
-add_action( 'admin_bar_menu', '_give_show_test_mode_notice_in_admin_bar', 1000, 1 );
403
+add_action('admin_bar_menu', '_give_show_test_mode_notice_in_admin_bar', 1000, 1);
405 404
 
406 405
 /**
407 406
  * Add Link to Import page in from donation archive and donation single page
@@ -410,12 +409,12 @@  discard block
 block discarded – undo
410 409
  */
411 410
 function give_import_page_link_callback() {
412 411
 	?>
413
-	<a href="<?php echo esc_url( give_import_page_url() ); ?>"
414
-	   class="page-import-action page-title-action"><?php esc_html_e( 'Import Donations', 'give' ); ?></a>
412
+	<a href="<?php echo esc_url(give_import_page_url()); ?>"
413
+	   class="page-import-action page-title-action"><?php esc_html_e('Import Donations', 'give'); ?></a>
415 414
 
416 415
 	<?php
417 416
 	// Check if view donation single page only.
418
-	if ( ! empty( $_REQUEST['view'] ) && 'view-payment-details' === (string) give_clean( $_REQUEST['view'] ) && 'give-payment-history' === give_clean( $_REQUEST['page'] ) ) {
417
+	if ( ! empty($_REQUEST['view']) && 'view-payment-details' === (string) give_clean($_REQUEST['view']) && 'give-payment-history' === give_clean($_REQUEST['page'])) {
419 418
 		?>
420 419
 		<style type="text/css">
421 420
 			.wrap #transaction-details-heading {
@@ -426,7 +425,7 @@  discard block
 block discarded – undo
426 425
 	}
427 426
 }
428 427
 
429
-add_action( 'give_payments_page_top', 'give_import_page_link_callback', 11 );
428
+add_action('give_payments_page_top', 'give_import_page_link_callback', 11);
430 429
 
431 430
 /**
432 431
  * Load donation import ajax callback
@@ -438,9 +437,9 @@  discard block
 block discarded – undo
438 437
  */
439 438
 function give_donation_import_callback() {
440 439
 	$import_setting = array();
441
-	$fields         = isset( $_POST['fields'] ) ? $_POST['fields'] : null;
440
+	$fields         = isset($_POST['fields']) ? $_POST['fields'] : null;
442 441
 
443
-	parse_str( $fields );
442
+	parse_str($fields);
444 443
 
445 444
 	$import_setting['create_user'] = $create_user;
446 445
 	$import_setting['mode']        = $mode;
@@ -449,54 +448,54 @@  discard block
 block discarded – undo
449 448
 	$import_setting['delete_csv']  = $delete_csv;
450 449
 
451 450
 	// Parent key id.
452
-	$main_key = maybe_unserialize( $main_key );
453
-
454
-	$current    = absint( $_REQUEST['current'] );
455
-	$total_ajax = absint( $_REQUEST['total_ajax'] );
456
-	$start      = absint( $_REQUEST['start'] );
457
-	$end        = absint( $_REQUEST['end'] );
458
-	$next       = absint( $_REQUEST['next'] );
459
-	$total      = absint( $_REQUEST['total'] );
460
-	$per_page   = absint( $_REQUEST['per_page'] );
461
-	if ( empty( $delimiter ) ) {
451
+	$main_key = maybe_unserialize($main_key);
452
+
453
+	$current    = absint($_REQUEST['current']);
454
+	$total_ajax = absint($_REQUEST['total_ajax']);
455
+	$start      = absint($_REQUEST['start']);
456
+	$end        = absint($_REQUEST['end']);
457
+	$next       = absint($_REQUEST['next']);
458
+	$total      = absint($_REQUEST['total']);
459
+	$per_page   = absint($_REQUEST['per_page']);
460
+	if (empty($delimiter)) {
462 461
 		$delimiter = ',';
463 462
 	}
464 463
 
465 464
 	// processing done here.
466
-	$raw_data = give_get_donation_data_from_csv( $csv, $start, $end, $delimiter );
467
-	$raw_key  = maybe_unserialize( $mapto );
465
+	$raw_data = give_get_donation_data_from_csv($csv, $start, $end, $delimiter);
466
+	$raw_key  = maybe_unserialize($mapto);
468 467
 
469 468
 	//Prevent normal emails
470
-	remove_action( 'give_complete_donation', 'give_trigger_donation_receipt', 999 );
471
-	remove_action( 'give_insert_user', 'give_new_user_notification', 10 );
472
-	remove_action( 'give_insert_payment', 'give_payment_save_page_data' );
469
+	remove_action('give_complete_donation', 'give_trigger_donation_receipt', 999);
470
+	remove_action('give_insert_user', 'give_new_user_notification', 10);
471
+	remove_action('give_insert_payment', 'give_payment_save_page_data');
473 472
 
474
-	foreach ( $raw_data as $row_data ) {
475
-		give_save_import_donation_to_db( $raw_key, $row_data, $main_key, $import_setting );
473
+	foreach ($raw_data as $row_data) {
474
+		give_save_import_donation_to_db($raw_key, $row_data, $main_key, $import_setting);
476 475
 	}
477 476
 
478 477
 	// Check if function exists or not.
479
-	if ( function_exists( 'give_payment_save_page_data' ) ) {
480
-		add_action( 'give_insert_payment', 'give_payment_save_page_data' );
478
+	if (function_exists('give_payment_save_page_data')) {
479
+		add_action('give_insert_payment', 'give_payment_save_page_data');
481 480
 	}
482
-	add_action( 'give_insert_user', 'give_new_user_notification', 10, 2 );
483
-	add_action( 'give_complete_donation', 'give_trigger_donation_receipt', 999 );
481
+	add_action('give_insert_user', 'give_new_user_notification', 10, 2);
482
+	add_action('give_complete_donation', 'give_trigger_donation_receipt', 999);
484 483
 
485
-	if ( $next == false ) {
484
+	if ($next == false) {
486 485
 		$json_data = array(
487 486
 			'success' => true,
488
-			'message' => __( 'All donation uploaded successfully!', 'give' ),
487
+			'message' => __('All donation uploaded successfully!', 'give'),
489 488
 		);
490 489
 	} else {
491 490
 		$index_start = $start;
492 491
 		$index_end   = $end;
493 492
 		$last        = false;
494 493
 		$next        = true;
495
-		if ( $next ) {
494
+		if ($next) {
496 495
 			$index_start = $index_start + $per_page;
497
-			$index_end   = $per_page + ( $index_start - 1 );
496
+			$index_end   = $per_page + ($index_start - 1);
498 497
 		}
499
-		if ( $index_end >= $total ) {
498
+		if ($index_end >= $total) {
500 499
 			$index_end = $total;
501 500
 			$last      = true;
502 501
 		}
@@ -510,27 +509,27 @@  discard block
 block discarded – undo
510 509
 		);
511 510
 	}
512 511
 
513
-	$url              = give_import_page_url( array(
512
+	$url = give_import_page_url(array(
514 513
 		'step'          => '4',
515 514
 		'importer-type' => 'import_donations',
516 515
 		'csv'           => $csv,
517 516
 		'total'         => $total,
518 517
 		'delete_csv'    => $import_setting['delete_csv'],
519
-		'success'       => ( isset( $json_data['success'] ) ? $json_data['success'] : '' ),
520
-	) );
518
+		'success'       => (isset($json_data['success']) ? $json_data['success'] : ''),
519
+	));
521 520
 	$json_data['url'] = $url;
522 521
 
523
-	$current ++;
522
+	$current++;
524 523
 	$json_data['current'] = $current;
525 524
 
526
-	$percentage              = ( 100 / ( $total_ajax + 1 ) ) * $current;
525
+	$percentage              = (100 / ($total_ajax + 1)) * $current;
527 526
 	$json_data['percentage'] = $percentage;
528 527
 
529
-	$json_data = apply_filters( 'give_import_ajax_responces', $json_data, $fields );
530
-	wp_die( json_encode( $json_data ) );
528
+	$json_data = apply_filters('give_import_ajax_responces', $json_data, $fields);
529
+	wp_die(json_encode($json_data));
531 530
 }
532 531
 
533
-add_action( 'wp_ajax_give_donation_import', 'give_donation_import_callback' );
532
+add_action('wp_ajax_give_donation_import', 'give_donation_import_callback');
534 533
 
535 534
 
536 535
 /**
@@ -543,7 +542,7 @@  discard block
 block discarded – undo
543 542
 	$blank_slate->init();
544 543
 }
545 544
 
546
-add_action( 'current_screen', 'give_blank_slate' );
545
+add_action('current_screen', 'give_blank_slate');
547 546
 
548 547
 /**
549 548
  * Get Array of WP User Roles.
@@ -556,8 +555,8 @@  discard block
 block discarded – undo
556 555
 	$user_roles = array();
557 556
 
558 557
 	// Loop through User Roles.
559
-	foreach ( get_editable_roles() as $role_name => $role_info ):
560
-		$user_roles[ $role_name ] = $role_info['name'];
558
+	foreach (get_editable_roles() as $role_name => $role_info):
559
+		$user_roles[$role_name] = $role_info['name'];
561 560
 	endforeach;
562 561
 
563 562
 	return $user_roles;
Please login to merge, or discard this patch.
includes/class-give-logging.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -463,7 +463,7 @@
 block discarded – undo
463 463
 	 * @since  1.7
464 464
 	 * @access public
465 465
 	 *
466
-	 * @return bool
466
+	 * @return false|null
467 467
 	 */
468 468
 	public function delete_cache() {
469 469
 		global $wpdb;
Please login to merge, or discard this patch.
Spacing   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -43,15 +43,15 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	public function __setup_hooks() {
45 45
 		// Create the log post type
46
-		add_action( 'init', array( $this, 'register_post_type' ), 1 );
46
+		add_action('init', array($this, 'register_post_type'), 1);
47 47
 
48 48
 		// Create types taxonomy and default types
49
-		add_action( 'init', array( $this, 'register_taxonomy' ), 1 );
49
+		add_action('init', array($this, 'register_taxonomy'), 1);
50 50
 
51
-		add_action( 'save_post_give_payment', array( $this, 'background_process_delete_cache' ) );
52
-		add_action( 'save_post_give_forms', array( $this, 'background_process_delete_cache' ) );
53
-		add_action( 'save_post_give_log', array( $this, 'background_process_delete_cache' ) );
54
-		add_action( 'give_delete_log_cache', array( $this, 'delete_cache' ) );
51
+		add_action('save_post_give_payment', array($this, 'background_process_delete_cache'));
52
+		add_action('save_post_give_forms', array($this, 'background_process_delete_cache'));
53
+		add_action('save_post_give_log', array($this, 'background_process_delete_cache'));
54
+		add_action('give_delete_log_cache', array($this, 'delete_cache'));
55 55
 	}
56 56
 
57 57
 	/**
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 		/* Logs post type */
69 69
 		$log_args = array(
70 70
 			'labels'              => array(
71
-				'name' => esc_html__( 'Logs', 'give' ),
71
+				'name' => esc_html__('Logs', 'give'),
72 72
 			),
73 73
 			'public'              => false,
74 74
 			'exclude_from_search' => true,
@@ -77,11 +77,11 @@  discard block
 block discarded – undo
77 77
 			'query_var'           => false,
78 78
 			'rewrite'             => false,
79 79
 			'capability_type'     => 'post',
80
-			'supports'            => array( 'title', 'editor' ),
80
+			'supports'            => array('title', 'editor'),
81 81
 			'can_export'          => true,
82 82
 		);
83 83
 
84
-		register_post_type( 'give_log', $log_args );
84
+		register_post_type('give_log', $log_args);
85 85
 	}
86 86
 
87 87
 	/**
@@ -95,9 +95,9 @@  discard block
 block discarded – undo
95 95
 	 * @return void
96 96
 	 */
97 97
 	public function register_taxonomy() {
98
-		register_taxonomy( 'give_log_type', 'give_log', array(
98
+		register_taxonomy('give_log_type', 'give_log', array(
99 99
 			'public' => false,
100
-		) );
100
+		));
101 101
 	}
102 102
 
103 103
 	/**
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 			'api_request',
118 118
 		);
119 119
 
120
-		return apply_filters( 'give_log_types', $terms );
120
+		return apply_filters('give_log_types', $terms);
121 121
 	}
122 122
 
123 123
 	/**
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
 	 *
133 133
 	 * @return bool         Whether log type is valid.
134 134
 	 */
135
-	public function valid_type( $type ) {
136
-		return in_array( $type, $this->log_types() );
135
+	public function valid_type($type) {
136
+		return in_array($type, $this->log_types());
137 137
 	}
138 138
 
139 139
 	/**
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	 *
153 153
 	 * @return int             Log ID.
154 154
 	 */
155
-	public function add( $title = '', $message = '', $parent = 0, $type = null ) {
155
+	public function add($title = '', $message = '', $parent = 0, $type = null) {
156 156
 		$log_data = array(
157 157
 			'post_title'   => $title,
158 158
 			'post_content' => $message,
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 			'log_type'     => $type,
161 161
 		);
162 162
 
163
-		return $this->insert_log( $log_data );
163
+		return $this->insert_log($log_data);
164 164
 	}
165 165
 
166 166
 	/**
@@ -177,12 +177,12 @@  discard block
 block discarded – undo
177 177
 	 *
178 178
 	 * @return array             An array of the connected logs.
179 179
 	 */
180
-	public function get_logs( $object_id = 0, $type = null, $paged = null ) {
181
-		return $this->get_connected_logs( array(
180
+	public function get_logs($object_id = 0, $type = null, $paged = null) {
181
+		return $this->get_connected_logs(array(
182 182
 			'post_parent' => $object_id,
183 183
 			'paged'       => $paged,
184 184
 			'log_type'    => $type,
185
-		) );
185
+		));
186 186
 	}
187 187
 
188 188
 	/**
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 	 *
197 197
 	 * @return int             The ID of the newly created log item.
198 198
 	 */
199
-	public function insert_log( $log_data = array(), $log_meta = array() ) {
199
+	public function insert_log($log_data = array(), $log_meta = array()) {
200 200
 		$defaults = array(
201 201
 			'post_type'    => 'give_log',
202 202
 			'post_status'  => 'publish',
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 			'log_type'     => false,
206 206
 		);
207 207
 
208
-		$args = wp_parse_args( $log_data, $defaults );
208
+		$args = wp_parse_args($log_data, $defaults);
209 209
 
210 210
 		/**
211 211
 		 * Fires before inserting log entry.
@@ -215,20 +215,20 @@  discard block
 block discarded – undo
215 215
 		 * @param array $log_data Log entry data.
216 216
 		 * @param array $log_meta Log entry meta.
217 217
 		 */
218
-		do_action( 'give_pre_insert_log', $log_data, $log_meta );
218
+		do_action('give_pre_insert_log', $log_data, $log_meta);
219 219
 
220 220
 		// Store the log entry
221
-		$log_id = wp_insert_post( $args );
221
+		$log_id = wp_insert_post($args);
222 222
 
223 223
 		// Set the log type, if any
224
-		if ( $log_data['log_type'] && $this->valid_type( $log_data['log_type'] ) ) {
225
-			wp_set_object_terms( $log_id, $log_data['log_type'], 'give_log_type', false );
224
+		if ($log_data['log_type'] && $this->valid_type($log_data['log_type'])) {
225
+			wp_set_object_terms($log_id, $log_data['log_type'], 'give_log_type', false);
226 226
 		}
227 227
 
228 228
 		// Set log meta, if any
229
-		if ( $log_id && ! empty( $log_meta ) ) {
230
-			foreach ( (array) $log_meta as $key => $meta ) {
231
-				give_update_meta( $log_id, '_give_log_' . sanitize_key( $key ), $meta );
229
+		if ($log_id && ! empty($log_meta)) {
230
+			foreach ((array) $log_meta as $key => $meta) {
231
+				give_update_meta($log_id, '_give_log_'.sanitize_key($key), $meta);
232 232
 			}
233 233
 		}
234 234
 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 		 * @param array $log_data Log entry data.
242 242
 		 * @param array $log_meta Log entry meta.
243 243
 		 */
244
-		do_action( 'give_post_insert_log', $log_id, $log_data, $log_meta );
244
+		do_action('give_post_insert_log', $log_id, $log_data, $log_meta);
245 245
 
246 246
 		return $log_id;
247 247
 	}
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 	 *
258 258
 	 * @return bool|null       True if successful, false otherwise.
259 259
 	 */
260
-	public function update_log( $log_data = array(), $log_meta = array() ) {
260
+	public function update_log($log_data = array(), $log_meta = array()) {
261 261
 
262 262
 		/**
263 263
 		 * Fires before updating log entry.
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 		 * @param array $log_data Log entry data.
268 268
 		 * @param array $log_meta Log entry meta.
269 269
 		 */
270
-		do_action( 'give_pre_update_log', $log_data, $log_meta );
270
+		do_action('give_pre_update_log', $log_data, $log_meta);
271 271
 
272 272
 		$defaults = array(
273 273
 			'post_type'   => 'give_log',
@@ -275,15 +275,15 @@  discard block
 block discarded – undo
275 275
 			'post_parent' => 0,
276 276
 		);
277 277
 
278
-		$args = wp_parse_args( $log_data, $defaults );
278
+		$args = wp_parse_args($log_data, $defaults);
279 279
 
280 280
 		// Store the log entry
281
-		$log_id = wp_update_post( $args );
281
+		$log_id = wp_update_post($args);
282 282
 
283
-		if ( $log_id && ! empty( $log_meta ) ) {
284
-			foreach ( (array) $log_meta as $key => $meta ) {
285
-				if ( ! empty( $meta ) ) {
286
-					give_update_meta( $log_id, '_give_log_' . sanitize_key( $key ), $meta );
283
+		if ($log_id && ! empty($log_meta)) {
284
+			foreach ((array) $log_meta as $key => $meta) {
285
+				if ( ! empty($meta)) {
286
+					give_update_meta($log_id, '_give_log_'.sanitize_key($key), $meta);
287 287
 				}
288 288
 			}
289 289
 		}
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 		 * @param array $log_data Log entry data.
298 298
 		 * @param array $log_meta Log entry meta.
299 299
 		 */
300
-		do_action( 'give_post_update_log', $log_id, $log_data, $log_meta );
300
+		do_action('give_post_update_log', $log_id, $log_data, $log_meta);
301 301
 	}
302 302
 
303 303
 	/**
@@ -312,20 +312,20 @@  discard block
 block discarded – undo
312 312
 	 *
313 313
 	 * @return array|false Array if logs were found, false otherwise.
314 314
 	 */
315
-	public function get_connected_logs( $args = array() ) {
315
+	public function get_connected_logs($args = array()) {
316 316
 
317 317
 		$defaults = array(
318 318
 			'post_type'      => 'give_log',
319 319
 			'posts_per_page' => 20,
320 320
 			'post_status'    => 'publish',
321
-			'paged'          => get_query_var( 'paged' ),
321
+			'paged'          => get_query_var('paged'),
322 322
 			'log_type'       => false,
323 323
 			'date_query'     => null
324 324
 		);
325 325
 
326
-		$query_args = wp_parse_args( $args, $defaults );
326
+		$query_args = wp_parse_args($args, $defaults);
327 327
 
328
-		if ( $query_args['log_type'] && $this->valid_type( $query_args['log_type'] ) ) {
328
+		if ($query_args['log_type'] && $this->valid_type($query_args['log_type'])) {
329 329
 			$query_args['tax_query'] = array(
330 330
 				array(
331 331
 					'taxonomy' => 'give_log_type',
@@ -336,28 +336,28 @@  discard block
 block discarded – undo
336 336
 		}
337 337
 
338 338
 		// Retrieve logs based on specific timeframe
339
-		if ( !empty ( $query_args['date_query'] ) && is_array( $query_args['date_query'] ) ) {
340
-			if ( ! empty( $query_args['date_query']['start_date'] ) ) {
341
-				$query_args['date_query']['after'] =  array(
342
-					'year'  => date( 'Y', strtotime( $query_args['date_query']['start_date'] ) ),
343
-					'month' => date( 'm', strtotime( $query_args['date_query']['start_date'] ) ),
344
-					'day'   => date( 'd', strtotime( $query_args['date_query']['start_date'] ) )
339
+		if ( ! empty ($query_args['date_query']) && is_array($query_args['date_query'])) {
340
+			if ( ! empty($query_args['date_query']['start_date'])) {
341
+				$query_args['date_query']['after'] = array(
342
+					'year'  => date('Y', strtotime($query_args['date_query']['start_date'])),
343
+					'month' => date('m', strtotime($query_args['date_query']['start_date'])),
344
+					'day'   => date('d', strtotime($query_args['date_query']['start_date']))
345 345
 				);
346 346
 			}
347 347
 
348
-			if ( ! empty( $query_args['date_query']['end_date'] ) ) {
349
-				$query_args['date_query']['before'] =  array(
350
-					'year'  => date( 'Y', strtotime( $query_args['date_query']['end_date'] ) ),
351
-					'month' => date( 'm', strtotime( $query_args['date_query']['end_date'] ) ),
352
-					'day'   => date( 'd', strtotime( $query_args['date_query']['end_date'] ) )
348
+			if ( ! empty($query_args['date_query']['end_date'])) {
349
+				$query_args['date_query']['before'] = array(
350
+					'year'  => date('Y', strtotime($query_args['date_query']['end_date'])),
351
+					'month' => date('m', strtotime($query_args['date_query']['end_date'])),
352
+					'day'   => date('d', strtotime($query_args['date_query']['end_date']))
353 353
 				);
354 354
 			}
355 355
 			$query_args['date_query']['inclusive'] = true;
356 356
 		}
357 357
 
358
-		$logs = get_posts( $query_args );
358
+		$logs = get_posts($query_args);
359 359
 
360
-		if ( $logs ) {
360
+		if ($logs) {
361 361
 			return $logs;
362 362
 		}
363 363
 
@@ -380,20 +380,20 @@  discard block
 block discarded – undo
380 380
 	 *
381 381
 	 * @return int                Log count.
382 382
 	 */
383
-	public function get_log_count( $object_id = 0, $type = null, $meta_query = null, $date_query = null ) {
383
+	public function get_log_count($object_id = 0, $type = null, $meta_query = null, $date_query = null) {
384 384
 
385 385
 		$query_args = array(
386 386
 			'post_type'      => 'give_log',
387
-			'posts_per_page' => - 1,
387
+			'posts_per_page' => -1,
388 388
 			'post_status'    => 'publish',
389 389
 			'fields'         => 'ids',
390 390
 		);
391 391
 
392
-		if ( $object_id ) {
392
+		if ($object_id) {
393 393
 			$query_args['post_parent'] = $object_id;
394 394
 		}
395 395
 
396
-		if ( ! empty( $type ) && $this->valid_type( $type ) ) {
396
+		if ( ! empty($type) && $this->valid_type($type)) {
397 397
 			$query_args['tax_query'] = array(
398 398
 				array(
399 399
 					'taxonomy' => 'give_log_type',
@@ -403,24 +403,24 @@  discard block
 block discarded – undo
403 403
 			);
404 404
 		}
405 405
 
406
-		if ( ! empty( $meta_query ) ) {
406
+		if ( ! empty($meta_query)) {
407 407
 			$query_args['meta_query'] = $meta_query;
408 408
 		}
409 409
 
410
-		if ( ! empty( $date_query ) ) {
410
+		if ( ! empty($date_query)) {
411 411
 			$query_args['date_query'] = $date_query;
412 412
 		}
413 413
 
414 414
 		// Get cache key for current query.
415
-		$cache_key = Give_Cache::get_key( 'get_log_count', $query_args );
415
+		$cache_key = Give_Cache::get_key('get_log_count', $query_args);
416 416
 
417 417
 		// check if cache already exist or not.
418
-		if ( ! ( $logs_count = Give_Cache::get( $cache_key ) ) ) {
419
-			$logs       = new WP_Query( $query_args );
418
+		if ( ! ($logs_count = Give_Cache::get($cache_key))) {
419
+			$logs       = new WP_Query($query_args);
420 420
 			$logs_count = (int) $logs->post_count;
421 421
 
422 422
 			// Cache results.
423
-			Give_Cache::set( $cache_key, $logs_count );
423
+			Give_Cache::set($cache_key, $logs_count);
424 424
 		}
425 425
 
426 426
 		return $logs_count;
@@ -440,16 +440,16 @@  discard block
 block discarded – undo
440 440
 	 *
441 441
 	 * @return void
442 442
 	 */
443
-	public function delete_logs( $object_id = 0, $type = null, $meta_query = null ) {
443
+	public function delete_logs($object_id = 0, $type = null, $meta_query = null) {
444 444
 		$query_args = array(
445 445
 			'post_parent'    => $object_id,
446 446
 			'post_type'      => 'give_log',
447
-			'posts_per_page' => - 1,
447
+			'posts_per_page' => -1,
448 448
 			'post_status'    => 'publish',
449 449
 			'fields'         => 'ids',
450 450
 		);
451 451
 
452
-		if ( ! empty( $type ) && $this->valid_type( $type ) ) {
452
+		if ( ! empty($type) && $this->valid_type($type)) {
453 453
 			$query_args['tax_query'] = array(
454 454
 				array(
455 455
 					'taxonomy' => 'give_log_type',
@@ -459,15 +459,15 @@  discard block
 block discarded – undo
459 459
 			);
460 460
 		}
461 461
 
462
-		if ( ! empty( $meta_query ) ) {
462
+		if ( ! empty($meta_query)) {
463 463
 			$query_args['meta_query'] = $meta_query;
464 464
 		}
465 465
 
466
-		$logs = get_posts( $query_args );
466
+		$logs = get_posts($query_args);
467 467
 
468
-		if ( $logs ) {
469
-			foreach ( $logs as $log ) {
470
-				wp_delete_post( $log, true );
468
+		if ($logs) {
469
+			foreach ($logs as $log) {
470
+				wp_delete_post($log, true);
471 471
 			}
472 472
 		}
473 473
 	}
@@ -480,9 +480,9 @@  discard block
 block discarded – undo
480 480
 	 *
481 481
 	 * @param int $post_id
482 482
 	 */
483
-	public function background_process_delete_cache( $post_id ) {
483
+	public function background_process_delete_cache($post_id) {
484 484
 		// Delete log cache immediately
485
-		wp_schedule_single_event( time() - 5, 'give_delete_log_cache' );
485
+		wp_schedule_single_event(time() - 5, 'give_delete_log_cache');
486 486
 	}
487 487
 
488 488
 	/**
@@ -510,11 +510,11 @@  discard block
 block discarded – undo
510 510
 		);
511 511
 
512 512
 		// Bailout.
513
-		if ( empty( $cache_option_names ) ) {
513
+		if (empty($cache_option_names)) {
514 514
 			return false;
515 515
 		}
516 516
 
517
-		Give_Cache::delete( $cache_option_names );
517
+		Give_Cache::delete($cache_option_names);
518 518
 	}
519 519
 }
520 520
 
@@ -536,10 +536,10 @@  discard block
 block discarded – undo
536 536
  *
537 537
  * @return int             ID of the new log entry.
538 538
  */
539
-function give_record_log( $title = '', $message = '', $parent = 0, $type = null ) {
539
+function give_record_log($title = '', $message = '', $parent = 0, $type = null) {
540 540
 	/* @var Give_Logging $give_logs */
541 541
 	global $give_logs;
542
-	$log = $give_logs->add( $title, $message, $parent, $type );
542
+	$log = $give_logs->add($title, $message, $parent, $type);
543 543
 
544 544
 	return $log;
545 545
 }
Please login to merge, or discard this patch.
includes/emails/class-give-email-tags.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -530,7 +530,7 @@
 block discarded – undo
530 530
  *
531 531
  * @param int $payment_id
532 532
  *
533
- * @return int payment_id
533
+ * @return string payment_id
534 534
  */
535 535
 function give_email_tag_payment_id( $payment_id ) {
536 536
 	$payment = new Give_Payment( $payment_id );
Please login to merge, or discard this patch.
Spacing   +113 added lines, -113 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
  */
24 24
 
25 25
 // Exit if accessed directly.
26
-if ( ! defined( 'ABSPATH' ) ) {
26
+if ( ! defined('ABSPATH')) {
27 27
 	exit;
28 28
 }
29 29
 
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
 	 * @param string   $description Email tag description text
56 56
 	 * @param callable $func        Hook to run when email tag is found
57 57
 	 */
58
-	public function add( $tag, $description, $func ) {
59
-		if ( is_callable( $func ) ) {
60
-			$this->tags[ $tag ] = array(
58
+	public function add($tag, $description, $func) {
59
+		if (is_callable($func)) {
60
+			$this->tags[$tag] = array(
61 61
 				'tag'         => $tag,
62 62
 				'description' => $description,
63 63
 				'func'        => $func,
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 	 *
73 73
 	 * @param string $tag Email tag to remove hook from
74 74
 	 */
75
-	public function remove( $tag ) {
76
-		unset( $this->tags[ $tag ] );
75
+	public function remove($tag) {
76
+		unset($this->tags[$tag]);
77 77
 	}
78 78
 
79 79
 	/**
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
 	 *
86 86
 	 * @return bool
87 87
 	 */
88
-	public function email_tag_exists( $tag ) {
89
-		return array_key_exists( $tag, $this->tags );
88
+	public function email_tag_exists($tag) {
89
+		return array_key_exists($tag, $this->tags);
90 90
 	}
91 91
 
92 92
 	/**
@@ -110,16 +110,16 @@  discard block
 block discarded – undo
110 110
 	 *
111 111
 	 * @return string Content with email tags filtered out.
112 112
 	 */
113
-	public function do_tags( $content, $payment_id ) {
113
+	public function do_tags($content, $payment_id) {
114 114
 
115 115
 		// Check if there is at least one tag added.
116
-		if ( empty( $this->tags ) || ! is_array( $this->tags ) ) {
116
+		if (empty($this->tags) || ! is_array($this->tags)) {
117 117
 			return $content;
118 118
 		}
119 119
 
120 120
 		$this->payment_id = $payment_id;
121 121
 
122
-		$new_content = preg_replace_callback( "/{([A-z0-9\-\_]+)}/s", array( $this, 'do_tag' ), $content );
122
+		$new_content = preg_replace_callback("/{([A-z0-9\-\_]+)}/s", array($this, 'do_tag'), $content);
123 123
 
124 124
 		$this->payment_id = null;
125 125
 
@@ -135,17 +135,17 @@  discard block
 block discarded – undo
135 135
 	 *
136 136
 	 * @return mixed
137 137
 	 */
138
-	public function do_tag( $m ) {
138
+	public function do_tag($m) {
139 139
 
140 140
 		// Get tag
141 141
 		$tag = $m[1];
142 142
 
143 143
 		// Return tag if tag not set
144
-		if ( ! $this->email_tag_exists( $tag ) ) {
144
+		if ( ! $this->email_tag_exists($tag)) {
145 145
 			return $m[0];
146 146
 		}
147 147
 
148
-		return call_user_func( $this->tags[ $tag ]['func'], $this->payment_id, $tag );
148
+		return call_user_func($this->tags[$tag]['func'], $this->payment_id, $tag);
149 149
 	}
150 150
 
151 151
 }
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
  * @param string   $description Description of the email tag added
160 160
  * @param callable $func        Hook to run when email tag is found
161 161
  */
162
-function give_add_email_tag( $tag, $description, $func ) {
163
-	Give()->email_tags->add( $tag, $description, $func );
162
+function give_add_email_tag($tag, $description, $func) {
163
+	Give()->email_tags->add($tag, $description, $func);
164 164
 }
165 165
 
166 166
 /**
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
  *
171 171
  * @param string $tag Email tag to remove hook from
172 172
  */
173
-function give_remove_email_tag( $tag ) {
174
-	Give()->email_tags->remove( $tag );
173
+function give_remove_email_tag($tag) {
174
+	Give()->email_tags->remove($tag);
175 175
 }
176 176
 
177 177
 /**
@@ -183,8 +183,8 @@  discard block
 block discarded – undo
183 183
  *
184 184
  * @return bool
185 185
  */
186
-function give_email_tag_exists( $tag ) {
187
-	return Give()->email_tags->email_tag_exists( $tag );
186
+function give_email_tag_exists($tag) {
187
+	return Give()->email_tags->email_tag_exists($tag);
188 188
 }
189 189
 
190 190
 /**
@@ -211,9 +211,9 @@  discard block
 block discarded – undo
211 211
 	$email_tags = give_get_email_tags();
212 212
 
213 213
 	ob_start();
214
-	if ( count( $email_tags ) > 0 ) : ?>
214
+	if (count($email_tags) > 0) : ?>
215 215
 		<div class="give-email-tags-wrap">
216
-			<?php foreach ( $email_tags as $email_tag ) : ?>
216
+			<?php foreach ($email_tags as $email_tag) : ?>
217 217
 				<span class="give_<?php echo $email_tag['tag']; ?>_tag">
218 218
 					<code>{<?php echo $email_tag['tag']; ?>}</code> - <?php echo $email_tag['description']; ?>
219 219
 				</span>
@@ -235,12 +235,12 @@  discard block
 block discarded – undo
235 235
  *
236 236
  * @return string Content with email tags filtered out.
237 237
  */
238
-function give_do_email_tags( $content, $payment_id ) {
238
+function give_do_email_tags($content, $payment_id) {
239 239
 
240 240
 	// Replace all tags
241
-	$content = Give()->email_tags->do_tags( $content, $payment_id );
241
+	$content = Give()->email_tags->do_tags($content, $payment_id);
242 242
 
243
-	$content = apply_filters( 'give_email_template_tags', $content, give_get_payment_meta( $payment_id ), $payment_id );
243
+	$content = apply_filters('give_email_template_tags', $content, give_get_payment_meta($payment_id), $payment_id);
244 244
 
245 245
 	// Return content
246 246
 	return $content;
@@ -259,10 +259,10 @@  discard block
 block discarded – undo
259 259
 	 *
260 260
 	 * @since 1.0
261 261
 	 */
262
-	do_action( 'give_add_email_tags' );
262
+	do_action('give_add_email_tags');
263 263
 }
264 264
 
265
-add_action( 'init', 'give_load_email_tags', - 999 );
265
+add_action('init', 'give_load_email_tags', - 999);
266 266
 
267 267
 
268 268
 /**
@@ -276,97 +276,97 @@  discard block
 block discarded – undo
276 276
 	$email_tags = array(
277 277
 		array(
278 278
 			'tag'         => 'donation',
279
-			'description' => __( 'The donation form name, and the donation level (if applicable).', 'give' ),
279
+			'description' => __('The donation form name, and the donation level (if applicable).', 'give'),
280 280
 			'function'    => 'give_email_tag_donation',
281 281
 		),
282 282
 		array(
283 283
 			'tag'         => 'form_title',
284
-			'description' => __( 'The donation form name.', 'give' ),
284
+			'description' => __('The donation form name.', 'give'),
285 285
 			'function'    => 'give_email_tag_form_title',
286 286
 		),
287 287
 		array(
288 288
 			'tag'         => 'amount',
289
-			'description' => __( 'The total donation amount with currency sign.', 'give' ),
289
+			'description' => __('The total donation amount with currency sign.', 'give'),
290 290
 			'function'    => 'give_email_tag_amount',
291 291
 		),
292 292
 		array(
293 293
 			'tag'         => 'price',
294
-			'description' => __( 'The total donation amount with currency sign.', 'give' ),
294
+			'description' => __('The total donation amount with currency sign.', 'give'),
295 295
 			'function'    => 'give_email_tag_price',
296 296
 		),
297 297
 		array(
298 298
 			'tag'         => 'name',
299
-			'description' => __( 'The donor\'s first name.', 'give' ),
299
+			'description' => __('The donor\'s first name.', 'give'),
300 300
 			'function'    => 'give_email_tag_first_name',
301 301
 		),
302 302
 		array(
303 303
 			'tag'         => 'fullname',
304
-			'description' => __( 'The donor\'s full name, first and last.', 'give' ),
304
+			'description' => __('The donor\'s full name, first and last.', 'give'),
305 305
 			'function'    => 'give_email_tag_fullname',
306 306
 		),
307 307
 		array(
308 308
 			'tag'         => 'username',
309
-			'description' => __( 'The donor\'s user name on the site, if they registered an account.', 'give' ),
309
+			'description' => __('The donor\'s user name on the site, if they registered an account.', 'give'),
310 310
 			'function'    => 'give_email_tag_username',
311 311
 		),
312 312
 		array(
313 313
 			'tag'         => 'user_email',
314
-			'description' => __( 'The donor\'s email address.', 'give' ),
314
+			'description' => __('The donor\'s email address.', 'give'),
315 315
 			'function'    => 'give_email_tag_user_email',
316 316
 		),
317 317
 		array(
318 318
 			'tag'         => 'billing_address',
319
-			'description' => __( 'The donor\'s billing address.', 'give' ),
319
+			'description' => __('The donor\'s billing address.', 'give'),
320 320
 			'function'    => 'give_email_tag_billing_address',
321 321
 		),
322 322
 		array(
323 323
 			'tag'         => 'date',
324
-			'description' => __( 'The date of the donation.', 'give' ),
324
+			'description' => __('The date of the donation.', 'give'),
325 325
 			'function'    => 'give_email_tag_date',
326 326
 		),
327 327
 		array(
328 328
 			'tag'         => 'payment_id',
329
-			'description' => __( 'The unique ID number for this donation.', 'give' ),
329
+			'description' => __('The unique ID number for this donation.', 'give'),
330 330
 			'function'    => 'give_email_tag_payment_id',
331 331
 		),
332 332
 		array(
333 333
 			'tag'         => 'receipt_id',
334
-			'description' => __( 'The unique ID number for this donation receipt.', 'give' ),
334
+			'description' => __('The unique ID number for this donation receipt.', 'give'),
335 335
 			'function'    => 'give_email_tag_receipt_id',
336 336
 		),
337 337
 		array(
338 338
 			'tag'         => 'payment_method',
339
-			'description' => __( 'The method of payment used for this donation.', 'give' ),
339
+			'description' => __('The method of payment used for this donation.', 'give'),
340 340
 			'function'    => 'give_email_tag_payment_method',
341 341
 		),
342 342
 		array(
343 343
 			'tag'         => 'sitename',
344
-			'description' => __( 'The name of your site.', 'give' ),
344
+			'description' => __('The name of your site.', 'give'),
345 345
 			'function'    => 'give_email_tag_sitename',
346 346
 		),
347 347
 		array(
348 348
 			'tag'         => 'receipt_link',
349
-			'description' => __( 'The donation receipt direct link, to view the receipt on the website.', 'give' ),
349
+			'description' => __('The donation receipt direct link, to view the receipt on the website.', 'give'),
350 350
 			'function'    => 'give_email_tag_receipt_link',
351 351
 		),
352 352
 		array(
353 353
 			'tag'         => 'receipt_link_url',
354
-			'description' => __( 'The donation receipt direct URL, to view the receipt on the website.', 'give' ),
354
+			'description' => __('The donation receipt direct URL, to view the receipt on the website.', 'give'),
355 355
 			'function'    => 'give_email_tag_receipt_link_url',
356 356
 		),
357 357
 	);
358 358
 
359 359
 	// Apply give_email_tags filter
360
-	$email_tags = apply_filters( 'give_email_tags', $email_tags );
360
+	$email_tags = apply_filters('give_email_tags', $email_tags);
361 361
 
362 362
 	// Add email tags
363
-	foreach ( $email_tags as $email_tag ) {
364
-		give_add_email_tag( $email_tag['tag'], $email_tag['description'], $email_tag['function'] );
363
+	foreach ($email_tags as $email_tag) {
364
+		give_add_email_tag($email_tag['tag'], $email_tag['description'], $email_tag['function']);
365 365
 	}
366 366
 
367 367
 }
368 368
 
369
-add_action( 'give_add_email_tags', 'give_setup_email_tags' );
369
+add_action('give_add_email_tags', 'give_setup_email_tags');
370 370
 
371 371
 
372 372
 /**
@@ -378,15 +378,15 @@  discard block
 block discarded – undo
378 378
  *
379 379
  * @return string name
380 380
  */
381
-function give_email_tag_first_name( $payment_id ) {
382
-	$payment   = new Give_Payment( $payment_id );
381
+function give_email_tag_first_name($payment_id) {
382
+	$payment   = new Give_Payment($payment_id);
383 383
 	$user_info = $payment->user_info;
384 384
 
385
-	if ( empty( $user_info ) ) {
385
+	if (empty($user_info)) {
386 386
 		return '';
387 387
 	}
388 388
 
389
-	$email_name = give_get_email_names( $user_info );
389
+	$email_name = give_get_email_names($user_info);
390 390
 
391 391
 	return $email_name['name'];
392 392
 }
@@ -400,15 +400,15 @@  discard block
 block discarded – undo
400 400
  *
401 401
  * @return string fullname
402 402
  */
403
-function give_email_tag_fullname( $payment_id ) {
404
-	$payment   = new Give_Payment( $payment_id );
403
+function give_email_tag_fullname($payment_id) {
404
+	$payment   = new Give_Payment($payment_id);
405 405
 	$user_info = $payment->user_info;
406 406
 
407
-	if ( empty( $user_info ) ) {
407
+	if (empty($user_info)) {
408 408
 		return '';
409 409
 	}
410 410
 
411
-	$email_name = give_get_email_names( $user_info );
411
+	$email_name = give_get_email_names($user_info);
412 412
 
413 413
 	return $email_name['fullname'];
414 414
 }
@@ -422,15 +422,15 @@  discard block
 block discarded – undo
422 422
  *
423 423
  * @return string username.
424 424
  */
425
-function give_email_tag_username( $payment_id ) {
426
-	$payment   = new Give_Payment( $payment_id );
425
+function give_email_tag_username($payment_id) {
426
+	$payment   = new Give_Payment($payment_id);
427 427
 	$user_info = $payment->user_info;
428 428
 
429
-	if ( empty( $user_info ) ) {
429
+	if (empty($user_info)) {
430 430
 		return '';
431 431
 	}
432 432
 
433
-	$email_name = give_get_email_names( $user_info );
433
+	$email_name = give_get_email_names($user_info);
434 434
 
435 435
 	return $email_name['username'];
436 436
 }
@@ -444,8 +444,8 @@  discard block
 block discarded – undo
444 444
  *
445 445
  * @return string user_email
446 446
  */
447
-function give_email_tag_user_email( $payment_id ) {
448
-	$payment = new Give_Payment( $payment_id );
447
+function give_email_tag_user_email($payment_id) {
448
+	$payment = new Give_Payment($payment_id);
449 449
 
450 450
 	return $payment->email;
451 451
 }
@@ -459,9 +459,9 @@  discard block
 block discarded – undo
459 459
  *
460 460
  * @return string billing_address
461 461
  */
462
-function give_email_tag_billing_address( $payment_id ) {
463
-	$user_info    = give_get_payment_meta_user_info( $payment_id );
464
-	$user_address = ! empty( $user_info['address'] ) ? $user_info['address'] : array(
462
+function give_email_tag_billing_address($payment_id) {
463
+	$user_info    = give_get_payment_meta_user_info($payment_id);
464
+	$user_address = ! empty($user_info['address']) ? $user_info['address'] : array(
465 465
 		'line1'   => '',
466 466
 		'line2'   => '',
467 467
 		'city'    => '',
@@ -471,24 +471,24 @@  discard block
 block discarded – undo
471 471
 	);
472 472
 
473 473
 	$return = $user_address['line1'];
474
-	if ( ! empty( $user_address['line2'] ) ) {
475
-		$return .= ', ' . $user_address['line2'];
474
+	if ( ! empty($user_address['line2'])) {
475
+		$return .= ', '.$user_address['line2'];
476 476
 	}
477
-	if ( ! empty( $user_address['city'] ) ) {
478
-		$return .= "\n" . $user_address['city'];
477
+	if ( ! empty($user_address['city'])) {
478
+		$return .= "\n".$user_address['city'];
479 479
 	}
480
-	if ( ! empty( $user_address['state'] ) ) {
481
-		$return .= ', ' . $user_address['state'];
480
+	if ( ! empty($user_address['state'])) {
481
+		$return .= ', '.$user_address['state'];
482 482
 	}
483
-	if ( ! empty( $user_address['zip'] ) ) {
484
-		$return .= ' ' . $user_address['zip'];
483
+	if ( ! empty($user_address['zip'])) {
484
+		$return .= ' '.$user_address['zip'];
485 485
 	}
486
-	if ( ! empty( $user_address['country'] ) ) {
487
-		$return .= "\n" . give_get_country_name_by_key( $user_address['country'] );
486
+	if ( ! empty($user_address['country'])) {
487
+		$return .= "\n".give_get_country_name_by_key($user_address['country']);
488 488
 	}
489 489
 
490
-	if ( empty( $return ) ) {
491
-		$return = __( 'None provided', 'give' );
490
+	if (empty($return)) {
491
+		$return = __('None provided', 'give');
492 492
 	}
493 493
 
494 494
 	return apply_filters('give_email_tag_billing_address', $return, $payment_id);
@@ -504,10 +504,10 @@  discard block
 block discarded – undo
504 504
  *
505 505
  * @return string date
506 506
  */
507
-function give_email_tag_date( $payment_id ) {
508
-	$payment = new Give_Payment( $payment_id );
507
+function give_email_tag_date($payment_id) {
508
+	$payment = new Give_Payment($payment_id);
509 509
 
510
-	return date_i18n( give_date_format(), strtotime( $payment->date ) );
510
+	return date_i18n(give_date_format(), strtotime($payment->date));
511 511
 }
512 512
 
513 513
 /**
@@ -519,11 +519,11 @@  discard block
 block discarded – undo
519 519
  *
520 520
  * @return string amount
521 521
  */
522
-function give_email_tag_amount( $payment_id ) {
523
-	$payment     = new Give_Payment( $payment_id );
524
-	$give_amount = give_currency_filter( give_format_amount( $payment->total, array( 'sanitize' => false ) ), $payment->currency );
522
+function give_email_tag_amount($payment_id) {
523
+	$payment     = new Give_Payment($payment_id);
524
+	$give_amount = give_currency_filter(give_format_amount($payment->total, array('sanitize' => false)), $payment->currency);
525 525
 
526
-	return html_entity_decode( $give_amount, ENT_COMPAT, 'UTF-8' );
526
+	return html_entity_decode($give_amount, ENT_COMPAT, 'UTF-8');
527 527
 }
528 528
 
529 529
 /**
@@ -535,8 +535,8 @@  discard block
 block discarded – undo
535 535
  *
536 536
  * @return string price
537 537
  */
538
-function give_email_tag_price( $payment_id ) {
539
-	return give_email_tag_amount( $payment_id );
538
+function give_email_tag_price($payment_id) {
539
+	return give_email_tag_amount($payment_id);
540 540
 }
541 541
 
542 542
 /**
@@ -548,8 +548,8 @@  discard block
 block discarded – undo
548 548
  *
549 549
  * @return int payment_id
550 550
  */
551
-function give_email_tag_payment_id( $payment_id ) {
552
-	$payment = new Give_Payment( $payment_id );
551
+function give_email_tag_payment_id($payment_id) {
552
+	$payment = new Give_Payment($payment_id);
553 553
 
554 554
 	return $payment->number;
555 555
 }
@@ -563,8 +563,8 @@  discard block
 block discarded – undo
563 563
  *
564 564
  * @return string receipt_id
565 565
  */
566
-function give_email_tag_receipt_id( $payment_id ) {
567
-	$payment = new Give_Payment( $payment_id );
566
+function give_email_tag_receipt_id($payment_id) {
567
+	$payment = new Give_Payment($payment_id);
568 568
 
569 569
 	return $payment->key;
570 570
 }
@@ -578,14 +578,14 @@  discard block
 block discarded – undo
578 578
  *
579 579
  * @return string $form_title
580 580
  */
581
-function give_email_tag_donation( $payment_id ) {
582
-	$payment      = new Give_Payment( $payment_id );
581
+function give_email_tag_donation($payment_id) {
582
+	$payment      = new Give_Payment($payment_id);
583 583
 	$payment_meta = $payment->payment_meta;
584
-	$level_title  = give_has_variable_prices( $payment->form_id );
584
+	$level_title  = give_has_variable_prices($payment->form_id);
585 585
 	$separator    = $level_title ? '-' : '';
586
-	$form_title   = strip_tags( give_get_payment_form_title( $payment_meta, false, $separator ) );
586
+	$form_title   = strip_tags(give_get_payment_form_title($payment_meta, false, $separator));
587 587
 
588
-	return ! empty( $form_title ) ? $form_title : '';
588
+	return ! empty($form_title) ? $form_title : '';
589 589
 
590 590
 }
591 591
 
@@ -598,11 +598,11 @@  discard block
 block discarded – undo
598 598
  *
599 599
  * @return string $form_title
600 600
  */
601
-function give_email_tag_form_title( $payment_id ) {
602
-	$payment      = new Give_Payment( $payment_id );
601
+function give_email_tag_form_title($payment_id) {
602
+	$payment      = new Give_Payment($payment_id);
603 603
 	$payment_meta = $payment->payment_meta;
604 604
 
605
-	return isset( $payment_meta['form_title'] ) ? strip_tags( $payment_meta['form_title'] ) : '';
605
+	return isset($payment_meta['form_title']) ? strip_tags($payment_meta['form_title']) : '';
606 606
 
607 607
 }
608 608
 
@@ -615,10 +615,10 @@  discard block
 block discarded – undo
615 615
  *
616 616
  * @return string gateway
617 617
  */
618
-function give_email_tag_payment_method( $payment_id ) {
619
-	$payment = new Give_Payment( $payment_id );
618
+function give_email_tag_payment_method($payment_id) {
619
+	$payment = new Give_Payment($payment_id);
620 620
 
621
-	return give_get_gateway_checkout_label( $payment->gateway );
621
+	return give_get_gateway_checkout_label($payment->gateway);
622 622
 }
623 623
 
624 624
 /**
@@ -630,8 +630,8 @@  discard block
 block discarded – undo
630 630
  *
631 631
  * @return string sitename
632 632
  */
633
-function give_email_tag_sitename( $payment_id ) {
634
-	return wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES );
633
+function give_email_tag_sitename($payment_id) {
634
+	return wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES);
635 635
 }
636 636
 
637 637
 /**
@@ -643,19 +643,19 @@  discard block
 block discarded – undo
643 643
  *
644 644
  * @return string receipt_link
645 645
  */
646
-function give_email_tag_receipt_link( $payment_id ) {
646
+function give_email_tag_receipt_link($payment_id) {
647 647
 
648
-	$receipt_url = esc_url( add_query_arg( array(
649
-		'payment_key' => give_get_payment_key( $payment_id ),
648
+	$receipt_url = esc_url(add_query_arg(array(
649
+		'payment_key' => give_get_payment_key($payment_id),
650 650
 		'give_action' => 'view_receipt',
651
-	), home_url() ) );
652
-	$formatted   = sprintf(
651
+	), home_url()));
652
+	$formatted = sprintf(
653 653
 		'<a href="%1$s">%2$s</a>',
654 654
 		$receipt_url,
655
-		esc_html__( 'View it in your browser &raquo;', 'give' )
655
+		esc_html__('View it in your browser &raquo;', 'give')
656 656
 	);
657 657
 
658
-	if ( give_get_option( 'email_template' ) !== 'none' ) {
658
+	if (give_get_option('email_template') !== 'none') {
659 659
 		return $formatted;
660 660
 	} else {
661 661
 		return $receipt_url;
@@ -674,12 +674,12 @@  discard block
 block discarded – undo
674 674
  *
675 675
  * @return string receipt_url
676 676
  */
677
-function give_email_tag_receipt_link_url( $payment_id ) {
677
+function give_email_tag_receipt_link_url($payment_id) {
678 678
 
679
-	$receipt_url = esc_url( add_query_arg( array(
680
-		'payment_key' => give_get_payment_key( $payment_id ),
679
+	$receipt_url = esc_url(add_query_arg(array(
680
+		'payment_key' => give_get_payment_key($payment_id),
681 681
 		'give_action' => 'view_receipt',
682
-	), home_url() ) );
682
+	), home_url()));
683 683
 
684 684
 	return $receipt_url;
685 685
 
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-email.php 2 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -79,13 +79,13 @@  discard block
 block discarded – undo
79 79
 							'default' => get_bloginfo( 'admin_email' ),
80 80
 							'type'    => 'text'
81 81
 						),
82
-                        array(
83
-                            'name'  => esc_html__( 'Email Settings Docs Link', 'give' ),
84
-                            'id'    => 'email_settings_docs_link',
85
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-emails' ),
86
-                            'title' => __( 'Email Settings', 'give' ),
87
-                            'type'  => 'give_docs_link',
88
-                        ),
82
+						array(
83
+							'name'  => esc_html__( 'Email Settings Docs Link', 'give' ),
84
+							'id'    => 'email_settings_docs_link',
85
+							'url'   => esc_url( 'http://docs.givewp.com/settings-emails' ),
86
+							'title' => __( 'Email Settings', 'give' ),
87
+							'type'  => 'give_docs_link',
88
+						),
89 89
 						array(
90 90
 							'id'   => 'give_title_email_settings_1',
91 91
 							'type' => 'sectionend'
@@ -118,13 +118,13 @@  discard block
 block discarded – undo
118 118
 							'type'    => 'wysiwyg',
119 119
 							'default' => give_get_default_donation_receipt_email()
120 120
 						),
121
-                        array(
122
-                            'name'  => esc_html__( 'Donation Receipt Settings Docs Link', 'give' ),
123
-                            'id'    => 'donation_receipt_settings_docs_link',
124
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-donation-receipt' ),
125
-                            'title' => __( 'Donation Receipt Settings', 'give' ),
126
-                            'type'  => 'give_docs_link',
127
-                        ),
121
+						array(
122
+							'name'  => esc_html__( 'Donation Receipt Settings Docs Link', 'give' ),
123
+							'id'    => 'donation_receipt_settings_docs_link',
124
+							'url'   => esc_url( 'http://docs.givewp.com/settings-donation-receipt' ),
125
+							'title' => __( 'Donation Receipt Settings', 'give' ),
126
+							'type'  => 'give_docs_link',
127
+						),
128 128
 						array(
129 129
 							'id'   => 'give_title_email_settings_2',
130 130
 							'type' => 'sectionend'
@@ -175,13 +175,13 @@  discard block
 block discarded – undo
175 175
 							'type'    => 'textarea',
176 176
 							'default' => get_bloginfo( 'admin_email' )
177 177
 						),
178
-                        array(
179
-                            'name'  => esc_html__( 'Donation Notification Settings Docs Link', 'give' ),
180
-                            'id'    => 'donation_notification_settings_docs_link',
181
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-donation-notification' ),
182
-                            'title' => __( 'Donation Notification Settings', 'give' ),
183
-                            'type'  => 'give_docs_link',
184
-                        ),
178
+						array(
179
+							'name'  => esc_html__( 'Donation Notification Settings Docs Link', 'give' ),
180
+							'id'    => 'donation_notification_settings_docs_link',
181
+							'url'   => esc_url( 'http://docs.givewp.com/settings-donation-notification' ),
182
+							'title' => __( 'Donation Notification Settings', 'give' ),
183
+							'type'  => 'give_docs_link',
184
+						),
185 185
 						array(
186 186
 							'id'   => 'give_title_email_settings_3',
187 187
 							'type' => 'sectionend'
Please login to merge, or discard this patch.
Spacing   +46 added lines, -46 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_Email' ) ) :
16
+if ( ! class_exists('Give_Settings_Email')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Email.
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		 */
28 28
 		public function __construct() {
29 29
 			$this->id    = 'emails';
30
-			$this->label = esc_html__( 'Emails', 'give' );
30
+			$this->label = esc_html__('Emails', 'give');
31 31
 
32 32
 			$this->default_tab = 'email-settings';
33 33
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			$settings = array();
45 45
 			$current_section = give_get_current_setting_section();
46 46
 
47
-			switch ( $current_section ) {
47
+			switch ($current_section) {
48 48
 				case 'email-settings' :
49 49
 					$settings = array(
50 50
 						// Section 1: Email
@@ -54,36 +54,36 @@  discard block
 block discarded – undo
54 54
 						),
55 55
 						array(
56 56
 							'id'      => 'email_template',
57
-							'name'    => esc_html__( 'Email Template', 'give' ),
58
-							'desc'    => esc_html__( 'Choose your template from the available registered template types.', 'give' ),
57
+							'name'    => esc_html__('Email Template', 'give'),
58
+							'desc'    => esc_html__('Choose your template from the available registered template types.', 'give'),
59 59
 							'type'    => 'select',
60 60
 							'options' => give_get_email_templates()
61 61
 						),
62 62
 						array(
63 63
 							'id'   => 'email_logo',
64
-							'name' => esc_html__( 'Logo', 'give' ),
65
-							'desc' => esc_html__( 'Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give' ),
64
+							'name' => esc_html__('Logo', 'give'),
65
+							'desc' => esc_html__('Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.', 'give'),
66 66
 							'type' => 'file'
67 67
 						),
68 68
 						array(
69 69
 							'id'      => 'from_name',
70
-							'name'    => esc_html__( 'From Name', 'give' ),
71
-							'desc'    => esc_html__( 'The name which appears in the "From" field in all Give donation emails.', 'give' ),
72
-							'default' => get_bloginfo( 'name' ),
70
+							'name'    => esc_html__('From Name', 'give'),
71
+							'desc'    => esc_html__('The name which appears in the "From" field in all Give donation emails.', 'give'),
72
+							'default' => get_bloginfo('name'),
73 73
 							'type'    => 'text'
74 74
 						),
75 75
 						array(
76 76
 							'id'      => 'from_email',
77
-							'name'    => esc_html__( 'From Email', 'give' ),
78
-							'desc'    => esc_html__( 'Email address from which all Give emails are sent from. This will act as the "from" and "reply-to" email address.', 'give' ),
79
-							'default' => get_bloginfo( 'admin_email' ),
77
+							'name'    => esc_html__('From Email', 'give'),
78
+							'desc'    => esc_html__('Email address from which all Give emails are sent from. This will act as the "from" and "reply-to" email address.', 'give'),
79
+							'default' => get_bloginfo('admin_email'),
80 80
 							'type'    => 'text'
81 81
 						),
82 82
                         array(
83
-                            'name'  => esc_html__( 'Email Settings Docs Link', 'give' ),
83
+                            'name'  => esc_html__('Email Settings Docs Link', 'give'),
84 84
                             'id'    => 'email_settings_docs_link',
85
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-emails' ),
86
-                            'title' => __( 'Email Settings', 'give' ),
85
+                            'url'   => esc_url('http://docs.givewp.com/settings-emails'),
86
+                            'title' => __('Email Settings', 'give'),
87 87
                             'type'  => 'give_docs_link',
88 88
                         ),
89 89
 						array(
@@ -102,27 +102,27 @@  discard block
 block discarded – undo
102 102
 						),
103 103
 						array(
104 104
 							'id'      => 'donation_subject',
105
-							'name'    => esc_html__( 'Donation Email Subject', 'give' ),
106
-							'desc'    => esc_html__( 'Enter the subject line for the donation receipt email.', 'give' ),
107
-							'default' => esc_attr__( 'Donation Receipt', 'give' ),
105
+							'name'    => esc_html__('Donation Email Subject', 'give'),
106
+							'desc'    => esc_html__('Enter the subject line for the donation receipt email.', 'give'),
107
+							'default' => esc_attr__('Donation Receipt', 'give'),
108 108
 							'type'    => 'text'
109 109
 						),
110 110
 						array(
111 111
 							'id'      => 'donation_receipt',
112
-							'name'    => esc_html__( 'Donation Receipt', 'give' ),
112
+							'name'    => esc_html__('Donation Receipt', 'give'),
113 113
 							'desc'    => sprintf(
114 114
 							/* translators: %s: emails tags list */
115
-								__( 'Enter the email that is sent to users after completing a successful donation. HTML is accepted.<br /><strong>Available template tags:</strong> %s', 'give' ),
115
+								__('Enter the email that is sent to users after completing a successful donation. HTML is accepted.<br /><strong>Available template tags:</strong> %s', 'give'),
116 116
 								'<br/>'.give_get_emails_tags_list()
117 117
 							),
118 118
 							'type'    => 'wysiwyg',
119 119
 							'default' => give_get_default_donation_receipt_email()
120 120
 						),
121 121
                         array(
122
-                            'name'  => esc_html__( 'Donation Receipt Settings Docs Link', 'give' ),
122
+                            'name'  => esc_html__('Donation Receipt Settings Docs Link', 'give'),
123 123
                             'id'    => 'donation_receipt_settings_docs_link',
124
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-donation-receipt' ),
125
-                            'title' => __( 'Donation Receipt Settings', 'give' ),
124
+                            'url'   => esc_url('http://docs.givewp.com/settings-donation-receipt'),
125
+                            'title' => __('Donation Receipt Settings', 'give'),
126 126
                             'type'  => 'give_docs_link',
127 127
                         ),
128 128
 						array(
@@ -141,28 +141,28 @@  discard block
 block discarded – undo
141 141
 						),
142 142
 						array(
143 143
 							'id'      => 'admin_notices',
144
-							'name'    => esc_html__( 'Admin Notifications', 'give' ),
145
-							'desc'    => esc_html__( 'Enable/Disable all admin notifications from Give completely.', 'give' ),
144
+							'name'    => esc_html__('Admin Notifications', 'give'),
145
+							'desc'    => esc_html__('Enable/Disable all admin notifications from Give completely.', 'give'),
146 146
 							'type'    => 'radio_inline',
147 147
 							'default' => 'enabled',
148 148
 							'options' => array(
149
-								'enabled'  => __( 'Enabled', 'give' ),
150
-								'disabled' => __( 'Disabled', 'give' ),
149
+								'enabled'  => __('Enabled', 'give'),
150
+								'disabled' => __('Disabled', 'give'),
151 151
 							)
152 152
 						),
153 153
 						array(
154 154
 							'id'      => 'donation_notification_subject',
155
-							'name'    => esc_html__( 'Donation Notification Subject', 'give' ),
156
-							'desc'    => esc_html__( 'Enter the subject line for the admin donation notification email.', 'give' ),
155
+							'name'    => esc_html__('Donation Notification Subject', 'give'),
156
+							'desc'    => esc_html__('Enter the subject line for the admin donation notification email.', 'give'),
157 157
 							'type'    => 'text',
158
-							'default' => esc_attr__( 'New Donation - #{payment_id}', 'give' )
158
+							'default' => esc_attr__('New Donation - #{payment_id}', 'give')
159 159
 						),
160 160
 						array(
161 161
 							'id'      => 'donation_notification',
162
-							'name'    => esc_html__( 'Donation Notification', 'give' ),
162
+							'name'    => esc_html__('Donation Notification', 'give'),
163 163
 							'desc'    => sprintf(
164 164
 							/* translators: %s: emails tags list */
165
-								__( 'Enter the content of the email that is sent to notify an admin of a new donation. HTML is accepted. <br /><strong>Available template tags:</strong> %s', 'give' ),
165
+								__('Enter the content of the email that is sent to notify an admin of a new donation. HTML is accepted. <br /><strong>Available template tags:</strong> %s', 'give'),
166 166
 								'<br/>'.give_get_emails_tags_list()
167 167
 							),
168 168
 							'type'    => 'wysiwyg',
@@ -170,16 +170,16 @@  discard block
 block discarded – undo
170 170
 						),
171 171
 						array(
172 172
 							'id'      => 'admin_notice_emails',
173
-							'name'    => esc_html__( 'Donation Notification Emails', 'give' ),
174
-							'desc'    => __( 'Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give' ),
173
+							'name'    => esc_html__('Donation Notification Emails', 'give'),
174
+							'desc'    => __('Enter the email address(es) that should receive a notification anytime a donation is made, please only enter <span class="give-underline">one email address per line</span> and <strong>not separated by commas</strong>.', 'give'),
175 175
 							'type'    => 'textarea',
176
-							'default' => get_bloginfo( 'admin_email' )
176
+							'default' => get_bloginfo('admin_email')
177 177
 						),
178 178
                         array(
179
-                            'name'  => esc_html__( 'Donation Notification Settings Docs Link', 'give' ),
179
+                            'name'  => esc_html__('Donation Notification Settings Docs Link', 'give'),
180 180
                             'id'    => 'donation_notification_settings_docs_link',
181
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-donation-notification' ),
182
-                            'title' => __( 'Donation Notification Settings', 'give' ),
181
+                            'url'   => esc_url('http://docs.givewp.com/settings-donation-notification'),
182
+                            'title' => __('Donation Notification Settings', 'give'),
183 183
                             'type'  => 'give_docs_link',
184 184
                         ),
185 185
 						array(
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 			 * Filter the emails settings.
195 195
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
196 196
 			 */
197
-			$settings = apply_filters( 'give_settings_emails', $settings );
197
+			$settings = apply_filters('give_settings_emails', $settings);
198 198
 
199 199
 			/**
200 200
 			 * Filter the settings.
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 			 * @since  1.8
203 203
 			 * @param  array $settings
204 204
 			 */
205
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
205
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
206 206
 
207 207
 			// Output.
208 208
 			return $settings;
@@ -216,12 +216,12 @@  discard block
 block discarded – undo
216 216
 		 */
217 217
 		public function get_sections() {
218 218
 			$sections = array(
219
-				'email-settings'            => esc_html__( 'Email Settings', 'give' ),
220
-				'donation-receipt'          => esc_html__( 'Donation Receipt', 'give' ),
221
-				'new-donation-notification' => esc_html__( 'New Donation Notification', 'give' )
219
+				'email-settings'            => esc_html__('Email Settings', 'give'),
220
+				'donation-receipt'          => esc_html__('Donation Receipt', 'give'),
221
+				'new-donation-notification' => esc_html__('New Donation Notification', 'give')
222 222
 			);
223 223
 
224
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
224
+			return apply_filters('give_get_sections_'.$this->id, $sections);
225 225
 		}
226 226
 	}
227 227
 
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-profile-editor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly.
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
 	 */
22 22
 	public function __construct() {
23 23
 
24
-		$this->shortcode['label'] = esc_html__( 'Profile Editor', 'give' );
24
+		$this->shortcode['label'] = esc_html__('Profile Editor', 'give');
25 25
 
26
-		parent::__construct( 'give_profile_editor' );
26
+		parent::__construct('give_profile_editor');
27 27
 	}
28 28
 }
29 29
 
Please login to merge, or discard this patch.