Completed
Push — master ( 89d8cc...8c1fe0 )
by Devin
13s
created
includes/actions.php 1 patch
Spacing   +41 added lines, -41 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
 
@@ -25,14 +25,14 @@  discard block
 block discarded – undo
25 25
  */
26 26
 function give_get_actions() {
27 27
 
28
-	$_get_action = ! empty( $_GET['give_action'] ) ? $_GET['give_action'] : null;
28
+	$_get_action = ! empty($_GET['give_action']) ? $_GET['give_action'] : null;
29 29
 
30 30
 	// Add backward compatibility to give-action param ( $_GET )
31
-	if(  empty( $_get_action ) ) {
32
-		$_get_action = ! empty( $_GET['give-action'] ) ? $_GET['give-action'] : null;
31
+	if (empty($_get_action)) {
32
+		$_get_action = ! empty($_GET['give-action']) ? $_GET['give-action'] : null;
33 33
 	}
34 34
 
35
-	if ( isset( $_get_action ) ) {
35
+	if (isset($_get_action)) {
36 36
 		/**
37 37
 		 * Fires in WordPress init or admin init, when give_action is present in $_GET.
38 38
 		 *
@@ -40,12 +40,12 @@  discard block
 block discarded – undo
40 40
 		 *
41 41
 		 * @param array $_GET Array of HTTP GET variables.
42 42
 		 */
43
-		do_action( "give_{$_get_action}", $_GET );
43
+		do_action("give_{$_get_action}", $_GET);
44 44
 	}
45 45
 
46 46
 }
47 47
 
48
-add_action( 'init', 'give_get_actions' );
48
+add_action('init', 'give_get_actions');
49 49
 
50 50
 /**
51 51
  * Hooks Give actions, when present in the $_POST super global. Every give_action
@@ -58,15 +58,15 @@  discard block
 block discarded – undo
58 58
  */
59 59
 function give_post_actions() {
60 60
 
61
-	$_post_action = ! empty( $_POST['give_action'] ) ? $_POST['give_action'] : null;
61
+	$_post_action = ! empty($_POST['give_action']) ? $_POST['give_action'] : null;
62 62
 
63 63
 
64 64
 	// Add backward compatibility to give-action param ( $_POST )
65
-	if(  empty( $_post_action ) ) {
66
-		$_post_action = ! empty( $_POST['give-action'] ) ? $_POST['give-action'] : null;
65
+	if (empty($_post_action)) {
66
+		$_post_action = ! empty($_POST['give-action']) ? $_POST['give-action'] : null;
67 67
 	}
68 68
 
69
-	if ( isset( $_post_action ) ) {
69
+	if (isset($_post_action)) {
70 70
 		/**
71 71
 		 * Fires in WordPress init or admin init, when give_action is present in $_POST.
72 72
 		 *
@@ -74,12 +74,12 @@  discard block
 block discarded – undo
74 74
 		 *
75 75
 		 * @param array $_POST Array of HTTP POST variables.
76 76
 		 */
77
-		do_action( "give_{$_post_action}", $_POST );
77
+		do_action("give_{$_post_action}", $_POST);
78 78
 	}
79 79
 
80 80
 }
81 81
 
82
-add_action( 'init', 'give_post_actions' );
82
+add_action('init', 'give_post_actions');
83 83
 
84 84
 /**
85 85
  * Connect WordPress user with Donor.
@@ -89,28 +89,28 @@  discard block
 block discarded – undo
89 89
  * @param  array $user_data User Data
90 90
  * @return void
91 91
  */
92
-function give_connect_donor_to_wpuser( $user_id, $user_data ){
92
+function give_connect_donor_to_wpuser($user_id, $user_data) {
93 93
 	/* @var Give_Customer $donor */
94
-	$donor = new Give_Customer( $user_data['user_email'] );
94
+	$donor = new Give_Customer($user_data['user_email']);
95 95
 
96 96
 	// Validate donor id and check if do nor is already connect to wp user or not.
97
-	if( $donor->id && ! $donor->user_id ) {
97
+	if ($donor->id && ! $donor->user_id) {
98 98
 
99 99
 		// Update donor user_id.
100
-		if( $donor->update( array( 'user_id' => $user_id ) ) ) {
101
-			$donor_note = sprintf( esc_html__( 'WordPress user #%d is connected to #%d', 'give' ), $user_id, $donor->id );
102
-			$donor->add_note( $donor_note );
100
+		if ($donor->update(array('user_id' => $user_id))) {
101
+			$donor_note = sprintf(esc_html__('WordPress user #%d is connected to #%d', 'give'), $user_id, $donor->id);
102
+			$donor->add_note($donor_note);
103 103
 
104 104
 			// Update user_id meta in payments.
105
-			if( ! empty( $donor->payment_ids ) && ( $donations = explode( ',', $donor->payment_ids ) ) ) {
106
-				foreach ( $donations as $donation  ) {
107
-					update_post_meta( $donation, '_give_payment_user_id', $user_id );
105
+			if ( ! empty($donor->payment_ids) && ($donations = explode(',', $donor->payment_ids))) {
106
+				foreach ($donations as $donation) {
107
+					update_post_meta($donation, '_give_payment_user_id', $user_id);
108 108
 				}
109 109
 			}
110 110
 		}
111 111
 	}
112 112
 }
113
-add_action( 'give_insert_user', 'give_connect_donor_to_wpuser', 10, 2 );
113
+add_action('give_insert_user', 'give_connect_donor_to_wpuser', 10, 2);
114 114
 
115 115
 
116 116
 /**
@@ -124,24 +124,24 @@  discard block
 block discarded – undo
124 124
 function give_validate_license_when_site_migrated() {
125 125
 	// Store current site address if not already stored.
126 126
 	$homeurl = home_url();
127
-	if( ! get_option( 'give_site_address_before_migrate' ) ) {
127
+	if ( ! get_option('give_site_address_before_migrate')) {
128 128
 		// Update site address.
129
-		update_option( 'give_site_address_before_migrate', $homeurl );
129
+		update_option('give_site_address_before_migrate', $homeurl);
130 130
 
131 131
 		return;
132 132
 	}
133 133
 
134
-	if( $homeurl !== get_option( 'give_site_address_before_migrate' ) ) {
134
+	if ($homeurl !== get_option('give_site_address_before_migrate')) {
135 135
 		// Immediately run cron.
136
-		wp_schedule_single_event( time() , 'give_validate_license_when_site_migrated' );
136
+		wp_schedule_single_event(time(), 'give_validate_license_when_site_migrated');
137 137
 
138 138
 		// Update site address.
139
-		update_option( 'give_site_address_before_migrate', home_url() );
139
+		update_option('give_site_address_before_migrate', home_url());
140 140
 	}
141 141
 
142 142
 }
143
-add_action( 'init', 'give_validate_license_when_site_migrated' );
144
-add_action( 'admin_init', 'give_validate_license_when_site_migrated' );
143
+add_action('init', 'give_validate_license_when_site_migrated');
144
+add_action('admin_init', 'give_validate_license_when_site_migrated');
145 145
 
146 146
 
147 147
 /**
@@ -150,18 +150,18 @@  discard block
 block discarded – undo
150 150
  * @since 1.8
151 151
  * @param $data
152 152
  */
153
-function give_donor_batch_export_complete( $data ) {
153
+function give_donor_batch_export_complete($data) {
154 154
 	// Remove donor ids cache.
155
-	if(
156
-		isset( $data['class'] )
155
+	if (
156
+		isset($data['class'])
157 157
 		&& 'Give_Batch_Customers_Export' === $data['class']
158
-		&& ! empty( $data['forms'] )
159
-		&& isset( $data['give_export_option']['query_id'] )
158
+		&& ! empty($data['forms'])
159
+		&& isset($data['give_export_option']['query_id'])
160 160
 	) {
161
-		Give_Cache::delete( Give_Cache::get_key( $data['give_export_option']['query_id'] ) );
161
+		Give_Cache::delete(Give_Cache::get_key($data['give_export_option']['query_id']));
162 162
 	}
163 163
 }
164
-add_action('give_file_export_complete', 'give_donor_batch_export_complete' );
164
+add_action('give_file_export_complete', 'give_donor_batch_export_complete');
165 165
 
166 166
 /**
167 167
  * Print css for wordpress setting pages.
@@ -172,12 +172,12 @@  discard block
 block discarded – undo
172 172
 	/* @var WP_Screen $screen */
173 173
 	$screen = get_current_screen();
174 174
 
175
-	if( ! ( $screen instanceof WP_Screen ) ) {
175
+	if ( ! ($screen instanceof WP_Screen)) {
176 176
 		return false;
177 177
 	}
178 178
 
179
-	switch ( true ) {
180
-		case ( 'plugins' === $screen->base ):
179
+	switch (true) {
180
+		case ('plugins' === $screen->base):
181 181
 			?>
182 182
 			<style>
183 183
 				tr.active.update + tr.give-addon-notice-tr td{
@@ -210,4 +210,4 @@  discard block
 block discarded – undo
210 210
 			<?php
211 211
 	}
212 212
 }
213
-add_action( 'admin_head', 'give_admin_quick_css' );
213
+add_action('admin_head', 'give_admin_quick_css');
Please login to merge, or discard this patch.
admin/reporting/tools/class-give-tools-delete-test-transactions.php 1 patch
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  */
12 12
 
13 13
 // Exit if accessed directly.
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit;
16 16
 }
17 17
 
@@ -55,22 +55,22 @@  discard block
 block discarded – undo
55 55
 	public function get_data() {
56 56
 		global $wpdb;
57 57
 
58
-		$items = $this->get_stored_data( 'give_temp_reset_test_ids' );
58
+		$items = $this->get_stored_data('give_temp_reset_test_ids');
59 59
 
60
-		if ( ! is_array( $items ) ) {
60
+		if ( ! is_array($items)) {
61 61
 			return false;
62 62
 		}
63 63
 
64
-		$offset     = ( $this->step - 1 ) * $this->per_step;
65
-		$step_items = array_slice( $items, $offset, $this->per_step );
64
+		$offset     = ($this->step - 1) * $this->per_step;
65
+		$step_items = array_slice($items, $offset, $this->per_step);
66 66
 
67
-		if ( $step_items ) {
67
+		if ($step_items) {
68 68
 
69 69
 			$step_ids = array(
70 70
 				'other' => array(),
71 71
 			);
72 72
 
73
-			foreach ( $step_items as $item ) {
73
+			foreach ($step_items as $item) {
74 74
 
75 75
 				$step_ids['other'][] = $item['id'];
76 76
 
@@ -78,15 +78,15 @@  discard block
 block discarded – undo
78 78
 
79 79
 			$sql = array();
80 80
 
81
-			foreach ( $step_ids as $type => $ids ) {
81
+			foreach ($step_ids as $type => $ids) {
82 82
 
83
-				if ( empty( $ids ) ) {
83
+				if (empty($ids)) {
84 84
 					continue;
85 85
 				}
86 86
 
87
-				$ids = implode( ',', $ids );
87
+				$ids = implode(',', $ids);
88 88
 
89
-				switch ( $type ) {
89
+				switch ($type) {
90 90
 					case 'other':
91 91
 						$sql[] = "DELETE FROM $wpdb->posts WHERE id IN ($ids)";
92 92
 						$sql[] = "DELETE FROM $wpdb->postmeta WHERE post_id IN ($ids)";
@@ -97,9 +97,9 @@  discard block
 block discarded – undo
97 97
 
98 98
 			}
99 99
 
100
-			if ( ! empty( $sql ) ) {
101
-				foreach ( $sql as $query ) {
102
-					$wpdb->query( $query );
100
+			if ( ! empty($sql)) {
101
+				foreach ($sql as $query) {
102
+					$wpdb->query($query);
103 103
 				}
104 104
 			}
105 105
 
@@ -119,16 +119,16 @@  discard block
 block discarded – undo
119 119
 	 */
120 120
 	public function get_percentage_complete() {
121 121
 
122
-		$items = $this->get_stored_data( 'give_temp_delete_test_ids', false );
123
-		$total = count( $items );
122
+		$items = $this->get_stored_data('give_temp_delete_test_ids', false);
123
+		$total = count($items);
124 124
 
125 125
 		$percentage = 100;
126 126
 
127
-		if ( $total > 0 ) {
128
-			$percentage = ( ( $this->per_step * $this->step ) / $total ) * 100;
127
+		if ($total > 0) {
128
+			$percentage = (($this->per_step * $this->step) / $total) * 100;
129 129
 		}
130 130
 
131
-		if ( $percentage > 100 ) {
131
+		if ($percentage > 100) {
132 132
 			$percentage = 100;
133 133
 		}
134 134
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	 *
143 143
 	 * @param array $request The Form Data passed into the batch processing
144 144
 	 */
145
-	public function set_properties( $request ) {
145
+	public function set_properties($request) {
146 146
 	}
147 147
 
148 148
 	/**
@@ -153,29 +153,29 @@  discard block
 block discarded – undo
153 153
 	 */
154 154
 	public function process_step() {
155 155
 
156
-		if ( ! $this->can_export() ) {
157
-			wp_die( __( 'You do not have permission to delete test transactions.', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) );
156
+		if ( ! $this->can_export()) {
157
+			wp_die(__('You do not have permission to delete test transactions.', 'give'), __('Error', 'give'), array('response' => 403));
158 158
 		}
159 159
 
160 160
 		$had_data = $this->get_data();
161 161
 
162
-		if ( $had_data ) {
162
+		if ($had_data) {
163 163
 			$this->done = false;
164 164
 
165 165
 			return true;
166 166
 		} else {
167
-			update_option( 'give_earnings_total', give_get_total_earnings( true ) );
168
-			Give_Cache::delete( Give_Cache::get_key('give_estimated_monthly_stats' ) );
167
+			update_option('give_earnings_total', give_get_total_earnings(true));
168
+			Give_Cache::delete(Give_Cache::get_key('give_estimated_monthly_stats'));
169 169
 
170
-			$this->delete_data( 'give_temp_delete_test_ids' );
170
+			$this->delete_data('give_temp_delete_test_ids');
171 171
 
172 172
 			// Reset the sequential order numbers
173
-			if ( give_get_option( 'enable_sequential' ) ) {
174
-				delete_option( 'give_last_payment_number' );
173
+			if (give_get_option('enable_sequential')) {
174
+				delete_option('give_last_payment_number');
175 175
 			}
176 176
 
177 177
 			$this->done    = true;
178
-			$this->message = __( 'Test transactions successfully deleted.', 'give' );
178
+			$this->message = __('Test transactions successfully deleted.', 'give');
179 179
 
180 180
 			return false;
181 181
 		}
@@ -185,10 +185,10 @@  discard block
 block discarded – undo
185 185
 	 * Headers
186 186
 	 */
187 187
 	public function headers() {
188
-		ignore_user_abort( true );
188
+		ignore_user_abort(true);
189 189
 
190
-		if ( ! give_is_func_disabled( 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) {
191
-			set_time_limit( 0 );
190
+		if ( ! give_is_func_disabled('set_time_limit') && ! ini_get('safe_mode')) {
191
+			set_time_limit(0);
192 192
 		}
193 193
 	}
194 194
 
@@ -212,26 +212,26 @@  discard block
 block discarded – undo
212 212
 	 */
213 213
 	public function pre_fetch() {
214 214
 
215
-		if ( $this->step == 1 ) {
216
-			$this->delete_data( 'give_temp_delete_test_ids' );
215
+		if ($this->step == 1) {
216
+			$this->delete_data('give_temp_delete_test_ids');
217 217
 		}
218 218
 
219
-		$items = get_option( 'give_temp_delete_test_ids', false );
219
+		$items = get_option('give_temp_delete_test_ids', false);
220 220
 
221
-		if ( false === $items ) {
221
+		if (false === $items) {
222 222
 			$items = array();
223 223
 
224
-			$args = apply_filters( 'give_tools_reset_stats_total_args', array(
224
+			$args = apply_filters('give_tools_reset_stats_total_args', array(
225 225
 				'post_type'      => 'give_payment',
226 226
 				'post_status'    => 'any',
227
-				'posts_per_page' => - 1,
227
+				'posts_per_page' => -1,
228 228
 				// ONLY TEST MODE TRANSACTIONS!!!
229 229
 				'meta_key'   => '_give_payment_mode',
230 230
 				'meta_value' => 'test'
231
-			) );
231
+			));
232 232
 
233
-			$posts = get_posts( $args );
234
-			foreach ( $posts as $post ) {
233
+			$posts = get_posts($args);
234
+			foreach ($posts as $post) {
235 235
 				$items[] = array(
236 236
 					'id'   => (int) $post->ID,
237 237
 					'type' => $post->post_type,
@@ -240,9 +240,9 @@  discard block
 block discarded – undo
240 240
 
241 241
 			// Allow filtering of items to remove with an unassociative array for each item.
242 242
 			// The array contains the unique ID of the item, and a 'type' for you to use in the execution of the get_data method.
243
-			$items = apply_filters( 'give_delete_test_items', $items );
243
+			$items = apply_filters('give_delete_test_items', $items);
244 244
 
245
-			$this->store_data( 'give_temp_delete_test_ids', $items );
245
+			$this->store_data('give_temp_delete_test_ids', $items);
246 246
 		}
247 247
 
248 248
 	}
@@ -256,11 +256,11 @@  discard block
 block discarded – undo
256 256
 	 *
257 257
 	 * @return mixed       Returns the data from the database
258 258
 	 */
259
-	private function get_stored_data( $key ) {
259
+	private function get_stored_data($key) {
260 260
 		global $wpdb;
261
-		$value = $wpdb->get_var( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = '%s'", $key ) );
261
+		$value = $wpdb->get_var($wpdb->prepare("SELECT option_value FROM $wpdb->options WHERE option_name = '%s'", $key));
262 262
 
263
-		return empty( $value ) ? false : maybe_unserialize( $value );
263
+		return empty($value) ? false : maybe_unserialize($value);
264 264
 	}
265 265
 
266 266
 	/**
@@ -273,10 +273,10 @@  discard block
 block discarded – undo
273 273
 	 *
274 274
 	 * @return void
275 275
 	 */
276
-	private function store_data( $key, $value ) {
276
+	private function store_data($key, $value) {
277 277
 		global $wpdb;
278 278
 
279
-		$value = maybe_serialize( $value );
279
+		$value = maybe_serialize($value);
280 280
 
281 281
 		$data = array(
282 282
 			'option_name'  => $key,
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 			'%s',
291 291
 		);
292 292
 
293
-		$wpdb->replace( $wpdb->options, $data, $formats );
293
+		$wpdb->replace($wpdb->options, $data, $formats);
294 294
 	}
295 295
 
296 296
 	/**
@@ -302,9 +302,9 @@  discard block
 block discarded – undo
302 302
 	 *
303 303
 	 * @return void
304 304
 	 */
305
-	private function delete_data( $key ) {
305
+	private function delete_data($key) {
306 306
 		global $wpdb;
307
-		$wpdb->delete( $wpdb->options, array( 'option_name' => $key ) );
307
+		$wpdb->delete($wpdb->options, array('option_name' => $key));
308 308
 	}
309 309
 
310 310
 }
Please login to merge, or discard this patch.
includes/admin/plugins.php 1 patch
Spacing   +16 added lines, -16 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
 
@@ -23,19 +23,19 @@  discard block
 block discarded – undo
23 23
  *
24 24
  * @return array An array of updated action links.
25 25
  */
26
-function give_plugin_action_links( $actions ) {
26
+function give_plugin_action_links($actions) {
27 27
 	$new_actions = array(
28 28
 		'settings' => sprintf(
29 29
 			'<a href="%1$s">%2$s</a>',
30
-			admin_url( 'edit.php?post_type=give_forms&page=give-settings' ),
31
-			__( 'Settings', 'give' )
30
+			admin_url('edit.php?post_type=give_forms&page=give-settings'),
31
+			__('Settings', 'give')
32 32
 		),
33 33
 	);
34 34
 
35
-	return array_merge( $new_actions, $actions );
35
+	return array_merge($new_actions, $actions);
36 36
 }
37 37
 
38
-add_filter( 'plugin_action_links_' . GIVE_PLUGIN_BASENAME, 'give_plugin_action_links' );
38
+add_filter('plugin_action_links_'.GIVE_PLUGIN_BASENAME, 'give_plugin_action_links');
39 39
 
40 40
 
41 41
 /**
@@ -48,35 +48,35 @@  discard block
 block discarded – undo
48 48
  *
49 49
  * @return array
50 50
  */
51
-function give_plugin_row_meta( $plugin_meta, $plugin_file ) {
52
-	if ( $plugin_file != GIVE_PLUGIN_BASENAME ) {
51
+function give_plugin_row_meta($plugin_meta, $plugin_file) {
52
+	if ($plugin_file != GIVE_PLUGIN_BASENAME) {
53 53
 		return $plugin_meta;
54 54
 	}
55 55
 
56 56
 	$new_meta_links = array(
57 57
 		sprintf(
58 58
 			'<a href="%1$s" target="_blank">%2$s</a>',
59
-			esc_url( add_query_arg( array(
59
+			esc_url(add_query_arg(array(
60 60
 					'utm_source'   => 'plugins-page',
61 61
 					'utm_medium'   => 'plugin-row',
62 62
 					'utm_campaign' => 'admin',
63
-				), 'https://givewp.com/documentation/' )
63
+				), 'https://givewp.com/documentation/')
64 64
 			),
65
-			__( 'Documentation', 'give' )
65
+			__('Documentation', 'give')
66 66
 		),
67 67
 		sprintf(
68 68
 			'<a href="%1$s" target="_blank">%2$s</a>',
69
-			esc_url( add_query_arg( array(
69
+			esc_url(add_query_arg(array(
70 70
 					'utm_source'   => 'plugins-page',
71 71
 					'utm_medium'   => 'plugin-row',
72 72
 					'utm_campaign' => 'admin',
73
-				), 'https://givewp.com/addons/' )
73
+				), 'https://givewp.com/addons/')
74 74
 			),
75
-			__( 'Add-ons', 'give' )
75
+			__('Add-ons', 'give')
76 76
 		),
77 77
 	);
78 78
 
79
-	return array_merge( $plugin_meta, $new_meta_links );
79
+	return array_merge($plugin_meta, $new_meta_links);
80 80
 }
81 81
 
82
-add_filter( 'plugin_row_meta', 'give_plugin_row_meta', 10, 2 );
82
+add_filter('plugin_row_meta', 'give_plugin_row_meta', 10, 2);
Please login to merge, or discard this patch.
includes/user-functions.php 1 patch
Spacing   +125 added lines, -125 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly.
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
@@ -30,36 +30,36 @@  discard block
 block discarded – undo
30 30
  *
31 31
  * @return bool|object List of all user donations
32 32
  */
33
-function give_get_users_purchases( $user = 0, $number = 20, $pagination = false, $status = 'complete' ) {
33
+function give_get_users_purchases($user = 0, $number = 20, $pagination = false, $status = 'complete') {
34 34
 
35
-	if ( empty( $user ) ) {
35
+	if (empty($user)) {
36 36
 		$user = get_current_user_id();
37 37
 	}
38 38
 
39
-	if ( 0 === $user && ! Give()->email_access->token_exists ) {
39
+	if (0 === $user && ! Give()->email_access->token_exists) {
40 40
 		return false;
41 41
 	}
42 42
 
43 43
 	$status = $status === 'complete' ? 'publish' : $status;
44 44
 
45
-	if ( $pagination ) {
46
-		if ( get_query_var( 'paged' ) ) {
47
-			$paged = get_query_var( 'paged' );
48
-		} elseif ( get_query_var( 'page' ) ) {
49
-			$paged = get_query_var( 'page' );
45
+	if ($pagination) {
46
+		if (get_query_var('paged')) {
47
+			$paged = get_query_var('paged');
48
+		} elseif (get_query_var('page')) {
49
+			$paged = get_query_var('page');
50 50
 		} else {
51 51
 			$paged = 1;
52 52
 		}
53 53
 	}
54 54
 
55
-	$args = apply_filters( 'give_get_users_donations_args', array(
55
+	$args = apply_filters('give_get_users_donations_args', array(
56 56
 		'user'    => $user,
57 57
 		'number'  => $number,
58 58
 		'status'  => $status,
59 59
 		'orderby' => 'date',
60
-	) );
60
+	));
61 61
 
62
-	if ( $pagination ) {
62
+	if ($pagination) {
63 63
 
64 64
 		$args['page'] = $paged;
65 65
 
@@ -69,20 +69,20 @@  discard block
 block discarded – undo
69 69
 
70 70
 	}
71 71
 
72
-	$by_user_id = is_numeric( $user ) ? true : false;
73
-	$customer   = new Give_Customer( $user, $by_user_id );
72
+	$by_user_id = is_numeric($user) ? true : false;
73
+	$customer   = new Give_Customer($user, $by_user_id);
74 74
 
75
-	if ( ! empty( $customer->payment_ids ) ) {
75
+	if ( ! empty($customer->payment_ids)) {
76 76
 
77
-		unset( $args['user'] );
78
-		$args['post__in'] = array_map( 'absint', explode( ',', $customer->payment_ids ) );
77
+		unset($args['user']);
78
+		$args['post__in'] = array_map('absint', explode(',', $customer->payment_ids));
79 79
 
80 80
 	}
81 81
 
82
-	$purchases = give_get_payments( apply_filters( 'give_get_users_donations_args', $args ) );
82
+	$purchases = give_get_payments(apply_filters('give_get_users_donations_args', $args));
83 83
 
84 84
 	// No donations
85
-	if ( ! $purchases ) {
85
+	if ( ! $purchases) {
86 86
 		return false;
87 87
 	}
88 88
 
@@ -101,65 +101,65 @@  discard block
 block discarded – undo
101 101
  *
102 102
  * @return bool|object List of unique forms donated by user
103 103
  */
104
-function give_get_users_completed_donations( $user = 0, $status = 'complete' ) {
105
-	if ( empty( $user ) ) {
104
+function give_get_users_completed_donations($user = 0, $status = 'complete') {
105
+	if (empty($user)) {
106 106
 		$user = get_current_user_id();
107 107
 	}
108 108
 
109
-	if ( empty( $user ) ) {
109
+	if (empty($user)) {
110 110
 		return false;
111 111
 	}
112 112
 
113
-	$by_user_id = is_numeric( $user ) ? true : false;
113
+	$by_user_id = is_numeric($user) ? true : false;
114 114
 
115
-	$customer = new Give_Customer( $user, $by_user_id );
115
+	$customer = new Give_Customer($user, $by_user_id);
116 116
 
117
-	if ( empty( $customer->payment_ids ) ) {
117
+	if (empty($customer->payment_ids)) {
118 118
 		return false;
119 119
 	}
120 120
 
121 121
 	// Get all the items donated
122
-	$payment_ids    = array_reverse( explode( ',', $customer->payment_ids ) );
123
-	$limit_payments = apply_filters( 'give_users_completed_donations_payments', 50 );
124
-	if ( ! empty( $limit_payments ) ) {
125
-		$payment_ids = array_slice( $payment_ids, 0, $limit_payments );
122
+	$payment_ids    = array_reverse(explode(',', $customer->payment_ids));
123
+	$limit_payments = apply_filters('give_users_completed_donations_payments', 50);
124
+	if ( ! empty($limit_payments)) {
125
+		$payment_ids = array_slice($payment_ids, 0, $limit_payments);
126 126
 	}
127 127
 	$donation_data = array();
128
-	foreach ( $payment_ids as $payment_id ) {
129
-		$donation_data[] = give_get_payment_meta( $payment_id );
128
+	foreach ($payment_ids as $payment_id) {
129
+		$donation_data[] = give_get_payment_meta($payment_id);
130 130
 	}
131 131
 
132
-	if ( empty( $donation_data ) ) {
132
+	if (empty($donation_data)) {
133 133
 		return false;
134 134
 	}
135 135
 
136 136
 	// Grab only the post ids "form_id" of the forms donated on this order
137 137
 	$completed_donations_ids = array();
138
-	foreach ( $donation_data as $purchase_meta ) {
139
-		$completed_donations_ids[] = isset( $purchase_meta['form_id'] ) ? $purchase_meta['form_id'] : '';
138
+	foreach ($donation_data as $purchase_meta) {
139
+		$completed_donations_ids[] = isset($purchase_meta['form_id']) ? $purchase_meta['form_id'] : '';
140 140
 	}
141 141
 
142
-	if ( empty( $completed_donations_ids ) ) {
142
+	if (empty($completed_donations_ids)) {
143 143
 		return false;
144 144
 	}
145 145
 
146 146
 	// Only include each donation once
147
-	$form_ids = array_unique( $completed_donations_ids );
147
+	$form_ids = array_unique($completed_donations_ids);
148 148
 
149 149
 	// Make sure we still have some products and a first item
150
-	if ( empty( $form_ids ) || ! isset( $form_ids[0] ) ) {
150
+	if (empty($form_ids) || ! isset($form_ids[0])) {
151 151
 		return false;
152 152
 	}
153 153
 
154
-	$post_type = get_post_type( $form_ids[0] );
154
+	$post_type = get_post_type($form_ids[0]);
155 155
 
156
-	$args = apply_filters( 'give_get_users_completed_donations_args', array(
156
+	$args = apply_filters('give_get_users_completed_donations_args', array(
157 157
 		'include'        => $form_ids,
158 158
 		'post_type'      => $post_type,
159
-		'posts_per_page' => - 1,
160
-	) );
159
+		'posts_per_page' => -1,
160
+	));
161 161
 
162
-	return apply_filters( 'give_users_completed_donations_list', get_posts( $args ) );
162
+	return apply_filters('give_users_completed_donations_list', get_posts($args));
163 163
 }
164 164
 
165 165
 
@@ -175,12 +175,12 @@  discard block
 block discarded – undo
175 175
  *
176 176
  * @return      bool True if has donated, false other wise.
177 177
  */
178
-function give_has_purchases( $user_id = null ) {
179
-	if ( empty( $user_id ) ) {
178
+function give_has_purchases($user_id = null) {
179
+	if (empty($user_id)) {
180 180
 		$user_id = get_current_user_id();
181 181
 	}
182 182
 
183
-	if ( give_get_users_purchases( $user_id, 1 ) ) {
183
+	if (give_get_users_purchases($user_id, 1)) {
184 184
 		return true; // User has at least one donation
185 185
 	}
186 186
 
@@ -200,27 +200,27 @@  discard block
 block discarded – undo
200 200
  *
201 201
  * @return      array
202 202
  */
203
-function give_get_purchase_stats_by_user( $user = '' ) {
203
+function give_get_purchase_stats_by_user($user = '') {
204 204
 
205
-	if ( is_email( $user ) ) {
205
+	if (is_email($user)) {
206 206
 
207 207
 		$field = 'email';
208 208
 
209
-	} elseif ( is_numeric( $user ) ) {
209
+	} elseif (is_numeric($user)) {
210 210
 
211 211
 		$field = 'user_id';
212 212
 
213 213
 	}
214 214
 
215 215
 	$stats    = array();
216
-	$customer = Give()->customers->get_customer_by( $field, $user );
216
+	$customer = Give()->customers->get_customer_by($field, $user);
217 217
 
218
-	if ( $customer ) {
218
+	if ($customer) {
219 219
 
220
-		$customer = new Give_Customer( $customer->id );
220
+		$customer = new Give_Customer($customer->id);
221 221
 
222
-		$stats['purchases']   = absint( $customer->purchase_count );
223
-		$stats['total_spent'] = give_sanitize_amount( $customer->purchase_value );
222
+		$stats['purchases']   = absint($customer->purchase_count);
223
+		$stats['total_spent'] = give_sanitize_amount($customer->purchase_value);
224 224
 
225 225
 	}
226 226
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 	 *
230 230
 	 * @since 1.7
231 231
 	 */
232
-	$stats = (array) apply_filters( 'give_donation_stats_by_user', $stats, $user );
232
+	$stats = (array) apply_filters('give_donation_stats_by_user', $stats, $user);
233 233
 
234 234
 	return $stats;
235 235
 }
@@ -247,21 +247,21 @@  discard block
 block discarded – undo
247 247
  *
248 248
  * @return      int The total number of donations
249 249
  */
250
-function give_count_purchases_of_customer( $user = null ) {
250
+function give_count_purchases_of_customer($user = null) {
251 251
 
252 252
 	// Logged in?
253
-	if ( empty( $user ) ) {
253
+	if (empty($user)) {
254 254
 		$user = get_current_user_id();
255 255
 	}
256 256
 
257 257
 	// Email access?
258
-	if ( empty( $user ) && Give()->email_access->token_email ) {
258
+	if (empty($user) && Give()->email_access->token_email) {
259 259
 		$user = Give()->email_access->token_email;
260 260
 	}
261 261
 
262
-	$stats = ! empty( $user ) ? give_get_purchase_stats_by_user( $user ) : false;
262
+	$stats = ! empty($user) ? give_get_purchase_stats_by_user($user) : false;
263 263
 
264
-	return isset( $stats['purchases'] ) ? $stats['purchases'] : 0;
264
+	return isset($stats['purchases']) ? $stats['purchases'] : 0;
265 265
 }
266 266
 
267 267
 /**
@@ -274,9 +274,9 @@  discard block
 block discarded – undo
274 274
  *
275 275
  * @return      float The total amount the user has spent
276 276
  */
277
-function give_purchase_total_of_user( $user = null ) {
277
+function give_purchase_total_of_user($user = null) {
278 278
 
279
-	$stats = give_get_purchase_stats_by_user( $user );
279
+	$stats = give_get_purchase_stats_by_user($user);
280 280
 
281 281
 	return $stats['total_spent'];
282 282
 }
@@ -292,40 +292,40 @@  discard block
 block discarded – undo
292 292
  *
293 293
  * @return bool
294 294
  */
295
-function give_validate_username( $username, $form_id = 0 ) {
295
+function give_validate_username($username, $form_id = 0) {
296 296
 	$valid = true;
297 297
 
298 298
 	// Validate username.
299
-	if ( ! empty( $username ) ) {
299
+	if ( ! empty($username)) {
300 300
 
301 301
 		// Sanitize username.
302
-		$sanitized_user_name = sanitize_user( $username, false );
302
+		$sanitized_user_name = sanitize_user($username, false);
303 303
 
304 304
 		// We have an user name, check if it already exists.
305
-		if ( username_exists( $username ) ) {
305
+		if (username_exists($username)) {
306 306
 			// Username already registered.
307
-			give_set_error( 'username_unavailable', __( 'Username already taken.', 'give' ) );
307
+			give_set_error('username_unavailable', __('Username already taken.', 'give'));
308 308
 			$valid = false;
309 309
 
310 310
 			// Check if it's valid.
311
-		} elseif ( $sanitized_user_name !== $username ) {
311
+		} elseif ($sanitized_user_name !== $username) {
312 312
 			// Invalid username.
313
-			if ( is_multisite() ) {
314
-				give_set_error( 'username_invalid', __( 'Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give' ) );
313
+			if (is_multisite()) {
314
+				give_set_error('username_invalid', __('Invalid username. Only lowercase letters (a-z) and numbers are allowed.', 'give'));
315 315
 				$valid = false;
316 316
 			} else {
317
-				give_set_error( 'username_invalid', __( 'Invalid username.', 'give' ) );
317
+				give_set_error('username_invalid', __('Invalid username.', 'give'));
318 318
 				$valid = false;
319 319
 			}
320 320
 		}
321 321
 	} else {
322 322
 		// Username is empty.
323
-		give_set_error( 'username_empty', __( 'Enter a username.', 'give' ) );
323
+		give_set_error('username_empty', __('Enter a username.', 'give'));
324 324
 		$valid = false;
325 325
 
326 326
 		// Check if guest checkout is disable for form.
327
-		if ( $form_id && give_logged_in_only( $form_id ) ) {
328
-			give_set_error( 'registration_required', __( 'You must register or login to complete your donation.', 'give' ) );
327
+		if ($form_id && give_logged_in_only($form_id)) {
328
+			give_set_error('registration_required', __('You must register or login to complete your donation.', 'give'));
329 329
 			$valid = false;
330 330
 		}
331 331
 	}
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 	 * @param string $username
340 340
 	 * @param bool   $form_id
341 341
 	 */
342
-	$valid = (bool) apply_filters( 'give_validate_username', $valid, $username, $form_id );
342
+	$valid = (bool) apply_filters('give_validate_username', $valid, $username, $form_id);
343 343
 
344 344
 	return $valid;
345 345
 }
@@ -355,22 +355,22 @@  discard block
 block discarded – undo
355 355
  *
356 356
  * @return bool
357 357
  */
358
-function give_validate_user_email( $email, $registering_new_user = false ) {
358
+function give_validate_user_email($email, $registering_new_user = false) {
359 359
 	$valid = true;
360 360
 
361
-	if ( empty( $email ) ) {
361
+	if (empty($email)) {
362 362
 		// No email.
363
-		give_set_error( 'email_empty', __( 'Enter an email.', 'give' ) );
363
+		give_set_error('email_empty', __('Enter an email.', 'give'));
364 364
 		$valid = false;
365 365
 
366
-	} elseif ( ! is_email( $email ) ) {
366
+	} elseif ( ! is_email($email)) {
367 367
 		// Validate email.
368
-		give_set_error( 'email_invalid', __( 'Invalid email.', 'give' ) );
368
+		give_set_error('email_invalid', __('Invalid email.', 'give'));
369 369
 		$valid = false;
370 370
 
371
-	} elseif ( $registering_new_user && email_exists( $email ) ) {
371
+	} elseif ($registering_new_user && email_exists($email)) {
372 372
 		// Check if email exists.
373
-		give_set_error( 'email_used', __( 'The email address provided is already active for another user.', 'give' ) );
373
+		give_set_error('email_used', __('The email address provided is already active for another user.', 'give'));
374 374
 		$valid = false;
375 375
 	}
376 376
 
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 	 * @param string $email
384 384
 	 * @param bool   $registering_new_user
385 385
 	 */
386
-	$valid = (bool) apply_filters( 'give_validate_user_email', $valid, $email, $registering_new_user );
386
+	$valid = (bool) apply_filters('give_validate_user_email', $valid, $email, $registering_new_user);
387 387
 
388 388
 	return $valid;
389 389
 }
@@ -399,25 +399,25 @@  discard block
 block discarded – undo
399 399
  *
400 400
  * @return bool
401 401
  */
402
-function give_validate_user_password( $password = '', $confirm_password = '', $registering_new_user = false ) {
402
+function give_validate_user_password($password = '', $confirm_password = '', $registering_new_user = false) {
403 403
 	$valid = true;
404 404
 
405
-	if ( $password && $confirm_password ) {
405
+	if ($password && $confirm_password) {
406 406
 		// Verify confirmation matches.
407
-		if ( $password != $confirm_password ) {
407
+		if ($password != $confirm_password) {
408 408
 			// Passwords do not match
409
-			give_set_error( 'password_mismatch', __( 'Passwords don\'t match.', 'give' ) );
409
+			give_set_error('password_mismatch', __('Passwords don\'t match.', 'give'));
410 410
 			$valid = false;
411 411
 		}
412
-	} elseif ( $registering_new_user ) {
412
+	} elseif ($registering_new_user) {
413 413
 		// Password or confirmation missing.
414
-		if ( ! $password ) {
414
+		if ( ! $password) {
415 415
 			// The password is invalid.
416
-			give_set_error( 'password_empty', __( 'Enter a password.', 'give' ) );
416
+			give_set_error('password_empty', __('Enter a password.', 'give'));
417 417
 			$valid = false;
418
-		} elseif ( ! $confirm_password ) {
418
+		} elseif ( ! $confirm_password) {
419 419
 			// Confirmation password is invalid.
420
-			give_set_error( 'confirmation_empty', __( 'Enter the password confirmation.', 'give' ) );
420
+			give_set_error('confirmation_empty', __('Enter the password confirmation.', 'give'));
421 421
 			$valid = false;
422 422
 		}
423 423
 	}
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 	 * @param string $confirm_password
433 433
 	 * @param bool   $registering_new_user
434 434
 	 */
435
-	$valid = (bool) apply_filters( 'give_validate_user_email', $valid, $password, $confirm_password, $registering_new_user );
435
+	$valid = (bool) apply_filters('give_validate_user_email', $valid, $password, $confirm_password, $registering_new_user);
436 436
 
437 437
 	return $valid;
438 438
 }
@@ -451,32 +451,32 @@  discard block
 block discarded – undo
451 451
  *
452 452
  * @return      void
453 453
  */
454
-function give_add_past_purchases_to_new_user( $user_id ) {
454
+function give_add_past_purchases_to_new_user($user_id) {
455 455
 
456
-	$email = get_the_author_meta( 'user_email', $user_id );
456
+	$email = get_the_author_meta('user_email', $user_id);
457 457
 
458
-	$payments = give_get_payments( array( 's' => $email ) );
458
+	$payments = give_get_payments(array('s' => $email));
459 459
 
460
-	if ( $payments ) {
461
-		foreach ( $payments as $payment ) {
462
-			if ( intval( give_get_payment_user_id( $payment->ID ) ) > 0 ) {
460
+	if ($payments) {
461
+		foreach ($payments as $payment) {
462
+			if (intval(give_get_payment_user_id($payment->ID)) > 0) {
463 463
 				continue;
464 464
 			} // This payment already associated with an account
465 465
 
466
-			$meta                    = give_get_payment_meta( $payment->ID );
467
-			$meta['user_info']       = maybe_unserialize( $meta['user_info'] );
466
+			$meta                    = give_get_payment_meta($payment->ID);
467
+			$meta['user_info']       = maybe_unserialize($meta['user_info']);
468 468
 			$meta['user_info']['id'] = $user_id;
469 469
 			$meta['user_info']       = $meta['user_info'];
470 470
 
471 471
 			// Store the updated user ID in the payment meta
472
-			give_update_payment_meta( $payment->ID, '_give_payment_meta', $meta );
473
-			give_update_payment_meta( $payment->ID, '_give_payment_user_id', $user_id );
472
+			give_update_payment_meta($payment->ID, '_give_payment_meta', $meta);
473
+			give_update_payment_meta($payment->ID, '_give_payment_user_id', $user_id);
474 474
 		}
475 475
 	}
476 476
 
477 477
 }
478 478
 
479
-add_action( 'user_register', 'give_add_past_purchases_to_new_user' );
479
+add_action('user_register', 'give_add_past_purchases_to_new_user');
480 480
 
481 481
 
482 482
 /**
@@ -502,34 +502,34 @@  discard block
 block discarded – undo
502 502
  *
503 503
  * @return        array The donor's address, if any
504 504
  */
505
-function give_get_donor_address( $user_id = 0 ) {
506
-	if ( empty( $user_id ) ) {
505
+function give_get_donor_address($user_id = 0) {
506
+	if (empty($user_id)) {
507 507
 		$user_id = get_current_user_id();
508 508
 	}
509 509
 
510
-	$address = get_user_meta( $user_id, '_give_user_address', true );
510
+	$address = get_user_meta($user_id, '_give_user_address', true);
511 511
 
512
-	if ( ! isset( $address['line1'] ) ) {
512
+	if ( ! isset($address['line1'])) {
513 513
 		$address['line1'] = '';
514 514
 	}
515 515
 
516
-	if ( ! isset( $address['line2'] ) ) {
516
+	if ( ! isset($address['line2'])) {
517 517
 		$address['line2'] = '';
518 518
 	}
519 519
 
520
-	if ( ! isset( $address['city'] ) ) {
520
+	if ( ! isset($address['city'])) {
521 521
 		$address['city'] = '';
522 522
 	}
523 523
 
524
-	if ( ! isset( $address['zip'] ) ) {
524
+	if ( ! isset($address['zip'])) {
525 525
 		$address['zip'] = '';
526 526
 	}
527 527
 
528
-	if ( ! isset( $address['country'] ) ) {
528
+	if ( ! isset($address['country'])) {
529 529
 		$address['country'] = '';
530 530
 	}
531 531
 
532
-	if ( ! isset( $address['state'] ) ) {
532
+	if ( ! isset($address['state'])) {
533 533
 		$address['state'] = '';
534 534
 	}
535 535
 
@@ -549,42 +549,42 @@  discard block
 block discarded – undo
549 549
  *
550 550
  * @return        void
551 551
  */
552
-function give_new_user_notification( $user_id = 0, $user_data = array() ) {
552
+function give_new_user_notification($user_id = 0, $user_data = array()) {
553 553
 
554
-	if ( empty( $user_id ) || empty( $user_data ) ) {
554
+	if (empty($user_id) || empty($user_data)) {
555 555
 		return;
556 556
 	}
557
-	$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
557
+	$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
558 558
 
559 559
 	/* translators: %s: site name */
560
-	$message = sprintf( esc_attr__( 'New user registration on your site %s:', 'give' ), $blogname ) . "\r\n\r\n";
560
+	$message = sprintf(esc_attr__('New user registration on your site %s:', 'give'), $blogname)."\r\n\r\n";
561 561
 	/* translators: %s: user login */
562
-	$message .= sprintf( esc_attr__( 'Username: %s', 'give' ), $user_data['user_login'] ) . "\r\n\r\n";
562
+	$message .= sprintf(esc_attr__('Username: %s', 'give'), $user_data['user_login'])."\r\n\r\n";
563 563
 	/* translators: %s: user email */
564
-	$message .= sprintf( esc_attr__( 'E-mail: %s', 'give' ), $user_data['user_email'] ) . "\r\n";
564
+	$message .= sprintf(esc_attr__('E-mail: %s', 'give'), $user_data['user_email'])."\r\n";
565 565
 
566 566
 	Give()->emails->send(
567
-		get_option( 'admin_email' ),
567
+		get_option('admin_email'),
568 568
 		sprintf(
569 569
 			/* translators: %s: site name */
570
-			esc_attr__( '[%s] New User Registration', 'give' ),
570
+			esc_attr__('[%s] New User Registration', 'give'),
571 571
 			$blogname
572 572
 		),
573 573
 		$message
574 574
 	);
575 575
 
576 576
 	/* translators: %s: user login */
577
-	$message = sprintf( esc_attr__( 'Username: %s', 'give' ), $user_data['user_login'] ) . "\r\n";
577
+	$message = sprintf(esc_attr__('Username: %s', 'give'), $user_data['user_login'])."\r\n";
578 578
 	/* translators: %s: paswword */
579
-	$message .= sprintf( esc_attr__( 'Password: %s', 'give' ), esc_attr__( '[Password entered during donation]', 'give' ) ) . "\r\n";
579
+	$message .= sprintf(esc_attr__('Password: %s', 'give'), esc_attr__('[Password entered during donation]', 'give'))."\r\n";
580 580
 
581
-	$message .= '<a href="' . wp_login_url() . '"> ' . esc_attr__( 'Click Here to Login &raquo;', 'give' ) . '</a>' . "\r\n";
581
+	$message .= '<a href="'.wp_login_url().'"> '.esc_attr__('Click Here to Login &raquo;', 'give').'</a>'."\r\n";
582 582
 
583 583
 	Give()->emails->send(
584 584
 		$user_data['user_email'],
585 585
 		sprintf(
586 586
 			/* translators: %s: site name */
587
-			esc_attr__( '[%s] Your username and password', 'give' ),
587
+			esc_attr__('[%s] Your username and password', 'give'),
588 588
 			$blogname
589 589
 		),
590 590
 		$message
@@ -592,4 +592,4 @@  discard block
 block discarded – undo
592 592
 
593 593
 }
594 594
 
595
-add_action( 'give_insert_user', 'give_new_user_notification', 10, 2 );
595
+add_action('give_insert_user', 'give_new_user_notification', 10, 2);
Please login to merge, or discard this patch.
includes/admin/class-admin-settings.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -733,9 +733,9 @@
 block discarded – undo
733 733
                         <td class="give-docs-link" colspan="2">
734 734
 							<?php
735 735
 							echo '<p class="give-docs-link"><a href="' . esc_url( $value['url'] )
736
-							     . '" target="_blank">'
737
-							     . sprintf( esc_html__( 'Need Help? See docs on "%s"', 'give' ), $value['title'] )
738
-							     . '<span class="dashicons dashicons-editor-help"></span></a></p>';
736
+								 . '" target="_blank">'
737
+								 . sprintf( esc_html__( 'Need Help? See docs on "%s"', 'give' ), $value['title'] )
738
+								 . '<span class="dashicons dashicons-editor-help"></span></a></p>';
739 739
 							?>
740 740
                         </td>
741 741
                         </tr><?php
Please login to merge, or discard this patch.
Spacing   +205 added lines, -205 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;
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Admin_Settings' ) ) :
16
+if ( ! class_exists('Give_Admin_Settings')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Admin_Settings Class.
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 			 *
73 73
 			 * @param array $settings Array of settings class object.
74 74
 			 */
75
-			self::$settings = apply_filters( self::$setting_filter_prefix . '_get_settings_pages', array() );
75
+			self::$settings = apply_filters(self::$setting_filter_prefix.'_get_settings_pages', array());
76 76
 
77 77
 			return self::$settings;
78 78
 		}
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 		public static function save() {
87 87
 			$current_tab = give_get_current_setting_tab();
88 88
 
89
-			if ( empty( $_REQUEST['_give-save-settings'] ) || ! wp_verify_nonce( $_REQUEST['_give-save-settings'], 'give-save-settings' ) ) {
90
-				echo '<div class="notice error"><p>' . __( 'Action failed. Please refresh the page and retry.', 'give' ) . '</p></div>';
89
+			if (empty($_REQUEST['_give-save-settings']) || ! wp_verify_nonce($_REQUEST['_give-save-settings'], 'give-save-settings')) {
90
+				echo '<div class="notice error"><p>'.__('Action failed. Please refresh the page and retry.', 'give').'</p></div>';
91 91
 				die();
92 92
 			}
93 93
 
@@ -100,9 +100,9 @@  discard block
 block discarded – undo
100 100
 			 *
101 101
 			 * @since 1.8
102 102
 			 */
103
-			do_action( self::$setting_filter_prefix . '_save_' . $current_tab );
103
+			do_action(self::$setting_filter_prefix.'_save_'.$current_tab);
104 104
 
105
-			self::add_message( 'give-setting-updated', __( 'Your settings have been saved.', 'give' ) );
105
+			self::add_message('give-setting-updated', __('Your settings have been saved.', 'give'));
106 106
 
107 107
 			/**
108 108
 			 * Trigger Action.
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 			 *
114 114
 			 * @since 1.8
115 115
 			 */
116
-			do_action( self::$setting_filter_prefix . '_saved' );
116
+			do_action(self::$setting_filter_prefix.'_saved');
117 117
 		}
118 118
 
119 119
 		/**
@@ -126,8 +126,8 @@  discard block
 block discarded – undo
126 126
 		 *
127 127
 		 * @return void
128 128
 		 */
129
-		public static function add_message( $code, $message ) {
130
-			self::$messages[ $code ] = $message;
129
+		public static function add_message($code, $message) {
130
+			self::$messages[$code] = $message;
131 131
 		}
132 132
 
133 133
 		/**
@@ -140,8 +140,8 @@  discard block
 block discarded – undo
140 140
 		 *
141 141
 		 * @return void
142 142
 		 */
143
-		public static function add_error( $code, $message ) {
144
-			self::$errors[ $code ] = $message;
143
+		public static function add_error($code, $message) {
144
+			self::$errors[$code] = $message;
145 145
 		}
146 146
 
147 147
 		/**
@@ -154,18 +154,18 @@  discard block
 block discarded – undo
154 154
 			$notice_html = '';
155 155
 			$classes     = 'give-notice settings-error notice is-dismissible';
156 156
 
157
-			self::$errors   = apply_filters( self::$setting_filter_prefix . '_error_notices', self::$errors );
158
-			self::$messages = apply_filters( self::$setting_filter_prefix . '_update_notices', self::$messages );
157
+			self::$errors   = apply_filters(self::$setting_filter_prefix.'_error_notices', self::$errors);
158
+			self::$messages = apply_filters(self::$setting_filter_prefix.'_update_notices', self::$messages);
159 159
 
160
-			if ( 0 < count( self::$errors ) ) {
161
-				foreach ( self::$errors as $code => $message ) {
162
-					$notice_html .= '<div id="setting-error-' . $code . '" class="' . $classes . ' error"><p><strong>' . $message . '</strong></p></div>';
160
+			if (0 < count(self::$errors)) {
161
+				foreach (self::$errors as $code => $message) {
162
+					$notice_html .= '<div id="setting-error-'.$code.'" class="'.$classes.' error"><p><strong>'.$message.'</strong></p></div>';
163 163
 				}
164 164
 			}
165 165
 
166
-			if ( 0 < count( self::$messages ) ) {
167
-				foreach ( self::$messages as $code => $message ) {
168
-					$notice_html .= '<div id="setting-error-' . $code . '" class="' . $classes . ' updated"><p><strong>' . $message . '</strong></p></div>';
166
+			if (0 < count(self::$messages)) {
167
+				foreach (self::$messages as $code => $message) {
168
+					$notice_html .= '<div id="setting-error-'.$code.'" class="'.$classes.' updated"><p><strong>'.$message.'</strong></p></div>';
169 169
 				}
170 170
 			}
171 171
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 			self::$setting_filter_prefix = give_get_current_setting_page();
186 186
 
187 187
 			// Bailout: Exit if setting page is not defined.
188
-			if ( empty( self::$setting_filter_prefix ) ) {
188
+			if (empty(self::$setting_filter_prefix)) {
189 189
 				return false;
190 190
 			}
191 191
 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 			 *
199 199
 			 * @since 1.8
200 200
 			 */
201
-			do_action( self::$setting_filter_prefix . '_start' );
201
+			do_action(self::$setting_filter_prefix.'_start');
202 202
 
203 203
 			$current_tab = give_get_current_setting_tab();
204 204
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 			self::get_settings_pages();
207 207
 
208 208
 			// Save settings if data has been posted.
209
-			if ( ! empty( $_POST ) ) {
209
+			if ( ! empty($_POST)) {
210 210
 				self::save();
211 211
 			}
212 212
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 			 *
220 220
 			 * @since 1.8
221 221
 			 */
222
-			$tabs = apply_filters( self::$setting_filter_prefix . '_tabs_array', array() );
222
+			$tabs = apply_filters(self::$setting_filter_prefix.'_tabs_array', array());
223 223
 
224 224
 			include 'views/html-admin-settings.php';
225 225
 
@@ -237,25 +237,25 @@  discard block
 block discarded – undo
237 237
 		 *
238 238
 		 * @return string|bool
239 239
 		 */
240
-		public static function get_option( $option_name = '', $field_id = '', $default = false ) {
240
+		public static function get_option($option_name = '', $field_id = '', $default = false) {
241 241
 			// Bailout.
242
-			if ( empty( $option_name ) && empty( $field_id ) ) {
242
+			if (empty($option_name) && empty($field_id)) {
243 243
 				return false;
244 244
 			}
245 245
 
246
-			if ( ! empty( $field_id ) && ! empty( $option_name ) ) {
246
+			if ( ! empty($field_id) && ! empty($option_name)) {
247 247
 				// Get field value if any.
248
-				$option_value = get_option( $option_name );
248
+				$option_value = get_option($option_name);
249 249
 
250
-				$option_value = ( is_array( $option_value ) && array_key_exists( $field_id, $option_value ) )
251
-					? $option_value[ $field_id ]
250
+				$option_value = (is_array($option_value) && array_key_exists($field_id, $option_value))
251
+					? $option_value[$field_id]
252 252
 					: $default;
253 253
 			} else {
254 254
 				// If option name is empty but not field name then this means, setting is direct store to option table under there field name.
255 255
 				$option_name = ! $option_name ? $field_id : $option_name;
256 256
 
257 257
 				// Get option value if any.
258
-				$option_value = get_option( $option_name, $default );
258
+				$option_value = get_option($option_name, $default);
259 259
 			}
260 260
 
261 261
 			return $option_value;
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 		 *
274 274
 		 * @return void
275 275
 		 */
276
-		public static function output_fields( $options, $option_name = '' ) {
276
+		public static function output_fields($options, $option_name = '') {
277 277
 			$current_tab = give_get_current_setting_tab();
278 278
 
279 279
 			// Field Default values.
@@ -286,52 +286,52 @@  discard block
 block discarded – undo
286 286
 				'table_html' => true,
287 287
 			);
288 288
 
289
-			foreach ( $options as $value ) {
290
-				if ( ! isset( $value['type'] ) ) {
289
+			foreach ($options as $value) {
290
+				if ( ! isset($value['type'])) {
291 291
 					continue;
292 292
 				}
293 293
 
294 294
 				// Set title.
295
-				$defaults['title'] = isset( $value['name'] ) ? $value['name'] : '';
295
+				$defaults['title'] = isset($value['name']) ? $value['name'] : '';
296 296
 
297 297
 				// Set default setting.
298
-				$value = wp_parse_args( $value, $defaults );
298
+				$value = wp_parse_args($value, $defaults);
299 299
 
300 300
 				// Colorpicker field.
301
-				$value['class'] = ( 'colorpicker' === $value['type'] ? trim( $value['class'] ) . ' give-colorpicker' : $value['class'] );
302
-				$value['type']  = ( 'colorpicker' === $value['type'] ? 'text' : $value['type'] );
301
+				$value['class'] = ('colorpicker' === $value['type'] ? trim($value['class']).' give-colorpicker' : $value['class']);
302
+				$value['type']  = ('colorpicker' === $value['type'] ? 'text' : $value['type']);
303 303
 
304 304
 
305 305
 				// Custom attribute handling.
306 306
 				$custom_attributes = array();
307 307
 
308
-				if ( ! empty( $value['attributes'] ) && is_array( $value['attributes'] ) ) {
309
-					foreach ( $value['attributes'] as $attribute => $attribute_value ) {
310
-						$custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"';
308
+				if ( ! empty($value['attributes']) && is_array($value['attributes'])) {
309
+					foreach ($value['attributes'] as $attribute => $attribute_value) {
310
+						$custom_attributes[] = esc_attr($attribute).'="'.esc_attr($attribute_value).'"';
311 311
 					}
312 312
 				}
313 313
 
314 314
 				// Description handling.
315
-				$description          = self::get_field_description( $value );
315
+				$description = self::get_field_description($value);
316 316
 
317 317
 				// Switch based on type.
318
-				switch ( $value['type'] ) {
318
+				switch ($value['type']) {
319 319
 
320 320
 					// Section Titles
321 321
 					case 'title':
322
-						if ( ! empty( $value['title'] ) ) {
323
-							echo '<div class="give-setting-tab-header give-setting-tab-header-' . $current_tab . '"><h2>' . self::get_field_title( $value ) . '</h2><hr></div>';
322
+						if ( ! empty($value['title'])) {
323
+							echo '<div class="give-setting-tab-header give-setting-tab-header-'.$current_tab.'"><h2>'.self::get_field_title($value).'</h2><hr></div>';
324 324
 						}
325 325
 
326
-						if ( ! empty( $value['desc'] ) ) {
327
-							echo wpautop( wptexturize( wp_kses_post( $value['desc'] ) ) );
326
+						if ( ! empty($value['desc'])) {
327
+							echo wpautop(wptexturize(wp_kses_post($value['desc'])));
328 328
 						}
329 329
 
330
-						if ( $value['table_html'] ) {
331
-							echo '<table class="form-table give-setting-tab-body give-setting-tab-body-' . $current_tab . '">' . "\n\n";
330
+						if ($value['table_html']) {
331
+							echo '<table class="form-table give-setting-tab-body give-setting-tab-body-'.$current_tab.'">'."\n\n";
332 332
 						}
333 333
 
334
-						if ( ! empty( $value['id'] ) ) {
334
+						if ( ! empty($value['id'])) {
335 335
 
336 336
 							/**
337 337
 							 * Trigger Action.
@@ -340,14 +340,14 @@  discard block
 block discarded – undo
340 340
 							 *
341 341
 							 * @since 1.8
342 342
 							 */
343
-							do_action( 'give_settings_' . sanitize_title( $value['id'] ) );
343
+							do_action('give_settings_'.sanitize_title($value['id']));
344 344
 						}
345 345
 
346 346
 						break;
347 347
 
348 348
 					// Section Ends.
349 349
 					case 'sectionend':
350
-						if ( ! empty( $value['id'] ) ) {
350
+						if ( ! empty($value['id'])) {
351 351
 
352 352
 							/**
353 353
 							 * Trigger Action.
@@ -356,14 +356,14 @@  discard block
 block discarded – undo
356 356
 							 *
357 357
 							 * @since 1.8
358 358
 							 */
359
-							do_action( 'give_settings_' . sanitize_title( $value['id'] ) . '_end' );
359
+							do_action('give_settings_'.sanitize_title($value['id']).'_end');
360 360
 						}
361 361
 
362
-						if ( $value['table_html'] ) {
362
+						if ($value['table_html']) {
363 363
 							echo '</table>';
364 364
 						}
365 365
 
366
-						if ( ! empty( $value['id'] ) ) {
366
+						if ( ! empty($value['id'])) {
367 367
 
368 368
 							/**
369 369
 							 * Trigger Action.
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 							 *
373 373
 							 * @since 1.8
374 374
 							 */
375
-							do_action( 'give_settings_' . sanitize_title( $value['id'] ) . '_after' );
375
+							do_action('give_settings_'.sanitize_title($value['id']).'_after');
376 376
 						}
377 377
 
378 378
 						break;
@@ -385,22 +385,22 @@  discard block
 block discarded – undo
385 385
 					case 'password' :
386 386
 
387 387
 						$type = $value['type'];
388
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
388
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
389 389
 
390 390
 						?>
391
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
391
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
392 392
                         <th scope="row" class="titledesc">
393
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
393
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
394 394
                         </th>
395
-                        <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?>">
395
+                        <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?>">
396 396
                             <input
397
-                                    name="<?php echo esc_attr( $value['id'] ); ?>"
398
-                                    id="<?php echo esc_attr( $value['id'] ); ?>"
399
-                                    type="<?php echo esc_attr( $type ); ?>"
400
-                                    style="<?php echo esc_attr( $value['css'] ); ?>"
401
-                                    value="<?php echo esc_attr( $option_value ); ?>"
402
-                                    class="give-input-field<?php echo( empty( $value['class'] ) ? '' : ' ' . esc_attr( $value['class'] ) ); ?>"
403
-								<?php echo implode( ' ', $custom_attributes ); ?>
397
+                                    name="<?php echo esc_attr($value['id']); ?>"
398
+                                    id="<?php echo esc_attr($value['id']); ?>"
399
+                                    type="<?php echo esc_attr($type); ?>"
400
+                                    style="<?php echo esc_attr($value['css']); ?>"
401
+                                    value="<?php echo esc_attr($option_value); ?>"
402
+                                    class="give-input-field<?php echo(empty($value['class']) ? '' : ' '.esc_attr($value['class'])); ?>"
403
+								<?php echo implode(' ', $custom_attributes); ?>
404 404
                             /> <?php echo $description; ?>
405 405
                         </td>
406 406
                         </tr><?php
@@ -409,23 +409,23 @@  discard block
 block discarded – undo
409 409
 					// Textarea.
410 410
 					case 'textarea':
411 411
 
412
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
412
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
413 413
 
414 414
 						?>
415
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
415
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
416 416
                         <th scope="row" class="titledesc">
417
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
417
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
418 418
                         </th>
419
-                        <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?>">
419
+                        <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?>">
420 420
 								<textarea
421
-                                        name="<?php echo esc_attr( $value['id'] ); ?>"
422
-                                        id="<?php echo esc_attr( $value['id'] ); ?>"
423
-                                        style="<?php echo esc_attr( $value['css'] ); ?>"
424
-                                        class="<?php echo esc_attr( $value['class'] ); ?>"
421
+                                        name="<?php echo esc_attr($value['id']); ?>"
422
+                                        id="<?php echo esc_attr($value['id']); ?>"
423
+                                        style="<?php echo esc_attr($value['css']); ?>"
424
+                                        class="<?php echo esc_attr($value['class']); ?>"
425 425
                                         rows="10"
426 426
                                         cols="60"
427
-									<?php echo implode( ' ', $custom_attributes ); ?>
428
-                                ><?php echo esc_textarea( $option_value ); ?></textarea>
427
+									<?php echo implode(' ', $custom_attributes); ?>
428
+                                ><?php echo esc_textarea($option_value); ?></textarea>
429 429
 							<?php echo $description; ?>
430 430
                         </td>
431 431
                         </tr><?php
@@ -435,35 +435,35 @@  discard block
 block discarded – undo
435 435
 					case 'select' :
436 436
 					case 'multiselect' :
437 437
 
438
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
438
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
439 439
 
440 440
 						?>
441
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
441
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
442 442
                         <th scope="row" class="titledesc">
443
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
443
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
444 444
                         </th>
445
-                        <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?>">
445
+                        <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?>">
446 446
                             <select
447
-                                    name="<?php echo esc_attr( $value['id'] ); ?><?php if ( $value['type'] == 'multiselect' ) {
447
+                                    name="<?php echo esc_attr($value['id']); ?><?php if ($value['type'] == 'multiselect') {
448 448
 										echo '[]';
449 449
 									} ?>"
450
-                                    id="<?php echo esc_attr( $value['id'] ); ?>"
451
-                                    style="<?php echo esc_attr( $value['css'] ); ?>"
452
-                                    class="<?php echo esc_attr( $value['class'] ); ?>"
453
-								<?php echo implode( ' ', $custom_attributes ); ?>
454
-								<?php echo ( 'multiselect' == $value['type'] ) ? 'multiple="multiple"' : ''; ?>
450
+                                    id="<?php echo esc_attr($value['id']); ?>"
451
+                                    style="<?php echo esc_attr($value['css']); ?>"
452
+                                    class="<?php echo esc_attr($value['class']); ?>"
453
+								<?php echo implode(' ', $custom_attributes); ?>
454
+								<?php echo ('multiselect' == $value['type']) ? 'multiple="multiple"' : ''; ?>
455 455
                             >
456 456
 
457 457
 								<?php
458
-								if ( ! empty( $value['options'] ) ) {
459
-									foreach ( $value['options'] as $key => $val ) {
458
+								if ( ! empty($value['options'])) {
459
+									foreach ($value['options'] as $key => $val) {
460 460
 										?>
461
-                                        <option value="<?php echo esc_attr( $key ); ?>" <?php
461
+                                        <option value="<?php echo esc_attr($key); ?>" <?php
462 462
 
463
-										if ( is_array( $option_value ) ) {
464
-											selected( in_array( $key, $option_value ), true );
463
+										if (is_array($option_value)) {
464
+											selected(in_array($key, $option_value), true);
465 465
 										} else {
466
-											selected( $option_value, $key );
466
+											selected($option_value, $key);
467 467
 										}
468 468
 
469 469
 										?>><?php echo $val ?></option>
@@ -479,28 +479,28 @@  discard block
 block discarded – undo
479 479
 
480 480
 					// Radio inputs.
481 481
 					case 'radio_inline' :
482
-						$value['class'] = empty( $value['class'] ) ? 'give-radio-inline' : $value['class'] . ' give-radio-inline';
482
+						$value['class'] = empty($value['class']) ? 'give-radio-inline' : $value['class'].' give-radio-inline';
483 483
 					case 'radio' :
484
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
484
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
485 485
 						?>
486
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
486
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
487 487
                         <th scope="row" class="titledesc">
488
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
488
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
489 489
                         </th>
490
-                        <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?> <?php echo( ! empty( $value['class'] ) ? $value['class'] : '' ); ?>">
490
+                        <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?> <?php echo( ! empty($value['class']) ? $value['class'] : ''); ?>">
491 491
                             <fieldset>
492 492
                                 <ul>
493 493
 									<?php
494
-									foreach ( $value['options'] as $key => $val ) {
494
+									foreach ($value['options'] as $key => $val) {
495 495
 										?>
496 496
                                         <li>
497 497
                                             <label><input
498
-                                                        name="<?php echo esc_attr( $value['id'] ); ?>"
498
+                                                        name="<?php echo esc_attr($value['id']); ?>"
499 499
                                                         value="<?php echo $key; ?>"
500 500
                                                         type="radio"
501
-                                                        style="<?php echo esc_attr( $value['css'] ); ?>"
502
-													<?php echo implode( ' ', $custom_attributes ); ?>
503
-													<?php checked( $key, $option_value ); ?>
501
+                                                        style="<?php echo esc_attr($value['css']); ?>"
502
+													<?php echo implode(' ', $custom_attributes); ?>
503
+													<?php checked($key, $option_value); ?>
504 504
                                                 /> <?php echo $val ?></label>
505 505
                                         </li>
506 506
 										<?php
@@ -514,21 +514,21 @@  discard block
 block discarded – undo
514 514
 
515 515
 					// Checkbox input.
516 516
 					case 'checkbox' :
517
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
517
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
518 518
 						?>
519
-                        <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
519
+                        <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
520 520
                             <th scope="row" class="titledesc">
521
-                                <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
521
+                                <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
522 522
                             </th>
523 523
                             <td class="give-forminp">
524 524
                                 <input
525
-                                        name="<?php echo esc_attr( $value['id'] ); ?>"
526
-                                        id="<?php echo esc_attr( $value['id'] ); ?>"
525
+                                        name="<?php echo esc_attr($value['id']); ?>"
526
+                                        id="<?php echo esc_attr($value['id']); ?>"
527 527
                                         type="checkbox"
528
-                                        class="<?php echo esc_attr( isset( $value['class'] ) ? $value['class'] : '' ); ?>"
528
+                                        class="<?php echo esc_attr(isset($value['class']) ? $value['class'] : ''); ?>"
529 529
                                         value="1"
530
-									<?php checked( $option_value, 'on' ); ?>
531
-									<?php echo implode( ' ', $custom_attributes ); ?>
530
+									<?php checked($option_value, 'on'); ?>
531
+									<?php echo implode(' ', $custom_attributes); ?>
532 532
                                 />
533 533
 								<?php echo $description; ?>
534 534
                             </td>
@@ -538,28 +538,28 @@  discard block
 block discarded – undo
538 538
 
539 539
 					// Multi Checkbox input.
540 540
 					case 'multicheck' :
541
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
542
-						$option_value = is_array( $option_value ) ? $option_value : array();
541
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
542
+						$option_value = is_array($option_value) ? $option_value : array();
543 543
 						?>
544
-                        <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
544
+                        <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
545 545
                             <th scope="row" class="titledesc">
546
-                                <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
546
+                                <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
547 547
                             </th>
548
-                            <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?> <?php echo( ! empty( $value['class'] ) ? $value['class'] : '' ); ?>">
548
+                            <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?> <?php echo( ! empty($value['class']) ? $value['class'] : ''); ?>">
549 549
                                 <fieldset>
550 550
                                     <ul>
551 551
 										<?php
552
-										foreach ( $value['options'] as $key => $val ) {
552
+										foreach ($value['options'] as $key => $val) {
553 553
 											?>
554 554
                                             <li>
555 555
                                                 <label>
556 556
                                                     <input
557
-                                                            name="<?php echo esc_attr( $value['id'] ); ?>[]"
557
+                                                            name="<?php echo esc_attr($value['id']); ?>[]"
558 558
                                                             value="<?php echo $key; ?>"
559 559
                                                             type="checkbox"
560
-                                                            style="<?php echo esc_attr( $value['css'] ); ?>"
561
-														<?php echo implode( ' ', $custom_attributes ); ?>
562
-														<?php if ( in_array( $key, $option_value ) ) {
560
+                                                            style="<?php echo esc_attr($value['css']); ?>"
561
+														<?php echo implode(' ', $custom_attributes); ?>
562
+														<?php if (in_array($key, $option_value)) {
563 563
 															echo 'checked="checked"';
564 564
 														} ?>
565 565
                                                     /> <?php echo $val ?>
@@ -577,25 +577,25 @@  discard block
 block discarded – undo
577 577
 
578 578
 					// File input field.
579 579
 					case 'file' :
580
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
580
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
581 581
 						?>
582
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
582
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
583 583
                         <th scope="row" class="titledesc">
584
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
584
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
585 585
                         </th>
586 586
                         <td class="give-forminp">
587 587
                             <div class="give-field-wrap">
588 588
                                 <label for="<?php echo $value['id'] ?>">
589 589
                                     <input
590
-                                            name="<?php echo esc_attr( $value['id'] ); ?>"
591
-                                            id="<?php echo esc_attr( $value['id'] ); ?>"
590
+                                            name="<?php echo esc_attr($value['id']); ?>"
591
+                                            id="<?php echo esc_attr($value['id']); ?>"
592 592
                                             type="text"
593
-                                            class="give-input-field<?php echo esc_attr( isset( $value['class'] ) ? ' ' . $value['class'] : '' ); ?>"
593
+                                            class="give-input-field<?php echo esc_attr(isset($value['class']) ? ' '.$value['class'] : ''); ?>"
594 594
                                             value="<?php echo $option_value; ?>"
595
-                                            style="<?php echo esc_attr( $value['css'] ); ?>"
596
-										<?php echo implode( ' ', $custom_attributes ); ?>
595
+                                            style="<?php echo esc_attr($value['css']); ?>"
596
+										<?php echo implode(' ', $custom_attributes); ?>
597 597
                                     />&nbsp;&nbsp;&nbsp;&nbsp;<input class="give-upload-button button" type="button"
598
-                                                                     value="<?php echo esc_html__( 'Add or Upload File', 'give' ); ?>">
598
+                                                                     value="<?php echo esc_html__('Add or Upload File', 'give'); ?>">
599 599
 									<?php echo $description ?>
600 600
                                     <div class="give-image-thumb<?php echo ! $option_value ? ' give-hidden' : ''; ?>">
601 601
                                         <span class="give-delete-image-thumb dashicons dashicons-no-alt"></span>
@@ -610,17 +610,17 @@  discard block
 block discarded – undo
610 610
 					// WordPress Editor.
611 611
 					case 'wysiwyg' :
612 612
 						// Get option value.
613
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
613
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
614 614
 
615 615
 						// Get editor settings.
616
-						$editor_settings = ! empty( $value['options'] ) ? $value['options'] : array();
616
+						$editor_settings = ! empty($value['options']) ? $value['options'] : array();
617 617
 						?>
618
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
618
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
619 619
                         <th scope="row" class="titledesc">
620
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
620
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
621 621
                         </th>
622 622
                         <td class="give-forminp">
623
-							<?php wp_editor( $option_value, $value['id'], $editor_settings ); ?>
623
+							<?php wp_editor($option_value, $value['id'], $editor_settings); ?>
624 624
 							<?php echo $description; ?>
625 625
                         </td>
626 626
                         </tr><?php
@@ -629,9 +629,9 @@  discard block
 block discarded – undo
629 629
 					// Custom: System setting field.
630 630
 					case 'system_info' :
631 631
 						?>
632
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
632
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
633 633
                         <th scope="row" class="titledesc">
634
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
634
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
635 635
                         </th>
636 636
                         <td class="give-forminp">
637 637
 							<?php give_system_info_callback(); ?>
@@ -642,14 +642,14 @@  discard block
 block discarded – undo
642 642
 
643 643
 					// Custom: Default gateways setting field.
644 644
 					case 'default_gateway' :
645
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
645
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
646 646
 						?>
647
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
647
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
648 648
                         <th scope="row" class="titledesc">
649
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
649
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
650 650
                         </th>
651 651
                         <td class="give-forminp">
652
-							<?php give_default_gateway_callback( $value, $option_value ); ?>
652
+							<?php give_default_gateway_callback($value, $option_value); ?>
653 653
 							<?php echo $description; ?>
654 654
                         </td>
655 655
                         </tr><?php
@@ -657,14 +657,14 @@  discard block
 block discarded – undo
657 657
 
658 658
 					// Custom: Enable gateways setting field.
659 659
 					case 'enabled_gateways' :
660
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
660
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
661 661
 						?>
662
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
662
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
663 663
                         <th scope="row" class="titledesc">
664
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
664
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
665 665
                         </th>
666 666
                         <td class="give-forminp">
667
-							<?php give_enabled_gateways_callback( $value, $option_value ); ?>
667
+							<?php give_enabled_gateways_callback($value, $option_value); ?>
668 668
 							<?php echo $description; ?>
669 669
                         </td>
670 670
                         </tr><?php
@@ -673,9 +673,9 @@  discard block
 block discarded – undo
673 673
 					// Custom: Email preview buttons field.
674 674
 					case 'email_preview_buttons' :
675 675
 						?>
676
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
676
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
677 677
                         <th scope="row" class="titledesc">
678
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
678
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
679 679
                         </th>
680 680
                         <td class="give-forminp">
681 681
 							<?php give_email_preview_buttons_callback(); ?>
@@ -692,22 +692,22 @@  discard block
 block discarded – undo
692 692
 
693 693
 					// Custom: Gateway API key.
694 694
 					case 'api_key' :
695
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
696
-						$type         = ! empty( $option_value ) ? 'password' : 'text';
695
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
696
+						$type         = ! empty($option_value) ? 'password' : 'text';
697 697
 						?>
698
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
698
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
699 699
                         <th scope="row" class="titledesc">
700
-                            <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo self::get_field_title( $value ); ?></label>
700
+                            <label for="<?php echo esc_attr($value['id']); ?>"><?php echo self::get_field_title($value); ?></label>
701 701
                         </th>
702
-                        <td class="give-forminp give-forminp-<?php echo sanitize_title( $value['type'] ) ?>">
702
+                        <td class="give-forminp give-forminp-<?php echo sanitize_title($value['type']) ?>">
703 703
                             <input
704
-                                    name="<?php echo esc_attr( $value['id'] ); ?>"
705
-                                    id="<?php echo esc_attr( $value['id'] ); ?>"
706
-                                    type="<?php echo esc_attr( $type ); ?>"
707
-                                    style="<?php echo esc_attr( $value['css'] ); ?>"
708
-                                    value="<?php echo esc_attr( trim( $option_value ) ); ?>"
709
-                                    class="give-input-field<?php echo( empty( $value['class'] ) ? '' : ' ' . esc_attr( $value['class'] ) ); ?>"
710
-								<?php echo implode( ' ', $custom_attributes ); ?>
704
+                                    name="<?php echo esc_attr($value['id']); ?>"
705
+                                    id="<?php echo esc_attr($value['id']); ?>"
706
+                                    type="<?php echo esc_attr($type); ?>"
707
+                                    style="<?php echo esc_attr($value['css']); ?>"
708
+                                    value="<?php echo esc_attr(trim($option_value)); ?>"
709
+                                    class="give-input-field<?php echo(empty($value['class']) ? '' : ' '.esc_attr($value['class'])); ?>"
710
+								<?php echo implode(' ', $custom_attributes); ?>
711 711
                             /> <?php echo $description; ?>
712 712
                         </td>
713 713
                         </tr><?php
@@ -729,12 +729,12 @@  discard block
 block discarded – undo
729 729
 					// Custom: Give Docs Link field type.
730 730
 					case 'give_docs_link' :
731 731
 						?>
732
-                    <tr valign="top" <?php echo ! empty( $value['wrapper_class'] ) ? 'class="' . $value['wrapper_class'] . '"' : '' ?>>
732
+                    <tr valign="top" <?php echo ! empty($value['wrapper_class']) ? 'class="'.$value['wrapper_class'].'"' : '' ?>>
733 733
                         <td class="give-docs-link" colspan="2">
734 734
 							<?php
735
-							echo '<p class="give-docs-link"><a href="' . esc_url( $value['url'] )
735
+							echo '<p class="give-docs-link"><a href="'.esc_url($value['url'])
736 736
 							     . '" target="_blank">'
737
-							     . sprintf( esc_html__( 'Need Help? See docs on "%s"', 'give' ), $value['title'] )
737
+							     . sprintf(esc_html__('Need Help? See docs on "%s"', 'give'), $value['title'])
738 738
 							     . '<span class="dashicons dashicons-editor-help"></span></a></p>';
739 739
 							?>
740 740
                         </td>
@@ -745,8 +745,8 @@  discard block
 block discarded – undo
745 745
 					// You can add or handle your custom field action.
746 746
 					default:
747 747
 						// Get option value.
748
-						$option_value = self::get_option( $option_name, $value['id'], $value['default'] );
749
-						do_action( 'give_admin_field_' . $value['type'], $value, $option_value );
748
+						$option_value = self::get_option($option_name, $value['id'], $value['default']);
749
+						do_action('give_admin_field_'.$value['type'], $value, $option_value);
750 750
 						break;
751 751
 				}
752 752
 			}
@@ -762,15 +762,15 @@  discard block
 block discarded – undo
762 762
 		 *
763 763
 		 * @return string The HTML description of the field.
764 764
 		 */
765
-		public static function get_field_description( $value ) {
765
+		public static function get_field_description($value) {
766 766
 			$description = '';
767 767
 
768 768
 			// Support for both 'description' and 'desc' args.
769
-			$description_key = isset( $value['description'] ) ? 'description' : 'desc';
770
-			$value           = ( isset( $value[ $description_key ] ) && ! empty( $value[ $description_key ] ) ) ? $value[ $description_key ] : '';
769
+			$description_key = isset($value['description']) ? 'description' : 'desc';
770
+			$value           = (isset($value[$description_key]) && ! empty($value[$description_key])) ? $value[$description_key] : '';
771 771
 
772
-			if ( ! empty( $value ) ) {
773
-				$description = '<p class="give-field-description">' . wp_kses_post( $value ) . '</p>';
772
+			if ( ! empty($value)) {
773
+				$description = '<p class="give-field-description">'.wp_kses_post($value).'</p>';
774 774
 			}
775 775
 
776 776
 			return $description;
@@ -787,11 +787,11 @@  discard block
 block discarded – undo
787 787
 		 *
788 788
 		 * @return array The description and tip as a 2 element array
789 789
 		 */
790
-		public static function get_field_title( $value ) {
791
-			$title = esc_html( $value['title'] );
790
+		public static function get_field_title($value) {
791
+			$title = esc_html($value['title']);
792 792
 
793 793
 			// If html tag detected then allow them to print.
794
-			if ( strip_tags( $title ) ) {
794
+			if (strip_tags($title)) {
795 795
 				$title = $value['title'];
796 796
 			}
797 797
 
@@ -810,8 +810,8 @@  discard block
 block discarded – undo
810 810
 		 *
811 811
 		 * @return bool
812 812
 		 */
813
-		public static function save_fields( $options, $option_name = '' ) {
814
-			if ( empty( $_POST ) ) {
813
+		public static function save_fields($options, $option_name = '') {
814
+			if (empty($_POST)) {
815 815
 				return false;
816 816
 			}
817 817
 
@@ -819,37 +819,37 @@  discard block
 block discarded – undo
819 819
 			$update_options = array();
820 820
 
821 821
 			// Loop options and get values to save.
822
-			foreach ( $options as $option ) {
823
-				if ( ! isset( $option['id'] ) || ! isset( $option['type'] ) ) {
822
+			foreach ($options as $option) {
823
+				if ( ! isset($option['id']) || ! isset($option['type'])) {
824 824
 					continue;
825 825
 				}
826 826
 
827 827
 				// Get posted value.
828
-				if ( strstr( $option['id'], '[' ) ) {
829
-					parse_str( $option['id'], $option_name_array );
830
-					$field_option_name = current( array_keys( $option_name_array ) );
831
-					$setting_name      = key( $option_name_array[ $field_option_name ] );
832
-					$raw_value         = isset( $_POST[ $field_option_name ][ $setting_name ] ) ? wp_unslash( $_POST[ $field_option_name ][ $setting_name ] ) : null;
828
+				if (strstr($option['id'], '[')) {
829
+					parse_str($option['id'], $option_name_array);
830
+					$field_option_name = current(array_keys($option_name_array));
831
+					$setting_name      = key($option_name_array[$field_option_name]);
832
+					$raw_value         = isset($_POST[$field_option_name][$setting_name]) ? wp_unslash($_POST[$field_option_name][$setting_name]) : null;
833 833
 				} else {
834 834
 					$field_option_name = $option['id'];
835 835
 					$setting_name      = '';
836
-					$raw_value         = isset( $_POST[ $option['id'] ] ) ? wp_unslash( $_POST[ $option['id'] ] ) : null;
836
+					$raw_value         = isset($_POST[$option['id']]) ? wp_unslash($_POST[$option['id']]) : null;
837 837
 				}
838 838
 
839 839
 				// Format the value based on option type.
840
-				switch ( $option['type'] ) {
840
+				switch ($option['type']) {
841 841
 					case 'checkbox' :
842
-						$value = is_null( $raw_value ) ? '' : 'on';
842
+						$value = is_null($raw_value) ? '' : 'on';
843 843
 						break;
844 844
 					case 'wysiwyg'  :
845 845
 					case 'textarea' :
846
-						$value = wp_kses_post( trim( $raw_value ) );
846
+						$value = wp_kses_post(trim($raw_value));
847 847
 						break;
848 848
 					case 'multiselect' :
849
-						$value = array_filter( array_map( 'give_clean', (array) $raw_value ) );
849
+						$value = array_filter(array_map('give_clean', (array) $raw_value));
850 850
 						break;
851 851
 					default :
852
-						$value = give_clean( $raw_value );
852
+						$value = give_clean($raw_value);
853 853
 						break;
854 854
 				}
855 855
 
@@ -858,37 +858,37 @@  discard block
 block discarded – undo
858 858
 				 *
859 859
 				 * @since 1.8
860 860
 				 */
861
-				$value = apply_filters( 'give_admin_settings_sanitize_option', $value, $option, $raw_value );
861
+				$value = apply_filters('give_admin_settings_sanitize_option', $value, $option, $raw_value);
862 862
 
863 863
 				/**
864 864
 				 * Sanitize the value of an option by option name.
865 865
 				 *
866 866
 				 * @since 1.8
867 867
 				 */
868
-				$value = apply_filters( "give_admin_settings_sanitize_option_{$field_option_name}", $value, $option, $raw_value );
868
+				$value = apply_filters("give_admin_settings_sanitize_option_{$field_option_name}", $value, $option, $raw_value);
869 869
 
870
-				if ( is_null( $value ) ) {
870
+				if (is_null($value)) {
871 871
 					continue;
872 872
 				}
873 873
 
874 874
 				// Check if option is an array and handle that differently to single values.
875
-				if ( $field_option_name && $setting_name ) {
876
-					if ( ! isset( $update_options[ $field_option_name ] ) ) {
877
-						$update_options[ $field_option_name ] = get_option( $field_option_name, array() );
875
+				if ($field_option_name && $setting_name) {
876
+					if ( ! isset($update_options[$field_option_name])) {
877
+						$update_options[$field_option_name] = get_option($field_option_name, array());
878 878
 					}
879
-					if ( ! is_array( $update_options[ $field_option_name ] ) ) {
880
-						$update_options[ $field_option_name ] = array();
879
+					if ( ! is_array($update_options[$field_option_name])) {
880
+						$update_options[$field_option_name] = array();
881 881
 					}
882
-					$update_options[ $field_option_name ][ $setting_name ] = $value;
882
+					$update_options[$field_option_name][$setting_name] = $value;
883 883
 				} else {
884
-					$update_options[ $field_option_name ] = $value;
884
+					$update_options[$field_option_name] = $value;
885 885
 				}
886 886
 			}
887 887
 
888 888
 			// Save all options in our array or there own option name i.e. option id.
889
-			if ( empty( $option_name ) ) {
890
-				foreach ( $update_options as $name => $value ) {
891
-					update_option( $name, $value );
889
+			if (empty($option_name)) {
890
+				foreach ($update_options as $name => $value) {
891
+					update_option($name, $value);
892 892
 
893 893
 					/**
894 894
 					 * Trigger action.
@@ -897,13 +897,13 @@  discard block
 block discarded – undo
897 897
 					 *
898 898
 					 * @since 1.8
899 899
 					 */
900
-					do_action( "give_save_option_{$name}", $value, $name );
900
+					do_action("give_save_option_{$name}", $value, $name);
901 901
 				}
902 902
 			} else {
903
-				$old_options    = ( $old_options = get_option( $option_name ) ) ? $old_options : array();
904
-				$update_options = array_merge( $old_options, $update_options );
903
+				$old_options    = ($old_options = get_option($option_name)) ? $old_options : array();
904
+				$update_options = array_merge($old_options, $update_options);
905 905
 
906
-				update_option( $option_name, $update_options );
906
+				update_option($option_name, $update_options);
907 907
 
908 908
 				/**
909 909
 				 * Trigger action.
@@ -912,7 +912,7 @@  discard block
 block discarded – undo
912 912
 				 *
913 913
 				 * @since 1.8
914 914
 				 */
915
-				do_action( "give_save_settings_{$option_name}", $update_options, $option_name );
915
+				do_action("give_save_settings_{$option_name}", $update_options, $option_name);
916 916
 			}
917 917
 
918 918
 			return true;
Please login to merge, or discard this patch.
includes/post-types.php 1 patch
Spacing   +144 added lines, -144 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
 
@@ -23,36 +23,36 @@  discard block
 block discarded – undo
23 23
 function give_setup_post_types() {
24 24
 
25 25
 	// Give Forms single post and archive options.
26
-	$give_forms_singular = give_is_setting_enabled( give_get_option( 'forms_singular' ) );
27
-	$give_forms_archives = give_is_setting_enabled( give_get_option( 'forms_archives' ) );
26
+	$give_forms_singular = give_is_setting_enabled(give_get_option('forms_singular'));
27
+	$give_forms_archives = give_is_setting_enabled(give_get_option('forms_archives'));
28 28
 
29
-	$give_forms_slug = defined( 'GIVE_SLUG' ) ? GIVE_SLUG : 'donations';
29
+	$give_forms_slug = defined('GIVE_SLUG') ? GIVE_SLUG : 'donations';
30 30
 	// Support for old 'GIVE_FORMS_SLUG' constant
31
-	if ( defined( 'GIVE_FORMS_SLUG' ) ) {
31
+	if (defined('GIVE_FORMS_SLUG')) {
32 32
 		$give_forms_slug = GIVE_FORMS_SLUG;
33 33
 	}
34 34
 
35
-	$give_forms_rewrite = defined( 'GIVE_DISABLE_FORMS_REWRITE' ) && GIVE_DISABLE_FORMS_REWRITE ? false : array(
35
+	$give_forms_rewrite = defined('GIVE_DISABLE_FORMS_REWRITE') && GIVE_DISABLE_FORMS_REWRITE ? false : array(
36 36
 		'slug'       => $give_forms_slug,
37 37
 		'with_front' => false,
38 38
 	);
39 39
 
40
-	$give_forms_labels = apply_filters( 'give_forms_labels', array(
41
-		'name'               => __( 'Donation Forms', 'give' ),
42
-		'singular_name'      => __( 'Form', 'give' ),
43
-		'add_new'            => __( 'Add Form', 'give' ),
44
-		'add_new_item'       => __( 'Add New Donation Form', 'give' ),
45
-		'edit_item'          => __( 'Edit Donation Form', 'give' ),
46
-		'new_item'           => __( 'New Form', 'give' ),
47
-		'all_items'          => __( 'All Forms', 'give' ),
48
-		'view_item'          => __( 'View Form', 'give' ),
49
-		'search_items'       => __( 'Search Forms', 'give' ),
50
-		'not_found'          => __( 'No forms found.', 'give' ),
51
-		'not_found_in_trash' => __( 'No forms found in Trash.', 'give' ),
40
+	$give_forms_labels = apply_filters('give_forms_labels', array(
41
+		'name'               => __('Donation Forms', 'give'),
42
+		'singular_name'      => __('Form', 'give'),
43
+		'add_new'            => __('Add Form', 'give'),
44
+		'add_new_item'       => __('Add New Donation Form', 'give'),
45
+		'edit_item'          => __('Edit Donation Form', 'give'),
46
+		'new_item'           => __('New Form', 'give'),
47
+		'all_items'          => __('All Forms', 'give'),
48
+		'view_item'          => __('View Form', 'give'),
49
+		'search_items'       => __('Search Forms', 'give'),
50
+		'not_found'          => __('No forms found.', 'give'),
51
+		'not_found_in_trash' => __('No forms found in Trash.', 'give'),
52 52
 		'parent_item_colon'  => '',
53
-		'menu_name'          => apply_filters( 'give_menu_name', __( 'Donations', 'give' ) ),
54
-		'name_admin_bar'     => apply_filters( 'give_name_admin_bar_name', __( 'Donation Form', 'give' ) ),
55
-	) );
53
+		'menu_name'          => apply_filters('give_menu_name', __('Donations', 'give')),
54
+		'name_admin_bar'     => apply_filters('give_name_admin_bar_name', __('Donation Form', 'give')),
55
+	));
56 56
 
57 57
 	// Default give_forms supports.
58 58
 	$give_form_supports = array(
@@ -64,14 +64,14 @@  discard block
 block discarded – undo
64 64
 	);
65 65
 
66 66
 	// Has the user disabled the excerpt?
67
-	if ( ! give_is_setting_enabled( give_get_option( 'forms_excerpt' ) ) ) {
68
-		unset( $give_form_supports[2] );
67
+	if ( ! give_is_setting_enabled(give_get_option('forms_excerpt'))) {
68
+		unset($give_form_supports[2]);
69 69
 	}
70 70
 
71 71
 	// Has user disabled the featured image?
72
-	if ( ! give_is_setting_enabled( give_get_option( 'form_featured_img' ) ) ) {
73
-		unset( $give_form_supports[1] );
74
-		remove_action( 'give_before_single_form_summary', 'give_show_form_images' );
72
+	if ( ! give_is_setting_enabled(give_get_option('form_featured_img'))) {
73
+		unset($give_form_supports[1]);
74
+		remove_action('give_before_single_form_summary', 'give_show_form_images');
75 75
 	}
76 76
 
77 77
 	$give_forms_args = array(
@@ -87,42 +87,42 @@  discard block
 block discarded – undo
87 87
 		'has_archive'        => $give_forms_archives,
88 88
 		'menu_icon'          => 'dashicons-give',
89 89
 		'hierarchical'       => false,
90
-		'supports'           => apply_filters( 'give_forms_supports', $give_form_supports ),
90
+		'supports'           => apply_filters('give_forms_supports', $give_form_supports),
91 91
 	);
92
-	register_post_type( 'give_forms', apply_filters( 'give_forms_post_type_args', $give_forms_args ) );
92
+	register_post_type('give_forms', apply_filters('give_forms_post_type_args', $give_forms_args));
93 93
 
94 94
 	/** Donation Post Type */
95 95
 	$payment_labels = array(
96
-		'name'               => _x( 'Donations', 'post type general name', 'give' ),
97
-		'singular_name'      => _x( 'Donation', 'post type singular name', 'give' ),
98
-		'add_new'            => __( 'Add New', 'give' ),
99
-		'add_new_item'       => __( 'Add New Donation', 'give' ),
100
-		'edit_item'          => __( 'Edit Donation', 'give' ),
101
-		'new_item'           => __( 'New Donation', 'give' ),
102
-		'all_items'          => __( 'All Donations', 'give' ),
103
-		'view_item'          => __( 'View Donation', 'give' ),
104
-		'search_items'       => __( 'Search Donations', 'give' ),
105
-		'not_found'          => __( 'No donations found.', 'give' ),
106
-		'not_found_in_trash' => __( 'No donations found in Trash.', 'give' ),
96
+		'name'               => _x('Donations', 'post type general name', 'give'),
97
+		'singular_name'      => _x('Donation', 'post type singular name', 'give'),
98
+		'add_new'            => __('Add New', 'give'),
99
+		'add_new_item'       => __('Add New Donation', 'give'),
100
+		'edit_item'          => __('Edit Donation', 'give'),
101
+		'new_item'           => __('New Donation', 'give'),
102
+		'all_items'          => __('All Donations', 'give'),
103
+		'view_item'          => __('View Donation', 'give'),
104
+		'search_items'       => __('Search Donations', 'give'),
105
+		'not_found'          => __('No donations found.', 'give'),
106
+		'not_found_in_trash' => __('No donations found in Trash.', 'give'),
107 107
 		'parent_item_colon'  => '',
108
-		'menu_name'          => __( 'Donations', 'give' ),
108
+		'menu_name'          => __('Donations', 'give'),
109 109
 	);
110 110
 
111 111
 	$payment_args = array(
112
-		'labels'          => apply_filters( 'give_payment_labels', $payment_labels ),
112
+		'labels'          => apply_filters('give_payment_labels', $payment_labels),
113 113
 		'public'          => false,
114 114
 		'query_var'       => false,
115 115
 		'rewrite'         => false,
116 116
 		'map_meta_cap'    => true,
117 117
 		'capability_type' => 'give_payment',
118
-		'supports'        => array( 'title' ),
118
+		'supports'        => array('title'),
119 119
 		'can_export'      => true,
120 120
 	);
121
-	register_post_type( 'give_payment', $payment_args );
121
+	register_post_type('give_payment', $payment_args);
122 122
 
123 123
 }
124 124
 
125
-add_action( 'init', 'give_setup_post_types', 1 );
125
+add_action('init', 'give_setup_post_types', 1);
126 126
 
127 127
 
128 128
 /**
@@ -135,30 +135,30 @@  discard block
 block discarded – undo
135 135
  */
136 136
 function give_setup_taxonomies() {
137 137
 
138
-	$slug = defined( 'GIVE_FORMS_SLUG' ) ? GIVE_FORMS_SLUG : 'donations';
138
+	$slug = defined('GIVE_FORMS_SLUG') ? GIVE_FORMS_SLUG : 'donations';
139 139
 
140 140
 	/** Categories */
141 141
 	$category_labels = array(
142
-		'name'              => _x( 'Form Categories', 'taxonomy general name', 'give' ),
143
-		'singular_name'     => _x( 'Category', 'taxonomy singular name', 'give' ),
144
-		'search_items'      => __( 'Search Categories', 'give' ),
145
-		'all_items'         => __( 'All Categories', 'give' ),
146
-		'parent_item'       => __( 'Parent Category', 'give' ),
147
-		'parent_item_colon' => __( 'Parent Category:', 'give' ),
148
-		'edit_item'         => __( 'Edit Category', 'give' ),
149
-		'update_item'       => __( 'Update Category', 'give' ),
150
-		'add_new_item'      => __( 'Add New Category', 'give' ),
151
-		'new_item_name'     => __( 'New Category Name', 'give' ),
152
-		'menu_name'         => __( 'Categories', 'give' ),
142
+		'name'              => _x('Form Categories', 'taxonomy general name', 'give'),
143
+		'singular_name'     => _x('Category', 'taxonomy singular name', 'give'),
144
+		'search_items'      => __('Search Categories', 'give'),
145
+		'all_items'         => __('All Categories', 'give'),
146
+		'parent_item'       => __('Parent Category', 'give'),
147
+		'parent_item_colon' => __('Parent Category:', 'give'),
148
+		'edit_item'         => __('Edit Category', 'give'),
149
+		'update_item'       => __('Update Category', 'give'),
150
+		'add_new_item'      => __('Add New Category', 'give'),
151
+		'new_item_name'     => __('New Category Name', 'give'),
152
+		'menu_name'         => __('Categories', 'give'),
153 153
 	);
154 154
 
155
-	$category_args = apply_filters( 'give_forms_category_args', array(
155
+	$category_args = apply_filters('give_forms_category_args', array(
156 156
 			'hierarchical' => true,
157
-			'labels'       => apply_filters( 'give_forms_category_labels', $category_labels ),
157
+			'labels'       => apply_filters('give_forms_category_labels', $category_labels),
158 158
 			'show_ui'      => true,
159 159
 			'query_var'    => 'give_forms_category',
160 160
 			'rewrite'      => array(
161
-				'slug'         => $slug . '/category',
161
+				'slug'         => $slug.'/category',
162 162
 				'with_front'   => false,
163 163
 				'hierarchical' => true,
164 164
 			),
@@ -172,33 +172,33 @@  discard block
 block discarded – undo
172 172
 	);
173 173
 
174 174
 	// Does the user want categories?
175
-	if ( give_is_setting_enabled( give_get_option( 'categories', 'disabled' ) ) ) {
176
-		register_taxonomy( 'give_forms_category', array( 'give_forms' ), $category_args );
177
-		register_taxonomy_for_object_type( 'give_forms_category', 'give_forms' );
175
+	if (give_is_setting_enabled(give_get_option('categories', 'disabled'))) {
176
+		register_taxonomy('give_forms_category', array('give_forms'), $category_args);
177
+		register_taxonomy_for_object_type('give_forms_category', 'give_forms');
178 178
 	}
179 179
 
180 180
 	/** Tags */
181 181
 	$tag_labels = array(
182
-		'name'                  => _x( 'Form Tags', 'taxonomy general name', 'give' ),
183
-		'singular_name'         => _x( 'Tag', 'taxonomy singular name', 'give' ),
184
-		'search_items'          => __( 'Search Tags', 'give' ),
185
-		'all_items'             => __( 'All Tags', 'give' ),
186
-		'parent_item'           => __( 'Parent Tag', 'give' ),
187
-		'parent_item_colon'     => __( 'Parent Tag:', 'give' ),
188
-		'edit_item'             => __( 'Edit Tag', 'give' ),
189
-		'update_item'           => __( 'Update Tag', 'give' ),
190
-		'add_new_item'          => __( 'Add New Tag', 'give' ),
191
-		'new_item_name'         => __( 'New Tag Name', 'give' ),
192
-		'menu_name'             => __( 'Tags', 'give' ),
193
-		'choose_from_most_used' => __( 'Choose from most used tags.', 'give' ),
182
+		'name'                  => _x('Form Tags', 'taxonomy general name', 'give'),
183
+		'singular_name'         => _x('Tag', 'taxonomy singular name', 'give'),
184
+		'search_items'          => __('Search Tags', 'give'),
185
+		'all_items'             => __('All Tags', 'give'),
186
+		'parent_item'           => __('Parent Tag', 'give'),
187
+		'parent_item_colon'     => __('Parent Tag:', 'give'),
188
+		'edit_item'             => __('Edit Tag', 'give'),
189
+		'update_item'           => __('Update Tag', 'give'),
190
+		'add_new_item'          => __('Add New Tag', 'give'),
191
+		'new_item_name'         => __('New Tag Name', 'give'),
192
+		'menu_name'             => __('Tags', 'give'),
193
+		'choose_from_most_used' => __('Choose from most used tags.', 'give'),
194 194
 	);
195 195
 
196
-	$tag_args = apply_filters( 'give_forms_tag_args', array(
196
+	$tag_args = apply_filters('give_forms_tag_args', array(
197 197
 			'hierarchical' => false,
198
-			'labels'       => apply_filters( 'give_forms_tag_labels', $tag_labels ),
198
+			'labels'       => apply_filters('give_forms_tag_labels', $tag_labels),
199 199
 			'show_ui'      => true,
200 200
 			'query_var'    => 'give_forms_tag',
201
-			'rewrite'      => array( 'slug' => $slug . '/tag', 'with_front' => false, 'hierarchical' => true ),
201
+			'rewrite'      => array('slug' => $slug.'/tag', 'with_front' => false, 'hierarchical' => true),
202 202
 			'capabilities' => array(
203 203
 				'manage_terms' => 'manage_give_form_terms',
204 204
 				'edit_terms'   => 'edit_give_form_terms',
@@ -208,14 +208,14 @@  discard block
 block discarded – undo
208 208
 		)
209 209
 	);
210 210
 
211
-	if ( give_is_setting_enabled( give_get_option( 'tags', 'disabled' ) ) ) {
212
-		register_taxonomy( 'give_forms_tag', array( 'give_forms' ), $tag_args );
213
-		register_taxonomy_for_object_type( 'give_forms_tag', 'give_forms' );
211
+	if (give_is_setting_enabled(give_get_option('tags', 'disabled'))) {
212
+		register_taxonomy('give_forms_tag', array('give_forms'), $tag_args);
213
+		register_taxonomy_for_object_type('give_forms_tag', 'give_forms');
214 214
 	}
215 215
 
216 216
 }
217 217
 
218
-add_action( 'init', 'give_setup_taxonomies', 0 );
218
+add_action('init', 'give_setup_taxonomies', 0);
219 219
 
220 220
 
221 221
 /**
@@ -226,11 +226,11 @@  discard block
 block discarded – undo
226 226
  */
227 227
 function give_get_default_form_labels() {
228 228
 	$defaults = array(
229
-		'singular' => __( 'Form', 'give' ),
230
-		'plural'   => __( 'Forms', 'give' ),
229
+		'singular' => __('Form', 'give'),
230
+		'plural'   => __('Forms', 'give'),
231 231
 	);
232 232
 
233
-	return apply_filters( 'give_default_form_name', $defaults );
233
+	return apply_filters('give_default_form_name', $defaults);
234 234
 }
235 235
 
236 236
 /**
@@ -242,10 +242,10 @@  discard block
 block discarded – undo
242 242
  *
243 243
  * @return string $defaults['singular'] Singular label
244 244
  */
245
-function give_get_forms_label_singular( $lowercase = false ) {
245
+function give_get_forms_label_singular($lowercase = false) {
246 246
 	$defaults = give_get_default_form_labels();
247 247
 
248
-	return ( $lowercase ) ? strtolower( $defaults['singular'] ) : $defaults['singular'];
248
+	return ($lowercase) ? strtolower($defaults['singular']) : $defaults['singular'];
249 249
 }
250 250
 
251 251
 /**
@@ -254,10 +254,10 @@  discard block
 block discarded – undo
254 254
  * @since 1.0
255 255
  * @return string $defaults['plural'] Plural label
256 256
  */
257
-function give_get_forms_label_plural( $lowercase = false ) {
257
+function give_get_forms_label_plural($lowercase = false) {
258 258
 	$defaults = give_get_default_form_labels();
259 259
 
260
-	return ( $lowercase ) ? strtolower( $defaults['plural'] ) : $defaults['plural'];
260
+	return ($lowercase) ? strtolower($defaults['plural']) : $defaults['plural'];
261 261
 }
262 262
 
263 263
 /**
@@ -269,24 +269,24 @@  discard block
 block discarded – undo
269 269
  *
270 270
  * @return string $title New placeholder text
271 271
  */
272
-function give_change_default_title( $title ) {
272
+function give_change_default_title($title) {
273 273
 	// If a frontend plugin uses this filter (check extensions before changing this function)
274
-	if ( ! is_admin() ) {
275
-		$title = __( 'Enter form title here', 'give' );
274
+	if ( ! is_admin()) {
275
+		$title = __('Enter form title here', 'give');
276 276
 
277 277
 		return $title;
278 278
 	}
279 279
 
280 280
 	$screen = get_current_screen();
281 281
 
282
-	if ( 'give_forms' == $screen->post_type ) {
283
-		$title = __( 'Enter form title here', 'give' );
282
+	if ('give_forms' == $screen->post_type) {
283
+		$title = __('Enter form title here', 'give');
284 284
 	}
285 285
 
286 286
 	return $title;
287 287
 }
288 288
 
289
-add_filter( 'enter_title_here', 'give_change_default_title' );
289
+add_filter('enter_title_here', 'give_change_default_title');
290 290
 
291 291
 /**
292 292
  * Registers Custom Post Statuses which are used by the Payments
@@ -296,58 +296,58 @@  discard block
 block discarded – undo
296 296
  */
297 297
 function give_register_post_type_statuses() {
298 298
 	// Payment Statuses
299
-	register_post_status( 'refunded', array(
300
-		'label'                     => __( 'Refunded', 'give' ),
299
+	register_post_status('refunded', array(
300
+		'label'                     => __('Refunded', 'give'),
301 301
 		'public'                    => true,
302 302
 		'exclude_from_search'       => false,
303 303
 		'show_in_admin_all_list'    => true,
304 304
 		'show_in_admin_status_list' => true,
305
-		'label_count'               => _n_noop( 'Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'give' ),
306
-	) );
307
-	register_post_status( 'failed', array(
308
-		'label'                     => __( 'Failed', 'give' ),
305
+		'label_count'               => _n_noop('Refunded <span class="count">(%s)</span>', 'Refunded <span class="count">(%s)</span>', 'give'),
306
+	));
307
+	register_post_status('failed', array(
308
+		'label'                     => __('Failed', 'give'),
309 309
 		'public'                    => true,
310 310
 		'exclude_from_search'       => false,
311 311
 		'show_in_admin_all_list'    => true,
312 312
 		'show_in_admin_status_list' => true,
313
-		'label_count'               => _n_noop( 'Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'give' ),
314
-	) );
315
-	register_post_status( 'revoked', array(
316
-		'label'                     => __( 'Revoked', 'give' ),
313
+		'label_count'               => _n_noop('Failed <span class="count">(%s)</span>', 'Failed <span class="count">(%s)</span>', 'give'),
314
+	));
315
+	register_post_status('revoked', array(
316
+		'label'                     => __('Revoked', 'give'),
317 317
 		'public'                    => true,
318 318
 		'exclude_from_search'       => false,
319 319
 		'show_in_admin_all_list'    => true,
320 320
 		'show_in_admin_status_list' => true,
321
-		'label_count'               => _n_noop( 'Revoked <span class="count">(%s)</span>', 'Revoked <span class="count">(%s)</span>', 'give' ),
322
-	) );
323
-	register_post_status( 'cancelled', array(
324
-		'label'                     => __( 'Cancelled', 'give' ),
321
+		'label_count'               => _n_noop('Revoked <span class="count">(%s)</span>', 'Revoked <span class="count">(%s)</span>', 'give'),
322
+	));
323
+	register_post_status('cancelled', array(
324
+		'label'                     => __('Cancelled', 'give'),
325 325
 		'public'                    => true,
326 326
 		'exclude_from_search'       => false,
327 327
 		'show_in_admin_all_list'    => true,
328 328
 		'show_in_admin_status_list' => true,
329
-		'label_count'               => _n_noop( 'Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'give' ),
330
-	) );
331
-	register_post_status( 'abandoned', array(
332
-		'label'                     => __( 'Abandoned', 'give' ),
329
+		'label_count'               => _n_noop('Cancelled <span class="count">(%s)</span>', 'Cancelled <span class="count">(%s)</span>', 'give'),
330
+	));
331
+	register_post_status('abandoned', array(
332
+		'label'                     => __('Abandoned', 'give'),
333 333
 		'public'                    => true,
334 334
 		'exclude_from_search'       => false,
335 335
 		'show_in_admin_all_list'    => true,
336 336
 		'show_in_admin_status_list' => true,
337
-		'label_count'               => _n_noop( 'Abandoned <span class="count">(%s)</span>', 'Abandoned <span class="count">(%s)</span>', 'give' ),
338
-	) );
339
-	register_post_status( 'processing', array(
340
-		'label'                     => _x( 'Processing', 'Processing payment status', 'give' ),
337
+		'label_count'               => _n_noop('Abandoned <span class="count">(%s)</span>', 'Abandoned <span class="count">(%s)</span>', 'give'),
338
+	));
339
+	register_post_status('processing', array(
340
+		'label'                     => _x('Processing', 'Processing payment status', 'give'),
341 341
 		'public'                    => true,
342 342
 		'exclude_from_search'       => false,
343 343
 		'show_in_admin_all_list'    => true,
344 344
 		'show_in_admin_status_list' => true,
345
-		'label_count'               => _n_noop( 'Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'give' )
346
-	)  );
345
+		'label_count'               => _n_noop('Processing <span class="count">(%s)</span>', 'Processing <span class="count">(%s)</span>', 'give')
346
+	));
347 347
 
348 348
 }
349 349
 
350
-add_action( 'init', 'give_register_post_type_statuses' );
350
+add_action('init', 'give_register_post_type_statuses');
351 351
 
352 352
 /**
353 353
  * Updated Messages
@@ -360,27 +360,27 @@  discard block
 block discarded – undo
360 360
  *
361 361
  * @return array $messages New post updated messages
362 362
  */
363
-function give_updated_messages( $messages ) {
363
+function give_updated_messages($messages) {
364 364
 	global $post, $post_ID;
365 365
 
366
-	if ( ! give_is_setting_enabled( give_get_option( 'forms_singular' ) ) ) {
366
+	if ( ! give_is_setting_enabled(give_get_option('forms_singular'))) {
367 367
 
368 368
 		$messages['give_forms'] = array(
369
-			1 => __( 'Form updated.', 'give' ),
370
-			4 => __( 'Form updated.', 'give' ),
371
-			6 => __( 'Form published.', 'give' ),
372
-			7 => __( 'Form saved.', 'give' ),
373
-			8 => __( 'Form submitted.', 'give' ),
369
+			1 => __('Form updated.', 'give'),
370
+			4 => __('Form updated.', 'give'),
371
+			6 => __('Form published.', 'give'),
372
+			7 => __('Form saved.', 'give'),
373
+			8 => __('Form submitted.', 'give'),
374 374
 		);
375 375
 
376 376
 	} else {
377 377
 
378 378
 		$messages['give_forms'] = array(
379
-			1 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form updated.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ),
380
-			4 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form updated.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ),
381
-			6 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form published.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ),
382
-			7 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form saved.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ),
383
-			8 => sprintf( '%1$s <a href="%2$s">%3$s</a>', __( 'Form submitted.', 'give' ), get_permalink( $post_ID ), __( 'View Form', 'give' ) ),
379
+			1 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form updated.', 'give'), get_permalink($post_ID), __('View Form', 'give')),
380
+			4 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form updated.', 'give'), get_permalink($post_ID), __('View Form', 'give')),
381
+			6 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form published.', 'give'), get_permalink($post_ID), __('View Form', 'give')),
382
+			7 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form saved.', 'give'), get_permalink($post_ID), __('View Form', 'give')),
383
+			8 => sprintf('%1$s <a href="%2$s">%3$s</a>', __('Form submitted.', 'give'), get_permalink($post_ID), __('View Form', 'give')),
384 384
 		);
385 385
 
386 386
 	}
@@ -388,27 +388,27 @@  discard block
 block discarded – undo
388 388
 	return $messages;
389 389
 }
390 390
 
391
-add_filter( 'post_updated_messages', 'give_updated_messages' );
391
+add_filter('post_updated_messages', 'give_updated_messages');
392 392
 
393 393
 
394 394
 /**
395 395
  * Setup Post Type Images
396 396
  */
397
-add_action( 'after_setup_theme', 'give_add_thumbnail_support', 10 );
397
+add_action('after_setup_theme', 'give_add_thumbnail_support', 10);
398 398
 
399 399
 /**
400 400
  * Ensure post thumbnail support is turned on
401 401
  */
402 402
 function give_add_thumbnail_support() {
403
-	if ( ! give_is_setting_enabled( give_get_option( 'form_featured_img' ) ) ) {
403
+	if ( ! give_is_setting_enabled(give_get_option('form_featured_img'))) {
404 404
 		return;
405 405
 	}
406 406
 
407
-	if ( ! current_theme_supports( 'post-thumbnails' ) ) {
408
-		add_theme_support( 'post-thumbnails' );
407
+	if ( ! current_theme_supports('post-thumbnails')) {
408
+		add_theme_support('post-thumbnails');
409 409
 	}
410 410
 
411
-	add_post_type_support( 'give_forms', 'thumbnail' );
411
+	add_post_type_support('give_forms', 'thumbnail');
412 412
 }
413 413
 
414 414
 /**
@@ -420,21 +420,21 @@  discard block
 block discarded – undo
420 420
 
421 421
 	// Single Give Forms (disabled if single turned off in settings)
422 422
 	if (
423
-		give_is_setting_enabled( give_get_option( 'forms_singular' ) )
424
-		&& give_is_setting_enabled( give_get_option( 'form_sidebar' ) )
423
+		give_is_setting_enabled(give_get_option('forms_singular'))
424
+		&& give_is_setting_enabled(give_get_option('form_sidebar'))
425 425
 	) {
426 426
 
427
-		register_sidebar( apply_filters( 'give_forms_single_sidebar', array(
428
-			'name'          => __( 'Give Single Form Sidebar', 'give' ),
427
+		register_sidebar(apply_filters('give_forms_single_sidebar', array(
428
+			'name'          => __('Give Single Form Sidebar', 'give'),
429 429
 			'id'            => 'give-forms-sidebar',
430
-			'description'   => __( 'Widgets in this area will be shown on the single Give forms aside area. This sidebar will not display for embedded forms.', 'give' ),
430
+			'description'   => __('Widgets in this area will be shown on the single Give forms aside area. This sidebar will not display for embedded forms.', 'give'),
431 431
 			'before_widget' => '<div id="%1$s" class="widget %2$s">',
432 432
 			'after_widget'  => '</div>',
433 433
 			'before_title'  => '<h3 class="widgettitle widget-title">',
434 434
 			'after_title'   => '</h3>',
435
-		) ) );
435
+		)));
436 436
 
437 437
 	}
438 438
 }
439 439
 
440
-add_action( 'widgets_init', 'give_widgets_init', 999 );
440
+add_action('widgets_init', 'give_widgets_init', 999);
Please login to merge, or discard this patch.