Completed
Pull Request — master (#776)
by
unknown
18:12
created
includes/admin/customers/class-customer-table.php 1 patch
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  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
 
17 17
 // Load WP_List_Table if not loaded
18
-if ( ! class_exists( 'WP_List_Table' ) ) {
19
-	require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
18
+if ( ! class_exists('WP_List_Table')) {
19
+	require_once ABSPATH.'wp-admin/includes/class-wp-list-table.php';
20 20
 }
21 21
 
22 22
 /**
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 		global $status, $page;
63 63
 
64 64
 		// Set parent defaults
65
-		parent::__construct( array(
66
-			'singular' => esc_html( 'Donor', 'give' ),     // Singular name of the listed records
67
-			'plural'   => esc_html( 'Donors', 'give' ),    // Plural name of the listed records
65
+		parent::__construct(array(
66
+			'singular' => esc_html('Donor', 'give'), // Singular name of the listed records
67
+			'plural'   => esc_html('Donors', 'give'), // Plural name of the listed records
68 68
 			'ajax'     => false                            // Does this table support ajax?
69
-		) );
69
+		));
70 70
 
71 71
 	}
72 72
 
@@ -81,20 +81,20 @@  discard block
 block discarded – undo
81 81
 	 *
82 82
 	 * @return void
83 83
 	 */
84
-	public function search_box( $text, $input_id ) {
85
-		$input_id = $input_id . '-search-input';
84
+	public function search_box($text, $input_id) {
85
+		$input_id = $input_id.'-search-input';
86 86
 
87
-		if ( ! empty( $_REQUEST['orderby'] ) ) {
88
-			echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
87
+		if ( ! empty($_REQUEST['orderby'])) {
88
+			echo '<input type="hidden" name="orderby" value="'.esc_attr($_REQUEST['orderby']).'" />';
89 89
 		}
90
-		if ( ! empty( $_REQUEST['order'] ) ) {
91
-			echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
90
+		if ( ! empty($_REQUEST['order'])) {
91
+			echo '<input type="hidden" name="order" value="'.esc_attr($_REQUEST['order']).'" />';
92 92
 		}
93 93
 		?>
94 94
 		<p class="search-box">
95 95
 			<label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
96 96
 			<input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
97
-			<?php submit_button( $text, 'button', false, false, array( 'ID' => 'search-submit' ) ); ?>
97
+			<?php submit_button($text, 'button', false, false, array('ID' => 'search-submit')); ?>
98 98
 		</p>
99 99
 	<?php
100 100
 	}
@@ -110,42 +110,42 @@  discard block
 block discarded – undo
110 110
 	 *
111 111
 	 * @return string Column Name
112 112
 	 */
113
-	public function column_default( $item, $column_name ) {
114
-		switch ( $column_name ) {
113
+	public function column_default($item, $column_name) {
114
+		switch ($column_name) {
115 115
 
116 116
 			case 'num_purchases' :
117
-				$value = '<a href="' .
118
-				         admin_url( '/edit.php?post_type=give_forms&page=give-payment-history&user=' . urlencode( $item['email'] )
119
-				         ) . '">' . esc_html( $item['num_purchases'] ) . '</a>';
117
+				$value = '<a href="'.
118
+				         admin_url('/edit.php?post_type=give_forms&page=give-payment-history&user='.urlencode($item['email'])
119
+				         ).'">'.esc_html($item['num_purchases']).'</a>';
120 120
 				break;
121 121
 
122 122
 			case 'amount_spent' :
123
-				$value = give_currency_filter( give_format_amount( $item[ $column_name ] ) );
123
+				$value = give_currency_filter(give_format_amount($item[$column_name]));
124 124
 				break;
125 125
 
126 126
 			case 'date_created' :
127
-				$value = date_i18n( get_option( 'date_format' ), strtotime( $item['date_created'] ) );
127
+				$value = date_i18n(get_option('date_format'), strtotime($item['date_created']));
128 128
 				break;
129 129
 
130 130
 			default:
131
-				$value = isset( $item[ $column_name ] ) ? $item[ $column_name ] : null;
131
+				$value = isset($item[$column_name]) ? $item[$column_name] : null;
132 132
 				break;
133 133
 		}
134 134
 
135
-		return apply_filters( 'give_report_column_' . $column_name, $value, $item['id'] );
135
+		return apply_filters('give_report_column_'.$column_name, $value, $item['id']);
136 136
 
137 137
 	}
138 138
 
139
-	public function column_name( $item ) {
140
-		$name = '#' . $item['id'] . ' ';
141
-		$name .= ! empty( $item['name'] ) ? $item['name'] : '<em>' . esc_html( 'Unnamed Donor', 'give' ) . '</em>';
142
-		$view_url = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $item['id'] );
139
+	public function column_name($item) {
140
+		$name = '#'.$item['id'].' ';
141
+		$name .= ! empty($item['name']) ? $item['name'] : '<em>'.esc_html('Unnamed Donor', 'give').'</em>';
142
+		$view_url = admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$item['id']);
143 143
 		$actions  = array(
144
-			'view'   => sprintf( '<a href="%1$s">%2$s</a>', $view_url, esc_html( 'View Donor', 'give' ) ),
145
-			'delete' => sprintf( '<a href="%1$s">%2$s</a>', admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=delete&id=' . $item['id'] ), esc_html( 'Delete', 'give' ) )
144
+			'view'   => sprintf('<a href="%1$s">%2$s</a>', $view_url, esc_html('View Donor', 'give')),
145
+			'delete' => sprintf('<a href="%1$s">%2$s</a>', admin_url('edit.php?post_type=give_forms&page=give-donors&view=delete&id='.$item['id']), esc_html('Delete', 'give'))
146 146
 		);
147 147
 
148
-		return '<a href="' . esc_url( $view_url ) . '">' . $name . '</a>' . $this->row_actions( $actions );
148
+		return '<a href="'.esc_url($view_url).'">'.$name.'</a>'.$this->row_actions($actions);
149 149
 	}
150 150
 
151 151
 	/**
@@ -157,14 +157,14 @@  discard block
 block discarded – undo
157 157
 	 */
158 158
 	public function get_columns() {
159 159
 		$columns = array(
160
-			'name'          => esc_html( 'Name', 'give' ),
161
-			'email'         => esc_html( 'Email', 'give' ),
162
-			'num_purchases' => esc_html( 'Donations', 'give' ),
163
-			'amount_spent'  => esc_html( 'Total Donated', 'give' ),
164
-			'date_created'  => esc_html( 'Date Created', 'give' )
160
+			'name'          => esc_html('Name', 'give'),
161
+			'email'         => esc_html('Email', 'give'),
162
+			'num_purchases' => esc_html('Donations', 'give'),
163
+			'amount_spent'  => esc_html('Total Donated', 'give'),
164
+			'date_created'  => esc_html('Date Created', 'give')
165 165
 		);
166 166
 
167
-		return apply_filters( 'give_report_customer_columns', $columns );
167
+		return apply_filters('give_report_customer_columns', $columns);
168 168
 
169 169
 	}
170 170
 
@@ -177,10 +177,10 @@  discard block
 block discarded – undo
177 177
 	 */
178 178
 	public function get_sortable_columns() {
179 179
 		return array(
180
-			'date_created'  => array( 'date_created', true ),
181
-			'name'          => array( 'name', true ),
182
-			'num_purchases' => array( 'purchase_count', false ),
183
-			'amount_spent'  => array( 'purchase_value', false ),
180
+			'date_created'  => array('date_created', true),
181
+			'name'          => array('name', true),
182
+			'num_purchases' => array('purchase_count', false),
183
+			'amount_spent'  => array('purchase_value', false),
184 184
 		);
185 185
 	}
186 186
 
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 	 * @since  1.0
192 192
 	 * @return void
193 193
 	 */
194
-	public function bulk_actions( $which = '' ) {
194
+	public function bulk_actions($which = '') {
195 195
 		// These aren't really bulk actions but this outputs the markup in the right place
196 196
 	}
197 197
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 	 * @return int Current page number
204 204
 	 */
205 205
 	public function get_paged() {
206
-		return isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1;
206
+		return isset($_GET['paged']) ? absint($_GET['paged']) : 1;
207 207
 	}
208 208
 
209 209
 	/**
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 	 * @return mixed string If search is present, false otherwise
215 215
 	 */
216 216
 	public function get_search() {
217
-		return ! empty( $_GET['s'] ) ? urldecode( trim( $_GET['s'] ) ) : false;
217
+		return ! empty($_GET['s']) ? urldecode(trim($_GET['s'])) : false;
218 218
 	}
219 219
 
220 220
 	/**
@@ -231,10 +231,10 @@  discard block
 block discarded – undo
231 231
 
232 232
 		$data    = array();
233 233
 		$paged   = $this->get_paged();
234
-		$offset  = $this->per_page * ( $paged - 1 );
234
+		$offset  = $this->per_page * ($paged - 1);
235 235
 		$search  = $this->get_search();
236
-		$order   = isset( $_GET['order'] ) ? sanitize_text_field( $_GET['order'] ) : 'DESC';
237
-		$orderby = isset( $_GET['orderby'] ) ? sanitize_text_field( $_GET['orderby'] ) : 'id';
236
+		$order   = isset($_GET['order']) ? sanitize_text_field($_GET['order']) : 'DESC';
237
+		$orderby = isset($_GET['orderby']) ? sanitize_text_field($_GET['orderby']) : 'id';
238 238
 
239 239
 		$args = array(
240 240
 			'number'  => $this->per_page,
@@ -243,21 +243,21 @@  discard block
 block discarded – undo
243 243
 			'orderby' => $orderby
244 244
 		);
245 245
 
246
-		if ( is_email( $search ) ) {
246
+		if (is_email($search)) {
247 247
 			$args['email'] = $search;
248
-		} elseif ( is_numeric( $search ) ) {
248
+		} elseif (is_numeric($search)) {
249 249
 			$args['id'] = $search;
250 250
 		} else {
251 251
 			$args['name'] = $search;
252 252
 		}
253 253
 
254
-		$customers = Give()->customers->get_customers( $args );
254
+		$customers = Give()->customers->get_customers($args);
255 255
 
256
-		if ( $customers ) {
256
+		if ($customers) {
257 257
 
258
-			foreach ( $customers as $customer ) {
258
+			foreach ($customers as $customer) {
259 259
 
260
-				$user_id = ! empty( $customer->user_id ) ? intval( $customer->user_id ) : 0;
260
+				$user_id = ! empty($customer->user_id) ? intval($customer->user_id) : 0;
261 261
 
262 262
 				$data[] = array(
263 263
 					'id'            => $customer->id,
@@ -291,16 +291,16 @@  discard block
 block discarded – undo
291 291
 		$hidden   = array(); // No hidden columns
292 292
 		$sortable = $this->get_sortable_columns();
293 293
 
294
-		$this->_column_headers = array( $columns, $hidden, $sortable );
294
+		$this->_column_headers = array($columns, $hidden, $sortable);
295 295
 
296 296
 		$this->items = $this->reports_data();
297 297
 
298 298
 		$this->total = give_count_total_customers();
299 299
 
300
-		$this->set_pagination_args( array(
300
+		$this->set_pagination_args(array(
301 301
 			'total_items' => $this->total,
302 302
 			'per_page'    => $this->per_page,
303
-			'total_pages' => ceil( $this->total / $this->per_page )
304
-		) );
303
+			'total_pages' => ceil($this->total / $this->per_page)
304
+		));
305 305
 	}
306 306
 }
307 307
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/customers/customer-actions.php 1 patch
Spacing   +128 added lines, -128 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,15 +23,15 @@  discard block
 block discarded – undo
23 23
  *
24 24
  * @return array $output Response messages
25 25
  */
26
-function give_edit_customer( $args ) {
26
+function give_edit_customer($args) {
27 27
 	
28
-	$customer_edit_role = apply_filters( 'give_edit_customers_role', 'edit_give_payments' );
28
+	$customer_edit_role = apply_filters('give_edit_customers_role', 'edit_give_payments');
29 29
 
30
-	if ( ! is_admin() || ! current_user_can( $customer_edit_role ) ) {
31
-		wp_die( esc_html( 'You do not have permission to edit this donor.', 'give' ) );
30
+	if ( ! is_admin() || ! current_user_can($customer_edit_role)) {
31
+		wp_die(esc_html('You do not have permission to edit this donor.', 'give'));
32 32
 	}
33 33
 
34
-	if ( empty( $args ) ) {
34
+	if (empty($args)) {
35 35
 		return;
36 36
 	}
37 37
 
@@ -39,12 +39,12 @@  discard block
 block discarded – undo
39 39
 	$customer_id   = (int) $args['customerinfo']['id'];
40 40
 	$nonce         = $args['_wpnonce'];
41 41
 
42
-	if ( ! wp_verify_nonce( $nonce, 'edit-customer' ) ) {
43
-		wp_die( esc_html( 'Cheatin\' eh?!', 'give' ) );
42
+	if ( ! wp_verify_nonce($nonce, 'edit-customer')) {
43
+		wp_die(esc_html('Cheatin\' eh?!', 'give'));
44 44
 	}
45 45
 
46
-	$customer = new Give_Customer( $customer_id );
47
-	if ( empty( $customer->id ) ) {
46
+	$customer = new Give_Customer($customer_id);
47
+	if (empty($customer->id)) {
48 48
 		return false;
49 49
 	}
50 50
 
@@ -54,23 +54,23 @@  discard block
 block discarded – undo
54 54
 		'user_id' => 0
55 55
 	);
56 56
 
57
-	$customer_info = wp_parse_args( $customer_info, $defaults );
57
+	$customer_info = wp_parse_args($customer_info, $defaults);
58 58
 
59
-	if ( ! is_email( $customer_info['email'] ) ) {
60
-		give_set_error( 'give-invalid-email', esc_html( 'Please enter a valid email address.', 'give' ) );
59
+	if ( ! is_email($customer_info['email'])) {
60
+		give_set_error('give-invalid-email', esc_html('Please enter a valid email address.', 'give'));
61 61
 	}
62 62
 
63
-	if ( (int) $customer_info['user_id'] != (int) $customer->user_id ) {
63
+	if ((int) $customer_info['user_id'] != (int) $customer->user_id) {
64 64
 
65 65
 		// Make sure we don't already have this user attached to a customer
66
-		if ( ! empty( $customer_info['user_id'] ) && false !== Give()->customers->get_customer_by( 'user_id', $customer_info['user_id'] ) ) {
67
-			give_set_error( 'give-invalid-customer-user_id', sprintf( esc_html( 'The User ID %d is already associated with a different donor.', 'give' ), $customer_info['user_id'] ) );
66
+		if ( ! empty($customer_info['user_id']) && false !== Give()->customers->get_customer_by('user_id', $customer_info['user_id'])) {
67
+			give_set_error('give-invalid-customer-user_id', sprintf(esc_html('The User ID %d is already associated with a different donor.', 'give'), $customer_info['user_id']));
68 68
 		}
69 69
 
70 70
 		// Make sure it's actually a user
71
-		$user = get_user_by( 'id', $customer_info['user_id'] );
72
-		if ( ! empty( $customer_info['user_id'] ) && false === $user ) {
73
-			give_set_error( 'give-invalid-user_id', sprintf( esc_html( 'The User ID %d does not exist. Please assign an existing user.', 'give' ), $customer_info['user_id'] ) );
71
+		$user = get_user_by('id', $customer_info['user_id']);
72
+		if ( ! empty($customer_info['user_id']) && false === $user) {
73
+			give_set_error('give-invalid-user_id', sprintf(esc_html('The User ID %d does not exist. Please assign an existing user.', 'give'), $customer_info['user_id']));
74 74
 		}
75 75
 
76 76
 	}
@@ -78,82 +78,82 @@  discard block
 block discarded – undo
78 78
 	// Record this for later
79 79
 	$previous_user_id = $customer->user_id;
80 80
 
81
-	if ( give_get_errors() ) {
81
+	if (give_get_errors()) {
82 82
 		return;
83 83
 	}
84 84
 
85 85
 	// Setup the customer address, if present
86 86
 	$address = array();
87
-	if ( intval( $customer_info['user_id'] ) > 0 ) {
87
+	if (intval($customer_info['user_id']) > 0) {
88 88
 
89
-		$current_address = get_user_meta( $customer_info['user_id'], '_give_user_address', true );
89
+		$current_address = get_user_meta($customer_info['user_id'], '_give_user_address', true);
90 90
 
91
-		if ( false === $current_address ) {
92
-			$address['line1']   = isset( $customer_info['line1'] ) ? $customer_info['line1'] : '';
93
-			$address['line2']   = isset( $customer_info['line2'] ) ? $customer_info['line2'] : '';
94
-			$address['city']    = isset( $customer_info['city'] ) ? $customer_info['city'] : '';
95
-			$address['country'] = isset( $customer_info['country'] ) ? $customer_info['country'] : '';
96
-			$address['zip']     = isset( $customer_info['zip'] ) ? $customer_info['zip'] : '';
97
-			$address['state']   = isset( $customer_info['state'] ) ? $customer_info['state'] : '';
91
+		if (false === $current_address) {
92
+			$address['line1']   = isset($customer_info['line1']) ? $customer_info['line1'] : '';
93
+			$address['line2']   = isset($customer_info['line2']) ? $customer_info['line2'] : '';
94
+			$address['city']    = isset($customer_info['city']) ? $customer_info['city'] : '';
95
+			$address['country'] = isset($customer_info['country']) ? $customer_info['country'] : '';
96
+			$address['zip']     = isset($customer_info['zip']) ? $customer_info['zip'] : '';
97
+			$address['state']   = isset($customer_info['state']) ? $customer_info['state'] : '';
98 98
 		} else {
99
-			$current_address    = wp_parse_args( $current_address, array(
99
+			$current_address    = wp_parse_args($current_address, array(
100 100
 				'line1',
101 101
 				'line2',
102 102
 				'city',
103 103
 				'zip',
104 104
 				'state',
105 105
 				'country'
106
-			) );
107
-			$address['line1']   = isset( $customer_info['line1'] ) ? $customer_info['line1'] : $current_address['line1'];
108
-			$address['line2']   = isset( $customer_info['line2'] ) ? $customer_info['line2'] : $current_address['line2'];
109
-			$address['city']    = isset( $customer_info['city'] ) ? $customer_info['city'] : $current_address['city'];
110
-			$address['country'] = isset( $customer_info['country'] ) ? $customer_info['country'] : $current_address['country'];
111
-			$address['zip']     = isset( $customer_info['zip'] ) ? $customer_info['zip'] : $current_address['zip'];
112
-			$address['state']   = isset( $customer_info['state'] ) ? $customer_info['state'] : $current_address['state'];
106
+			));
107
+			$address['line1']   = isset($customer_info['line1']) ? $customer_info['line1'] : $current_address['line1'];
108
+			$address['line2']   = isset($customer_info['line2']) ? $customer_info['line2'] : $current_address['line2'];
109
+			$address['city']    = isset($customer_info['city']) ? $customer_info['city'] : $current_address['city'];
110
+			$address['country'] = isset($customer_info['country']) ? $customer_info['country'] : $current_address['country'];
111
+			$address['zip']     = isset($customer_info['zip']) ? $customer_info['zip'] : $current_address['zip'];
112
+			$address['state']   = isset($customer_info['state']) ? $customer_info['state'] : $current_address['state'];
113 113
 		}
114 114
 
115 115
 	}
116 116
 
117 117
 	// Sanitize the inputs
118 118
 	$customer_data            = array();
119
-	$customer_data['name']    = strip_tags( stripslashes( $customer_info['name'] ) );
119
+	$customer_data['name']    = strip_tags(stripslashes($customer_info['name']));
120 120
 	$customer_data['email']   = $customer_info['email'];
121 121
 	$customer_data['user_id'] = $customer_info['user_id'];
122 122
 
123
-	$customer_data = apply_filters( 'give_edit_customer_info', $customer_data, $customer_id );
124
-	$address       = apply_filters( 'give_edit_customer_address', $address, $customer_id );
123
+	$customer_data = apply_filters('give_edit_customer_info', $customer_data, $customer_id);
124
+	$address       = apply_filters('give_edit_customer_address', $address, $customer_id);
125 125
 
126
-	$customer_data = array_map( 'sanitize_text_field', $customer_data );
127
-	$address       = array_map( 'sanitize_text_field', $address );
126
+	$customer_data = array_map('sanitize_text_field', $customer_data);
127
+	$address       = array_map('sanitize_text_field', $address);
128 128
 
129
-	do_action( 'give_pre_edit_customer', $customer_id, $customer_data, $address );
129
+	do_action('give_pre_edit_customer', $customer_id, $customer_data, $address);
130 130
 
131 131
 	$output         = array();
132 132
 	$previous_email = $customer->email;
133 133
 
134
-	if ( $customer->update( $customer_data ) ) {
134
+	if ($customer->update($customer_data)) {
135 135
 
136
-		if ( ! empty( $customer->user_id ) && $customer->user_id > 0 ) {
137
-			update_user_meta( $customer->user_id, '_give_user_address', $address );
136
+		if ( ! empty($customer->user_id) && $customer->user_id > 0) {
137
+			update_user_meta($customer->user_id, '_give_user_address', $address);
138 138
 		}
139 139
 
140 140
 		// Update some payment meta if we need to
141
-		$payments_array = explode( ',', $customer->payment_ids );
141
+		$payments_array = explode(',', $customer->payment_ids);
142 142
 
143
-		if ( $customer->email != $previous_email ) {
144
-			foreach ( $payments_array as $payment_id ) {
145
-				give_update_payment_meta( $payment_id, 'email', $customer->email );
143
+		if ($customer->email != $previous_email) {
144
+			foreach ($payments_array as $payment_id) {
145
+				give_update_payment_meta($payment_id, 'email', $customer->email);
146 146
 			}
147 147
 		}
148 148
 
149
-		if ( $customer->user_id != $previous_user_id ) {
150
-			foreach ( $payments_array as $payment_id ) {
151
-				give_update_payment_meta( $payment_id, '_give_payment_user_id', $customer->user_id );
149
+		if ($customer->user_id != $previous_user_id) {
150
+			foreach ($payments_array as $payment_id) {
151
+				give_update_payment_meta($payment_id, '_give_payment_user_id', $customer->user_id);
152 152
 			}
153 153
 		}
154 154
 
155 155
 		$output['success']       = true;
156
-		$customer_data           = array_merge( $customer_data, $address );
156
+		$customer_data           = array_merge($customer_data, $address);
157 157
 		$output['customer_info'] = $customer_data;
158 158
 
159 159
 	} else {
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
 
163 163
 	}
164 164
 
165
-	do_action( 'give_post_edit_customer', $customer_id, $customer_data );
165
+	do_action('give_post_edit_customer', $customer_id, $customer_data);
166 166
 
167
-	if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
168
-		header( 'Content-Type: application/json' );
169
-		echo json_encode( $output );
167
+	if (defined('DOING_AJAX') && DOING_AJAX) {
168
+		header('Content-Type: application/json');
169
+		echo json_encode($output);
170 170
 		wp_die();
171 171
 	}
172 172
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 
175 175
 }
176 176
 
177
-add_action( 'give_edit-customer', 'give_edit_customer', 10, 1 );
177
+add_action('give_edit-customer', 'give_edit_customer', 10, 1);
178 178
 
179 179
 /**
180 180
  * Save a customer note being added
@@ -185,53 +185,53 @@  discard block
 block discarded – undo
185 185
  *
186 186
  * @return int         The Note ID that was saved, or 0 if nothing was saved
187 187
  */
188
-function give_customer_save_note( $args ) {
188
+function give_customer_save_note($args) {
189 189
 
190
-	$customer_view_role = apply_filters( 'give_view_customers_role', 'view_give_reports' );
190
+	$customer_view_role = apply_filters('give_view_customers_role', 'view_give_reports');
191 191
 
192
-	if ( ! is_admin() || ! current_user_can( $customer_view_role ) ) {
193
-		wp_die( esc_html( 'You do not have permission to edit this donor.', 'give' ) );
192
+	if ( ! is_admin() || ! current_user_can($customer_view_role)) {
193
+		wp_die(esc_html('You do not have permission to edit this donor.', 'give'));
194 194
 	}
195 195
 
196
-	if ( empty( $args ) ) {
196
+	if (empty($args)) {
197 197
 		return;
198 198
 	}
199 199
 
200
-	$customer_note = trim( sanitize_text_field( $args['customer_note'] ) );
200
+	$customer_note = trim(sanitize_text_field($args['customer_note']));
201 201
 	$customer_id   = (int) $args['customer_id'];
202 202
 	$nonce         = $args['add_customer_note_nonce'];
203 203
 
204
-	if ( ! wp_verify_nonce( $nonce, 'add-customer-note' ) ) {
205
-		wp_die( esc_html( 'Cheatin\' eh?!', 'give' ) );
204
+	if ( ! wp_verify_nonce($nonce, 'add-customer-note')) {
205
+		wp_die(esc_html('Cheatin\' eh?!', 'give'));
206 206
 	}
207 207
 
208
-	if ( empty( $customer_note ) ) {
209
-		give_set_error( 'empty-customer-note', esc_html( 'A note is required.', 'give' ) );
208
+	if (empty($customer_note)) {
209
+		give_set_error('empty-customer-note', esc_html('A note is required.', 'give'));
210 210
 	}
211 211
 
212
-	if ( give_get_errors() ) {
212
+	if (give_get_errors()) {
213 213
 		return;
214 214
 	}
215 215
 
216
-	$customer = new Give_Customer( $customer_id );
217
-	$new_note = $customer->add_note( $customer_note );
216
+	$customer = new Give_Customer($customer_id);
217
+	$new_note = $customer->add_note($customer_note);
218 218
 
219
-	do_action( 'give_pre_insert_customer_note', $customer_id, $new_note );
219
+	do_action('give_pre_insert_customer_note', $customer_id, $new_note);
220 220
 
221
-	if ( ! empty( $new_note ) && ! empty( $customer->id ) ) {
221
+	if ( ! empty($new_note) && ! empty($customer->id)) {
222 222
 
223 223
 		ob_start();
224 224
 		?>
225 225
 		<div class="customer-note-wrapper dashboard-comment-wrap comment-item">
226 226
 			<span class="note-content-wrap">
227
-				<?php echo stripslashes( $new_note ); ?>
227
+				<?php echo stripslashes($new_note); ?>
228 228
 			</span>
229 229
 		</div>
230 230
 		<?php
231 231
 		$output = ob_get_contents();
232 232
 		ob_end_clean();
233 233
 
234
-		if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
234
+		if (defined('DOING_AJAX') && DOING_AJAX) {
235 235
 			echo $output;
236 236
 			exit;
237 237
 		}
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 
245 245
 }
246 246
 
247
-add_action( 'give_add-customer-note', 'give_customer_save_note', 10, 1 );
247
+add_action('give_add-customer-note', 'give_customer_save_note', 10, 1);
248 248
 
249 249
 /**
250 250
  * Delete a customer
@@ -255,87 +255,87 @@  discard block
 block discarded – undo
255 255
  *
256 256
  * @return int Whether it was a successful deletion
257 257
  */
258
-function give_customer_delete( $args ) {
258
+function give_customer_delete($args) {
259 259
 
260
-	$customer_edit_role = apply_filters( 'give_edit_customers_role', 'edit_give_payments' );
260
+	$customer_edit_role = apply_filters('give_edit_customers_role', 'edit_give_payments');
261 261
 
262
-	if ( ! is_admin() || ! current_user_can( $customer_edit_role ) ) {
263
-		wp_die( esc_html( 'You do not have permission to delete donors.', 'give' ) );
262
+	if ( ! is_admin() || ! current_user_can($customer_edit_role)) {
263
+		wp_die(esc_html('You do not have permission to delete donors.', 'give'));
264 264
 	}
265 265
 
266
-	if ( empty( $args ) ) {
266
+	if (empty($args)) {
267 267
 		return;
268 268
 	}
269 269
 
270 270
 	$customer_id = (int) $args['customer_id'];
271
-	$confirm     = ! empty( $args['give-customer-delete-confirm'] ) ? true : false;
272
-	$remove_data = ! empty( $args['give-customer-delete-records'] ) ? true : false;
271
+	$confirm     = ! empty($args['give-customer-delete-confirm']) ? true : false;
272
+	$remove_data = ! empty($args['give-customer-delete-records']) ? true : false;
273 273
 	$nonce       = $args['_wpnonce'];
274 274
 
275
-	if ( ! wp_verify_nonce( $nonce, 'delete-customer' ) ) {
276
-		wp_die( esc_html( 'Cheatin\' eh?!', 'give' ) );
275
+	if ( ! wp_verify_nonce($nonce, 'delete-customer')) {
276
+		wp_die(esc_html('Cheatin\' eh?!', 'give'));
277 277
 	}
278 278
 
279
-	if ( ! $confirm ) {
280
-		give_set_error( 'customer-delete-no-confirm', esc_html( 'Please confirm you want to delete this donor.', 'give' ) );
279
+	if ( ! $confirm) {
280
+		give_set_error('customer-delete-no-confirm', esc_html('Please confirm you want to delete this donor.', 'give'));
281 281
 	}
282 282
 
283
-	if ( give_get_errors() ) {
284
-		wp_redirect( admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=overview&id=' . $customer_id ) );
283
+	if (give_get_errors()) {
284
+		wp_redirect(admin_url('edit.php?post_type=give_forms&page=give-donors&view=overview&id='.$customer_id));
285 285
 		exit;
286 286
 	}
287 287
 
288
-	$customer = new Give_Customer( $customer_id );
288
+	$customer = new Give_Customer($customer_id);
289 289
 
290
-	do_action( 'give_pre_delete_customer', $customer_id, $confirm, $remove_data );
290
+	do_action('give_pre_delete_customer', $customer_id, $confirm, $remove_data);
291 291
 
292 292
 	$success = false;
293 293
 
294
-	if ( $customer->id > 0 ) {
294
+	if ($customer->id > 0) {
295 295
 
296
-		$payments_array = explode( ',', $customer->payment_ids );
297
-		$success        = Give()->customers->delete( $customer->id );
296
+		$payments_array = explode(',', $customer->payment_ids);
297
+		$success        = Give()->customers->delete($customer->id);
298 298
 
299
-		if ( $success ) {
299
+		if ($success) {
300 300
 
301
-			if ( $remove_data ) {
301
+			if ($remove_data) {
302 302
 
303 303
 				// Remove all payments, logs, etc
304
-				foreach ( $payments_array as $payment_id ) {
305
-					give_delete_purchase( $payment_id );
304
+				foreach ($payments_array as $payment_id) {
305
+					give_delete_purchase($payment_id);
306 306
 				}
307 307
 
308 308
 			} else {
309 309
 
310 310
 				// Just set the payments to customer_id of 0
311
-				foreach ( $payments_array as $payment_id ) {
312
-					give_update_payment_meta( $payment_id, '_give_payment_customer_id', 0 );
311
+				foreach ($payments_array as $payment_id) {
312
+					give_update_payment_meta($payment_id, '_give_payment_customer_id', 0);
313 313
 				}
314 314
 
315 315
 			}
316 316
 
317
-			$redirect = admin_url( 'edit.php?post_type=give_forms&page=give-donors&give-message=customer-deleted' );
317
+			$redirect = admin_url('edit.php?post_type=give_forms&page=give-donors&give-message=customer-deleted');
318 318
 
319 319
 		} else {
320 320
 
321
-			give_set_error( 'give-donor-delete-failed', esc_html( 'Error deleting donor.', 'give' ) );
322
-			$redirect = admin_url( 'edit.php?post_type=give_forms&page=give-donors&view=delete&id=' . $customer_id );
321
+			give_set_error('give-donor-delete-failed', esc_html('Error deleting donor.', 'give'));
322
+			$redirect = admin_url('edit.php?post_type=give_forms&page=give-donors&view=delete&id='.$customer_id);
323 323
 
324 324
 		}
325 325
 
326 326
 	} else {
327 327
 
328
-		give_set_error( 'give-customer-delete-invalid-id', esc_html( 'Invalid Donor ID.', 'give' ) );
329
-		$redirect = admin_url( 'edit.php?post_type=give_forms&page=give-donors' );
328
+		give_set_error('give-customer-delete-invalid-id', esc_html('Invalid Donor ID.', 'give'));
329
+		$redirect = admin_url('edit.php?post_type=give_forms&page=give-donors');
330 330
 
331 331
 	}
332 332
 
333
-	wp_redirect( $redirect );
333
+	wp_redirect($redirect);
334 334
 	exit;
335 335
 
336 336
 }
337 337
 
338
-add_action( 'give_delete-customer', 'give_customer_delete', 10, 1 );
338
+add_action('give_delete-customer', 'give_customer_delete', 10, 1);
339 339
 
340 340
 /**
341 341
  * Disconnect a user ID from a donor
@@ -346,39 +346,39 @@  discard block
 block discarded – undo
346 346
  *
347 347
  * @return bool        If the disconnect was successful
348 348
  */
349
-function give_disconnect_customer_user_id( $args ) {
349
+function give_disconnect_customer_user_id($args) {
350 350
 
351
-	$customer_edit_role = apply_filters( 'give_edit_customers_role', 'edit_give_payments' );
351
+	$customer_edit_role = apply_filters('give_edit_customers_role', 'edit_give_payments');
352 352
 
353
-	if ( ! is_admin() || ! current_user_can( $customer_edit_role ) ) {
354
-		wp_die( esc_html( 'You do not have permission to edit this donor.', 'give' ) );
353
+	if ( ! is_admin() || ! current_user_can($customer_edit_role)) {
354
+		wp_die(esc_html('You do not have permission to edit this donor.', 'give'));
355 355
 	}
356 356
 
357
-	if ( empty( $args ) ) {
357
+	if (empty($args)) {
358 358
 		return;
359 359
 	}
360 360
 
361 361
 	$customer_id = (int) $args['customer_id'];
362 362
 	$nonce       = $args['_wpnonce'];
363 363
 
364
-	if ( ! wp_verify_nonce( $nonce, 'edit-customer' ) ) {
365
-		wp_die( esc_html( 'Cheatin\' eh?!', 'give' ) );
364
+	if ( ! wp_verify_nonce($nonce, 'edit-customer')) {
365
+		wp_die(esc_html('Cheatin\' eh?!', 'give'));
366 366
 	}
367 367
 
368
-	$customer = new Give_Customer( $customer_id );
369
-	if ( empty( $customer->id ) ) {
368
+	$customer = new Give_Customer($customer_id);
369
+	if (empty($customer->id)) {
370 370
 		return false;
371 371
 	}
372 372
 
373
-	do_action( 'give_pre_customer_disconnect_user_id', $customer_id, $customer->user_id );
373
+	do_action('give_pre_customer_disconnect_user_id', $customer_id, $customer->user_id);
374 374
 
375
-	$customer_args = array( 'user_id' => 0 );
375
+	$customer_args = array('user_id' => 0);
376 376
 
377
-	if ( $customer->update( $customer_args ) ) {
377
+	if ($customer->update($customer_args)) {
378 378
 		global $wpdb;
379 379
 
380
-		if ( ! empty( $customer->payment_ids ) ) {
381
-			$wpdb->query( "UPDATE $wpdb->postmeta SET meta_value = 0 WHERE meta_key = '_give_payment_user_id' AND post_id IN ( $customer->payment_ids )" );
380
+		if ( ! empty($customer->payment_ids)) {
381
+			$wpdb->query("UPDATE $wpdb->postmeta SET meta_value = 0 WHERE meta_key = '_give_payment_user_id' AND post_id IN ( $customer->payment_ids )");
382 382
 		}
383 383
 
384 384
 		$output['success'] = true;
@@ -386,14 +386,14 @@  discard block
 block discarded – undo
386 386
 	} else {
387 387
 
388 388
 		$output['success'] = false;
389
-		give_set_error( 'give-disconnect-user-fail', esc_html( 'Failed to disconnect user from donor.', 'give' ) );
389
+		give_set_error('give-disconnect-user-fail', esc_html('Failed to disconnect user from donor.', 'give'));
390 390
 	}
391 391
 
392
-	do_action( 'give_post_customer_disconnect_user_id', $customer_id );
392
+	do_action('give_post_customer_disconnect_user_id', $customer_id);
393 393
 
394
-	if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
395
-		header( 'Content-Type: application/json' );
396
-		echo json_encode( $output );
394
+	if (defined('DOING_AJAX') && DOING_AJAX) {
395
+		header('Content-Type: application/json');
396
+		echo json_encode($output);
397 397
 		wp_die();
398 398
 	}
399 399
 
@@ -401,4 +401,4 @@  discard block
 block discarded – undo
401 401
 
402 402
 }
403 403
 
404
-add_action( 'give_disconnect-userid', 'give_disconnect_customer_user_id', 10, 1 );
404
+add_action('give_disconnect-userid', 'give_disconnect_customer_user_id', 10, 1);
Please login to merge, or discard this patch.
includes/admin/forms/dashboard-columns.php 1 patch
Spacing   +83 added lines, -83 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
 
@@ -27,34 +27,34 @@  discard block
 block discarded – undo
27 27
  * @return array $form_columns Updated array of forms columns
28 28
  *  Post Type List Table
29 29
  */
30
-function give_form_columns( $give_form_columns ) {
30
+function give_form_columns($give_form_columns) {
31 31
 
32 32
 	//Standard columns
33 33
 	$give_form_columns = array(
34 34
 		'cb'            => '<input type="checkbox"/>',
35
-		'title'         => esc_html( 'Name', 'give' ),
36
-		'form_category' => esc_html( 'Categories', 'give' ),
37
-		'form_tag'      => esc_html( 'Tags', 'give' ),
38
-		'price'         => esc_html( 'Price', 'give' ),
39
-		'goal'          => esc_html( 'Goal', 'give' ),
40
-		'donations'     => esc_html( 'Donations', 'give' ),
41
-		'earnings'      => esc_html( 'Income', 'give' ),
42
-		'shortcode'     => esc_html( 'Shortcode', 'give' ),
43
-		'date'          => esc_html( 'Date', 'give' )
35
+		'title'         => esc_html('Name', 'give'),
36
+		'form_category' => esc_html('Categories', 'give'),
37
+		'form_tag'      => esc_html('Tags', 'give'),
38
+		'price'         => esc_html('Price', 'give'),
39
+		'goal'          => esc_html('Goal', 'give'),
40
+		'donations'     => esc_html('Donations', 'give'),
41
+		'earnings'      => esc_html('Income', 'give'),
42
+		'shortcode'     => esc_html('Shortcode', 'give'),
43
+		'date'          => esc_html('Date', 'give')
44 44
 	);
45 45
 
46 46
 	//Does the user want categories / tags?
47
-	if ( give_get_option( 'enable_categories' ) !== 'on' ) {
48
-		unset( $give_form_columns['form_category'] );
47
+	if (give_get_option('enable_categories') !== 'on') {
48
+		unset($give_form_columns['form_category']);
49 49
 	}
50
-	if ( give_get_option( 'enable_tags' ) !== 'on' ) {
51
-		unset( $give_form_columns['form_tag'] );
50
+	if (give_get_option('enable_tags') !== 'on') {
51
+		unset($give_form_columns['form_tag']);
52 52
 	}
53 53
 
54
-	return apply_filters( 'give_forms_columns', $give_form_columns );
54
+	return apply_filters('give_forms_columns', $give_form_columns);
55 55
 }
56 56
 
57
-add_filter( 'manage_edit-give_forms_columns', 'give_form_columns' );
57
+add_filter('manage_edit-give_forms_columns', 'give_form_columns');
58 58
 
59 59
 /**
60 60
  * Render Give Form Columns
@@ -66,67 +66,67 @@  discard block
 block discarded – undo
66 66
  *
67 67
  * @return void
68 68
  */
69
-function give_render_form_columns( $column_name, $post_id ) {
70
-	if ( get_post_type( $post_id ) == 'give_forms' ) {
69
+function give_render_form_columns($column_name, $post_id) {
70
+	if (get_post_type($post_id) == 'give_forms') {
71 71
 		global $give_options;
72 72
 
73
-		$style = isset( $give_options['button_style'] ) ? $give_options['button_style'] : 'button';
74
-		$color = isset( $give_options['checkout_color'] ) ? $give_options['checkout_color'] : 'blue';
75
-		$color = ( $color == 'inherit' ) ? '' : $color;
73
+		$style = isset($give_options['button_style']) ? $give_options['button_style'] : 'button';
74
+		$color = isset($give_options['checkout_color']) ? $give_options['checkout_color'] : 'blue';
75
+		$color = ($color == 'inherit') ? '' : $color;
76 76
 
77
-		$purchase_text = ! empty( $give_options['add_to_cart_text'] ) ? $give_options['add_to_cart_text'] : esc_html( 'Purchase', 'give' );
77
+		$purchase_text = ! empty($give_options['add_to_cart_text']) ? $give_options['add_to_cart_text'] : esc_html('Purchase', 'give');
78 78
 
79
-		switch ( $column_name ) {
79
+		switch ($column_name) {
80 80
 			case 'form_category':
81
-				echo get_the_term_list( $post_id, 'give_forms_category', '', ', ', '' );
81
+				echo get_the_term_list($post_id, 'give_forms_category', '', ', ', '');
82 82
 				break;
83 83
 			case 'form_tag':
84
-				echo get_the_term_list( $post_id, 'give_forms_tag', '', ', ', '' );
84
+				echo get_the_term_list($post_id, 'give_forms_tag', '', ', ', '');
85 85
 				break;
86 86
 			case 'price':
87
-				if ( give_has_variable_prices( $post_id ) ) {
88
-					echo give_price_range( $post_id );
87
+				if (give_has_variable_prices($post_id)) {
88
+					echo give_price_range($post_id);
89 89
 				} else {
90
-					echo give_price( $post_id, false );
91
-					echo '<input type="hidden" class="formprice-' . $post_id . '" value="' . give_get_form_price( $post_id ) . '" />';
90
+					echo give_price($post_id, false);
91
+					echo '<input type="hidden" class="formprice-'.$post_id.'" value="'.give_get_form_price($post_id).'" />';
92 92
 				}
93 93
 				break;
94 94
 			case 'goal':
95
-				$goal_option = get_post_meta( $post_id, '_give_goal_option', true );
96
-				if ( ! empty( $goal_option ) && $goal_option === 'yes' ) {
97
-					echo give_goal( $post_id, false );
95
+				$goal_option = get_post_meta($post_id, '_give_goal_option', true);
96
+				if ( ! empty($goal_option) && $goal_option === 'yes') {
97
+					echo give_goal($post_id, false);
98 98
 				} else {
99
-					esc_html_e( 'No Goal Set', 'give' );
99
+					esc_html_e('No Goal Set', 'give');
100 100
 				}
101 101
 
102
-				echo '<input type="hidden" class="formgoal-' . $post_id . '" value="' . give_get_form_goal( $post_id ) . '" />';
102
+				echo '<input type="hidden" class="formgoal-'.$post_id.'" value="'.give_get_form_goal($post_id).'" />';
103 103
 				break;
104 104
 			case 'donations':
105
-				if ( current_user_can( 'view_give_forms_stats', $post_id ) ) {
106
-					echo '<a href="' . esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-reports&tab=logs&view=sales&form=' . $post_id ) ) . '">';
107
-					echo give_get_form_sales_stats( $post_id );
105
+				if (current_user_can('view_give_forms_stats', $post_id)) {
106
+					echo '<a href="'.esc_url(admin_url('edit.php?post_type=give_forms&page=give-reports&tab=logs&view=sales&form='.$post_id)).'">';
107
+					echo give_get_form_sales_stats($post_id);
108 108
 					echo '</a>';
109 109
 				} else {
110 110
 					echo '-';
111 111
 				}
112 112
 				break;
113 113
 			case 'earnings':
114
-				if ( current_user_can( 'view_give_forms_stats', $post_id ) ) {
115
-					echo '<a href="' . esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-reports&view=forms&form-id=' . $post_id ) ) . '">';
116
-					echo give_currency_filter( give_format_amount( give_get_form_earnings_stats( $post_id ) ) );
114
+				if (current_user_can('view_give_forms_stats', $post_id)) {
115
+					echo '<a href="'.esc_url(admin_url('edit.php?post_type=give_forms&page=give-reports&view=forms&form-id='.$post_id)).'">';
116
+					echo give_currency_filter(give_format_amount(give_get_form_earnings_stats($post_id)));
117 117
 					echo '</a>';
118 118
 				} else {
119 119
 					echo '-';
120 120
 				}
121 121
 				break;
122 122
 			case 'shortcode':
123
-				echo '<input onclick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly="" value="[give_form id=&#34;' . absint( $post_id ) . '&#34;]">';
123
+				echo '<input onclick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly="" value="[give_form id=&#34;'.absint($post_id).'&#34;]">';
124 124
 				break;
125 125
 		}
126 126
 	}
127 127
 }
128 128
 
129
-add_action( 'manage_posts_custom_column', 'give_render_form_columns', 10, 2 );
129
+add_action('manage_posts_custom_column', 'give_render_form_columns', 10, 2);
130 130
 
131 131
 /**
132 132
  * Registers the sortable columns in the list table
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
  *
138 138
  * @return array $columns Array of sortable columns
139 139
  */
140
-function give_sortable_form_columns( $columns ) {
140
+function give_sortable_form_columns($columns) {
141 141
 	$columns['price']    = 'price';
142 142
 	$columns['sales']    = 'sales';
143 143
 	$columns['earnings'] = 'earnings';
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	return $columns;
147 147
 }
148 148
 
149
-add_filter( 'manage_edit-give_forms_sortable_columns', 'give_sortable_form_columns' );
149
+add_filter('manage_edit-give_forms_sortable_columns', 'give_sortable_form_columns');
150 150
 
151 151
 /**
152 152
  * Sorts Columns in the Forms List Table
@@ -157,11 +157,11 @@  discard block
 block discarded – undo
157 157
  *
158 158
  * @return array $vars Array of all the sort variables
159 159
  */
160
-function give_sort_forms( $vars ) {
160
+function give_sort_forms($vars) {
161 161
 	// Check if we're viewing the "give_forms" post type
162
-	if ( isset( $vars['post_type'] ) && 'give_forms' == $vars['post_type'] ) {
162
+	if (isset($vars['post_type']) && 'give_forms' == $vars['post_type']) {
163 163
 		// Check if 'orderby' is set to "sales"
164
-		if ( isset( $vars['orderby'] ) && 'sales' == $vars['orderby'] ) {
164
+		if (isset($vars['orderby']) && 'sales' == $vars['orderby']) {
165 165
 			$vars = array_merge(
166 166
 				$vars,
167 167
 				array(
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 		}
173 173
 
174 174
 		// Check if "orderby" is set to "earnings"
175
-		if ( isset( $vars['orderby'] ) && 'earnings' == $vars['orderby'] ) {
175
+		if (isset($vars['orderby']) && 'earnings' == $vars['orderby']) {
176 176
 			$vars = array_merge(
177 177
 				$vars,
178 178
 				array(
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 		}
184 184
 
185 185
 		// Check if "orderby" is set to "price"
186
-		if ( isset( $vars['orderby'] ) && 'price' == $vars['orderby'] ) {
186
+		if (isset($vars['orderby']) && 'price' == $vars['orderby']) {
187 187
 			$vars = array_merge(
188 188
 				$vars,
189 189
 				array(
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 		}
195 195
 
196 196
 		// Check if "orderby" is set to "goal"
197
-		if ( isset( $vars['orderby'] ) && 'goal' == $vars['orderby'] ) {
197
+		if (isset($vars['orderby']) && 'goal' == $vars['orderby']) {
198 198
 			$vars = array_merge(
199 199
 				$vars,
200 200
 				array(
@@ -217,16 +217,16 @@  discard block
 block discarded – undo
217 217
  *
218 218
  * @return array       Array of all sort variables
219 219
  */
220
-function give_filter_forms( $vars ) {
221
-	if ( isset( $vars['post_type'] ) && 'give_forms' == $vars['post_type'] ) {
220
+function give_filter_forms($vars) {
221
+	if (isset($vars['post_type']) && 'give_forms' == $vars['post_type']) {
222 222
 
223 223
 		// If an author ID was passed, use it
224
-		if ( isset( $_REQUEST['author'] ) && ! current_user_can( 'view_give_reports' ) ) {
224
+		if (isset($_REQUEST['author']) && ! current_user_can('view_give_reports')) {
225 225
 
226 226
 			$author_id = $_REQUEST['author'];
227
-			if ( (int) $author_id !== get_current_user_id() ) {
227
+			if ((int) $author_id !== get_current_user_id()) {
228 228
 				// Tried to view the products of another person, sorry
229
-				wp_die( esc_html( 'You do not have permission to view this data.', 'give' ), esc_html( 'Error', 'give' ), array( 'response' => 403 ) );
229
+				wp_die(esc_html('You do not have permission to view this data.', 'give'), esc_html('Error', 'give'), array('response' => 403));
230 230
 			}
231 231
 			$vars = array_merge(
232 232
 				$vars,
@@ -251,11 +251,11 @@  discard block
 block discarded – undo
251 251
  * @return void
252 252
  */
253 253
 function give_forms_load() {
254
-	add_filter( 'request', 'give_sort_forms' );
255
-	add_filter( 'request', 'give_filter_forms' );
254
+	add_filter('request', 'give_sort_forms');
255
+	add_filter('request', 'give_filter_forms');
256 256
 }
257 257
 
258
-add_action( 'load-edit.php', 'give_forms_load', 9999 );
258
+add_action('load-edit.php', 'give_forms_load', 9999);
259 259
 
260 260
 /**
261 261
  * Remove Forms Month Filter
@@ -269,17 +269,17 @@  discard block
 block discarded – undo
269 269
  * @global      $typenow The post type we are viewing
270 270
  * @return array Empty array disables the dropdown
271 271
  */
272
-function give_remove_month_filter( $dates ) {
272
+function give_remove_month_filter($dates) {
273 273
 	global $typenow;
274 274
 
275
-	if ( $typenow == 'give_forms' ) {
275
+	if ($typenow == 'give_forms') {
276 276
 		$dates = array();
277 277
 	}
278 278
 
279 279
 	return $dates;
280 280
 }
281 281
 
282
-add_filter( 'months_dropdown_results', 'give_remove_month_filter', 99 );
282
+add_filter('months_dropdown_results', 'give_remove_month_filter', 99);
283 283
 
284 284
 /**
285 285
  * Adds price field to Quick Edit options
@@ -291,8 +291,8 @@  discard block
 block discarded – undo
291 291
  *
292 292
  * @return void
293 293
  */
294
-function give_price_field_quick_edit( $column_name, $post_type ) {
295
-	if ( $column_name != 'price' || $post_type != 'give_forms' ) {
294
+function give_price_field_quick_edit($column_name, $post_type) {
295
+	if ($column_name != 'price' || $post_type != 'give_forms') {
296 296
 		return;
297 297
 	}
298 298
 	?>
@@ -301,12 +301,12 @@  discard block
 block discarded – undo
301 301
 			<h4><?php 
302 302
 				printf(
303 303
 					/* translators: %s: forms singular label */
304
-					esc_html( '%s Configuration', 'give' ),
304
+					esc_html('%s Configuration', 'give'),
305 305
 					give_get_forms_label_singular()
306 306
 				);
307 307
 			?></h4>
308 308
 			<label>
309
-				<span class="title"><?php esc_html_e( 'Price', 'give' ); ?></span>
309
+				<span class="title"><?php esc_html_e('Price', 'give'); ?></span>
310 310
 				<span class="input-text-wrap">
311 311
 					<input type="text" name="_give_regprice" class="text regprice" />
312 312
 				</span>
@@ -317,8 +317,8 @@  discard block
 block discarded – undo
317 317
 	<?php
318 318
 }
319 319
 
320
-add_action( 'quick_edit_custom_box', 'give_price_field_quick_edit', 10, 2 );
321
-add_action( 'bulk_edit_custom_box', 'give_price_field_quick_edit', 10, 2 );
320
+add_action('quick_edit_custom_box', 'give_price_field_quick_edit', 10, 2);
321
+add_action('bulk_edit_custom_box', 'give_price_field_quick_edit', 10, 2);
322 322
 
323 323
 /**
324 324
  * Updates price when saving post
@@ -329,23 +329,23 @@  discard block
 block discarded – undo
329 329
  *
330 330
  * @return void
331 331
  */
332
-function give_price_save_quick_edit( $post_id ) {
333
-	if ( ! isset( $_POST['post_type'] ) || 'give_forms' !== $_POST['post_type'] ) {
332
+function give_price_save_quick_edit($post_id) {
333
+	if ( ! isset($_POST['post_type']) || 'give_forms' !== $_POST['post_type']) {
334 334
 		return;
335 335
 	}
336
-	if ( ! current_user_can( 'edit_post', $post_id ) ) {
336
+	if ( ! current_user_can('edit_post', $post_id)) {
337 337
 		return $post_id;
338 338
 	}
339
-	if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
339
+	if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
340 340
 		return $post_id;
341 341
 	}
342 342
 
343
-	if ( isset( $_REQUEST['_give_regprice'] ) ) {
344
-		update_post_meta( $post_id, '_give_set_price', strip_tags( stripslashes( $_REQUEST['_give_regprice'] ) ) );
343
+	if (isset($_REQUEST['_give_regprice'])) {
344
+		update_post_meta($post_id, '_give_set_price', strip_tags(stripslashes($_REQUEST['_give_regprice'])));
345 345
 	}
346 346
 }
347 347
 
348
-add_action( 'save_post', 'give_price_save_quick_edit' );
348
+add_action('save_post', 'give_price_save_quick_edit');
349 349
 
350 350
 /**
351 351
  * Process bulk edit actions via AJAX
@@ -355,18 +355,18 @@  discard block
 block discarded – undo
355 355
  */
356 356
 function give_save_bulk_edit() {
357 357
 
358
-	$post_ids = ( isset( $_POST['post_ids'] ) && ! empty( $_POST['post_ids'] ) ) ? $_POST['post_ids'] : array();
358
+	$post_ids = (isset($_POST['post_ids']) && ! empty($_POST['post_ids'])) ? $_POST['post_ids'] : array();
359 359
 
360
-	if ( ! empty( $post_ids ) && is_array( $post_ids ) ) {
361
-		$price = isset( $_POST['price'] ) ? strip_tags( stripslashes( $_POST['price'] ) ) : 0;
362
-		foreach ( $post_ids as $post_id ) {
360
+	if ( ! empty($post_ids) && is_array($post_ids)) {
361
+		$price = isset($_POST['price']) ? strip_tags(stripslashes($_POST['price'])) : 0;
362
+		foreach ($post_ids as $post_id) {
363 363
 
364
-			if ( ! current_user_can( 'edit_post', $post_id ) ) {
364
+			if ( ! current_user_can('edit_post', $post_id)) {
365 365
 				continue;
366 366
 			}
367 367
 
368
-			if ( ! empty( $price ) ) {
369
-				update_post_meta( $post_id, '_give_set_price', give_sanitize_amount( $price ) );
368
+			if ( ! empty($price)) {
369
+				update_post_meta($post_id, '_give_set_price', give_sanitize_amount($price));
370 370
 			}
371 371
 		}
372 372
 	}
@@ -374,4 +374,4 @@  discard block
 block discarded – undo
374 374
 	die();
375 375
 }
376 376
 
377
-add_action( 'wp_ajax_give_save_bulk_edit', 'give_save_bulk_edit' );
377
+add_action('wp_ajax_give_save_bulk_edit', 'give_save_bulk_edit');
Please login to merge, or discard this patch.
includes/admin/forms/metabox.php 1 patch
Spacing   +190 added lines, -190 removed lines patch added patch discarded remove patch
@@ -10,11 +10,11 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
17
-add_filter( 'cmb2_meta_boxes', 'give_single_forms_cmb2_metaboxes' );
17
+add_filter('cmb2_meta_boxes', 'give_single_forms_cmb2_metaboxes');
18 18
 
19 19
 /**
20 20
  * Define the metabox and field configurations.
@@ -23,23 +23,23 @@  discard block
 block discarded – undo
23 23
  *
24 24
  * @return array
25 25
  */
26
-function give_single_forms_cmb2_metaboxes( array $meta_boxes ) {
26
+function give_single_forms_cmb2_metaboxes(array $meta_boxes) {
27 27
 
28 28
 	$post_id               = give_get_admin_post_id();
29
-	$price                 = give_get_form_price( $post_id );
30
-	$custom_amount_minimum = give_get_form_minimum_price( $post_id );
31
-	$goal                  = give_get_form_goal( $post_id );
32
-	$variable_pricing      = give_has_variable_prices( $post_id );
33
-	$prices                = give_get_variable_prices( $post_id );
29
+	$price                 = give_get_form_price($post_id);
30
+	$custom_amount_minimum = give_get_form_minimum_price($post_id);
31
+	$goal                  = give_get_form_goal($post_id);
32
+	$variable_pricing      = give_has_variable_prices($post_id);
33
+	$prices                = give_get_variable_prices($post_id);
34 34
 
35 35
 	//No empty prices - min. 1.00 for new forms
36
-	if ( empty( $price ) && is_null( $post_id ) ) {
37
-		$price = esc_attr( give_format_amount( '1.00' ) );
36
+	if (empty($price) && is_null($post_id)) {
37
+		$price = esc_attr(give_format_amount('1.00'));
38 38
 	}
39 39
 
40 40
 	//Min. $1.00 for new forms
41
-	if ( empty( $custom_amount_minimum ) ) {
42
-		$custom_amount_minimum = esc_attr( give_format_amount( '1.00' ) );
41
+	if (empty($custom_amount_minimum)) {
42
+		$custom_amount_minimum = esc_attr(give_format_amount('1.00'));
43 43
 	}
44 44
 
45 45
 	// Start with an underscore to hide fields from custom fields list
@@ -48,326 +48,326 @@  discard block
 block discarded – undo
48 48
 	/**
49 49
 	 * Repeatable Field Groups
50 50
 	 */
51
-	$meta_boxes['form_field_options'] = apply_filters( 'give_forms_field_options', array(
51
+	$meta_boxes['form_field_options'] = apply_filters('give_forms_field_options', array(
52 52
 		'id'           => 'form_field_options',
53
-		'title'        => esc_html( 'Donation Options', 'give' ),
54
-		'object_types' => array( 'give_forms' ),
53
+		'title'        => esc_html('Donation Options', 'give'),
54
+		'object_types' => array('give_forms'),
55 55
 		'context'      => 'normal',
56 56
 		'priority'     => 'high', //Show above Content WYSIWYG
57
-		'fields'       => apply_filters( 'give_forms_donation_form_metabox_fields', array(
57
+		'fields'       => apply_filters('give_forms_donation_form_metabox_fields', array(
58 58
 				//Donation Option
59 59
 				array(
60
-					'name'        => esc_html( 'Donation Option', 'give' ),
61
-					'description' => esc_html( 'Would you like this form to have one set donation price or multiple levels (for example, $10, $20, $50)?', 'give' ),
62
-					'id'          => $prefix . 'price_option',
60
+					'name'        => esc_html('Donation Option', 'give'),
61
+					'description' => esc_html('Would you like this form to have one set donation price or multiple levels (for example, $10, $20, $50)?', 'give'),
62
+					'id'          => $prefix.'price_option',
63 63
 					'type'        => 'radio_inline',
64 64
 					'default'     => 'set',
65
-					'options'     => apply_filters( 'give_forms_price_options', array(
66
-						'set'   => esc_html( 'Set Donation', 'give' ),
67
-						'multi' => esc_html( 'Multi-level Donation', 'give' ),
68
-					) ),
65
+					'options'     => apply_filters('give_forms_price_options', array(
66
+						'set'   => esc_html('Set Donation', 'give'),
67
+						'multi' => esc_html('Multi-level Donation', 'give'),
68
+					)),
69 69
 				),
70 70
 				array(
71
-					'name'         => esc_html( 'Set Donation', 'give' ),
72
-					'description'  => esc_html( 'This is the set donation amount for this form. If you have a "Custom Amount Minimum" set, make sure it is less than this amount.', 'give' ),
73
-					'id'           => $prefix . 'set_price',
71
+					'name'         => esc_html('Set Donation', 'give'),
72
+					'description'  => esc_html('This is the set donation amount for this form. If you have a "Custom Amount Minimum" set, make sure it is less than this amount.', 'give'),
73
+					'id'           => $prefix.'set_price',
74 74
 					'type'         => 'text_small',
75 75
 					'row_classes'  => 'give-subfield',
76
-					'before_field' => give_get_option( 'currency_position' ) == 'before' ? '<span class="give-money-symbol give-money-symbol-before">' . give_currency_symbol() . '</span>' : '',
77
-					'after_field'  => give_get_option( 'currency_position' ) == 'after' ? '<span class="give-money-symbol give-money-symbol-after">' . give_currency_symbol() . '</span>' : '',
76
+					'before_field' => give_get_option('currency_position') == 'before' ? '<span class="give-money-symbol give-money-symbol-before">'.give_currency_symbol().'</span>' : '',
77
+					'after_field'  => give_get_option('currency_position') == 'after' ? '<span class="give-money-symbol give-money-symbol-after">'.give_currency_symbol().'</span>' : '',
78 78
 					'attributes'   => array(
79
-						'placeholder' => give_format_amount( '1.00' ),
80
-						'value'       => give_format_amount( $price ),
79
+						'placeholder' => give_format_amount('1.00'),
80
+						'value'       => give_format_amount($price),
81 81
 						'class'       => 'cmb-type-text-small give-money-field',
82 82
 					),
83 83
 				),
84 84
 				//Donation levels: Header
85 85
 				array(
86
-					'id'   => $prefix . 'levels_header',
86
+					'id'   => $prefix.'levels_header',
87 87
 					'type' => 'levels_repeater_header',
88 88
 				),
89 89
 				//Donation Levels: Repeatable CMB2 Group
90 90
 				array(
91
-					'id'          => $prefix . 'donation_levels',
91
+					'id'          => $prefix.'donation_levels',
92 92
 					'type'        => 'group',
93 93
 					'row_classes' => 'give-subfield',
94 94
 					'options'     => array(
95
-						'add_button'    => esc_html( 'Add Level', 'give' ),
95
+						'add_button'    => esc_html('Add Level', 'give'),
96 96
 						'remove_button' => '<span class="dashicons dashicons-no"></span>',
97 97
 						'sortable'      => true, // beta
98 98
 					),
99 99
 					// Fields array works the same, except id's only need to be unique for this group. Prefix is not needed.
100
-					'fields'      => apply_filters( 'give_donation_levels_table_row', array(
100
+					'fields'      => apply_filters('give_donation_levels_table_row', array(
101 101
 						array(
102
-							'name' => esc_html( 'ID', 'give' ),
103
-							'id'   => $prefix . 'id',
102
+							'name' => esc_html('ID', 'give'),
103
+							'id'   => $prefix.'id',
104 104
 							'type' => 'levels_id',
105 105
 						),
106 106
 						array(
107
-							'name'         => esc_html( 'Amount', 'give' ),
108
-							'id'           => $prefix . 'amount',
107
+							'name'         => esc_html('Amount', 'give'),
108
+							'id'           => $prefix.'amount',
109 109
 							'type'         => 'text_small',
110
-							'before_field' => give_get_option( 'currency_position' ) == 'before' ? '<span class="give-money-symbol  give-money-symbol-before">' . give_currency_symbol() . '</span>' : '',
111
-							'after_field'  => give_get_option( 'currency_position' ) == 'after' ? '<span class="give-money-symbol  give-money-symbol-after">' . give_currency_symbol() . '</span>' : '',
110
+							'before_field' => give_get_option('currency_position') == 'before' ? '<span class="give-money-symbol  give-money-symbol-before">'.give_currency_symbol().'</span>' : '',
111
+							'after_field'  => give_get_option('currency_position') == 'after' ? '<span class="give-money-symbol  give-money-symbol-after">'.give_currency_symbol().'</span>' : '',
112 112
 							'attributes'   => array(
113
-								'placeholder' => give_format_amount( '1.00' ),
113
+								'placeholder' => give_format_amount('1.00'),
114 114
 								'class'       => 'cmb-type-text-small give-money-field',
115 115
 							),
116 116
 							'before'       => 'give_format_admin_multilevel_amount',
117 117
 						),
118 118
 						array(
119
-							'name'       => esc_html( 'Text', 'give' ),
120
-							'id'         => $prefix . 'text',
119
+							'name'       => esc_html('Text', 'give'),
120
+							'id'         => $prefix.'text',
121 121
 							'type'       => 'text',
122 122
 							'attributes' => array(
123
-								'placeholder' => esc_attr( 'Donation Level', 'give' ),
123
+								'placeholder' => esc_attr('Donation Level', 'give'),
124 124
 								'class'       => 'give-multilevel-text-field',
125 125
 							),
126 126
 						),
127 127
 						array(
128
-							'name' => esc_html( 'Default', 'give' ),
129
-							'id'   => $prefix . 'default',
128
+							'name' => esc_html('Default', 'give'),
129
+							'id'   => $prefix.'default',
130 130
 							'type' => 'give_default_radio_inline'
131 131
 						),
132
-					) ),
132
+					)),
133 133
 				),
134 134
 				//Display Style
135 135
 				array(
136
-					'name'        => esc_html( 'Display Style', 'give' ),
137
-					'description' => esc_html( 'Set how the donations levels will display on the form.', 'give' ),
138
-					'id'          => $prefix . 'display_style',
136
+					'name'        => esc_html('Display Style', 'give'),
137
+					'description' => esc_html('Set how the donations levels will display on the form.', 'give'),
138
+					'id'          => $prefix.'display_style',
139 139
 					'type'        => 'radio_inline',
140 140
 					'default'     => 'buttons',
141 141
 					'options'     => array(
142
-						'buttons'  => esc_html( 'Buttons', 'give' ),
143
-						'radios'   => esc_html( 'Radios', 'give' ),
144
-						'dropdown' => esc_html( 'Dropdown', 'give' ),
142
+						'buttons'  => esc_html('Buttons', 'give'),
143
+						'radios'   => esc_html('Radios', 'give'),
144
+						'dropdown' => esc_html('Dropdown', 'give'),
145 145
 					),
146 146
 				),
147 147
 				//Custom Amount
148 148
 				array(
149
-					'name'        => esc_html( 'Custom Amount', 'give' ),
150
-					'description' => esc_html( 'Do you want the user to be able to input their own donation amount?', 'give' ),
151
-					'id'          => $prefix . 'custom_amount',
149
+					'name'        => esc_html('Custom Amount', 'give'),
150
+					'description' => esc_html('Do you want the user to be able to input their own donation amount?', 'give'),
151
+					'id'          => $prefix.'custom_amount',
152 152
 					'type'        => 'radio_inline',
153 153
 					'default'     => 'no',
154 154
 					'options'     => array(
155
-						'yes' => esc_html( 'Yes', 'give' ),
156
-						'no'  => esc_html( 'No', 'give' ),
155
+						'yes' => esc_html('Yes', 'give'),
156
+						'no'  => esc_html('No', 'give'),
157 157
 					),
158 158
 				),
159 159
 				array(
160
-					'name'         => esc_html( 'Custom Amount Minimum', 'give' ),
161
-					'description'  => esc_html( 'If you would like to set a minimum custom donation amount please enter it here.', 'give' ),
162
-					'id'           => $prefix . 'custom_amount_minimum',
160
+					'name'         => esc_html('Custom Amount Minimum', 'give'),
161
+					'description'  => esc_html('If you would like to set a minimum custom donation amount please enter it here.', 'give'),
162
+					'id'           => $prefix.'custom_amount_minimum',
163 163
 					'type'         => 'text_small',
164 164
 					'row_classes'  => 'give-subfield',
165
-					'before_field' => give_get_option( 'currency_position' ) == 'before' ? '<span class="give-money-symbol give-money-symbol-before">' . give_currency_symbol() . '</span>' : '',
166
-					'after_field'  => give_get_option( 'currency_position' ) == 'after' ? '<span class="give-money-symbol give-money-symbol-after">' . give_currency_symbol() . '</span>' : '',
165
+					'before_field' => give_get_option('currency_position') == 'before' ? '<span class="give-money-symbol give-money-symbol-before">'.give_currency_symbol().'</span>' : '',
166
+					'after_field'  => give_get_option('currency_position') == 'after' ? '<span class="give-money-symbol give-money-symbol-after">'.give_currency_symbol().'</span>' : '',
167 167
 					'attributes'   => array(
168
-						'placeholder' => give_format_amount( '1.00' ),
169
-						'value'       => give_format_amount( $custom_amount_minimum ),
168
+						'placeholder' => give_format_amount('1.00'),
169
+						'value'       => give_format_amount($custom_amount_minimum),
170 170
 						'class'       => 'cmb-type-text-small give-money-field',
171 171
 					),
172 172
 				),
173 173
 				array(
174
-					'name'        => esc_html( 'Custom Amount Text', 'give' ),
175
-					'description' => esc_html( 'This text appears as a label below the custom amount field for set donation forms. For multi-level forms the text will appear as it\'s own level (ie button, radio, or select option).', 'give' ),
176
-					'id'          => $prefix . 'custom_amount_text',
174
+					'name'        => esc_html('Custom Amount Text', 'give'),
175
+					'description' => esc_html('This text appears as a label below the custom amount field for set donation forms. For multi-level forms the text will appear as it\'s own level (ie button, radio, or select option).', 'give'),
176
+					'id'          => $prefix.'custom_amount_text',
177 177
 					'type'        => 'text',
178 178
 					'row_classes' => 'give-subfield',
179 179
 					'attributes'  => array(
180 180
 						'rows'        => 3,
181
-						'placeholder' => esc_attr( 'Give a Custom Amount', 'give' ),
181
+						'placeholder' => esc_attr('Give a Custom Amount', 'give'),
182 182
 					),
183 183
 				),
184 184
 				//Goals
185 185
 				array(
186
-					'name'        => esc_html( 'Goal', 'give' ),
187
-					'description' => esc_html( 'Do you want to set a donation goal for this form?', 'give' ),
188
-					'id'          => $prefix . 'goal_option',
186
+					'name'        => esc_html('Goal', 'give'),
187
+					'description' => esc_html('Do you want to set a donation goal for this form?', 'give'),
188
+					'id'          => $prefix.'goal_option',
189 189
 					'type'        => 'radio_inline',
190 190
 					'default'     => 'no',
191 191
 					'options'     => array(
192
-						'yes' => esc_html( 'Yes', 'give' ),
193
-						'no'  => esc_html( 'No', 'give' ),
192
+						'yes' => esc_html('Yes', 'give'),
193
+						'no'  => esc_html('No', 'give'),
194 194
 					),
195 195
 				),
196 196
 				array(
197
-					'name'         => esc_html( 'Goal Amount', 'give' ),
198
-					'description'  => esc_html( 'This is the monetary goal amount you want to reach for this donation form.', 'give' ),
199
-					'id'           => $prefix . 'set_goal',
197
+					'name'         => esc_html('Goal Amount', 'give'),
198
+					'description'  => esc_html('This is the monetary goal amount you want to reach for this donation form.', 'give'),
199
+					'id'           => $prefix.'set_goal',
200 200
 					'type'         => 'text_small',
201 201
 					'row_classes'  => 'give-subfield',
202
-					'before_field' => give_get_option( 'currency_position' ) == 'before' ? '<span class="give-money-symbol give-money-symbol-before">' . give_currency_symbol() . '</span>' : '',
203
-					'after_field'  => give_get_option( 'currency_position' ) == 'after' ? '<span class="give-money-symbol give-money-symbol-after">' . give_currency_symbol() . '</span>' : '',
202
+					'before_field' => give_get_option('currency_position') == 'before' ? '<span class="give-money-symbol give-money-symbol-before">'.give_currency_symbol().'</span>' : '',
203
+					'after_field'  => give_get_option('currency_position') == 'after' ? '<span class="give-money-symbol give-money-symbol-after">'.give_currency_symbol().'</span>' : '',
204 204
 					'attributes'   => array(
205
-						'placeholder' => give_format_amount( '0.00' ),
206
-						'value'       => isset( $goal ) ? esc_attr( give_format_amount( $goal ) ) : '',
205
+						'placeholder' => give_format_amount('0.00'),
206
+						'value'       => isset($goal) ? esc_attr(give_format_amount($goal)) : '',
207 207
 						'class'       => 'cmb-type-text-small give-money-field',
208 208
 					),
209 209
 				),
210 210
 
211 211
 				array(
212
-					'name'        => esc_html( 'Goal Format', 'give' ),
213
-					'description' => esc_html( 'Would you like to display the total amount raised based on your monetary goal or a percentage? For instance, "$500 of $1,000 raised" or "50% funded".', 'give' ),
214
-					'id'          => $prefix . 'goal_format',
212
+					'name'        => esc_html('Goal Format', 'give'),
213
+					'description' => esc_html('Would you like to display the total amount raised based on your monetary goal or a percentage? For instance, "$500 of $1,000 raised" or "50% funded".', 'give'),
214
+					'id'          => $prefix.'goal_format',
215 215
 					'type'        => 'radio_inline',
216 216
 					'default'     => 'amount',
217 217
 					'row_classes' => 'give-subfield',
218 218
 					'options'     => array(
219
-						'amount'     => esc_html( 'Amount ', 'give' ),
220
-						'percentage' => esc_html( 'Percentage', 'give' ),
219
+						'amount'     => esc_html('Amount ', 'give'),
220
+						'percentage' => esc_html('Percentage', 'give'),
221 221
 					),
222 222
 				),
223 223
 				array(
224
-					'name'        => esc_html( 'Goal Progress Bar Color', 'give' ),
225
-					'id'          => $prefix . 'goal_color',
224
+					'name'        => esc_html('Goal Progress Bar Color', 'give'),
225
+					'id'          => $prefix.'goal_color',
226 226
 					'type'        => 'colorpicker',
227 227
 					'row_classes' => 'give-subfield',
228 228
 					'default'     => '#2bc253',
229 229
 				),
230 230
 
231 231
 				array(
232
-					'name'        => esc_html( 'Close Form when Goal Achieved', 'give' ),
233
-					'desc'        => esc_html( 'Would you like to close the donation forms and stop accepting donations once this goal has been met?', 'give' ),
234
-					'id'          => $prefix . 'close_form_when_goal_achieved',
232
+					'name'        => esc_html('Close Form when Goal Achieved', 'give'),
233
+					'desc'        => esc_html('Would you like to close the donation forms and stop accepting donations once this goal has been met?', 'give'),
234
+					'id'          => $prefix.'close_form_when_goal_achieved',
235 235
 					'type'        => 'radio_inline',
236 236
 					'row_classes' => 'give-subfield',
237 237
 					'options'     => array(
238
-						'yes' => esc_html( 'Yes', 'give' ),
239
-						'no'  => esc_html( 'No', 'give' ),
238
+						'yes' => esc_html('Yes', 'give'),
239
+						'no'  => esc_html('No', 'give'),
240 240
 					),
241 241
 					'default'     => 'no',
242 242
 				),
243 243
 				array(
244
-					'name'        => esc_html( 'Goal Achieved Message', 'give' ),
245
-					'desc'        => esc_html( 'Would you like to display a custom message when the goal is closed? If none is provided the default message will be displayed', 'give' ),
246
-					'id'          => $prefix . 'form_goal_achieved_message',
244
+					'name'        => esc_html('Goal Achieved Message', 'give'),
245
+					'desc'        => esc_html('Would you like to display a custom message when the goal is closed? If none is provided the default message will be displayed', 'give'),
246
+					'id'          => $prefix.'form_goal_achieved_message',
247 247
 					'type'        => 'textarea',
248 248
 					'row_classes' => 'give-subfield',
249 249
 					'attributes'  => array(
250
-						'placeholder' => esc_attr( 'Thank you to all our donors, we have met our fundraising goal.', 'give' ),
250
+						'placeholder' => esc_attr('Thank you to all our donors, we have met our fundraising goal.', 'give'),
251 251
 					),
252 252
 				)
253 253
 			)
254 254
 		)
255
-	) );
255
+	));
256 256
 
257 257
 
258 258
 	/**
259 259
 	 * Content Field
260 260
 	 */
261
-	$meta_boxes['form_content_options'] = apply_filters( 'give_forms_content_options', array(
261
+	$meta_boxes['form_content_options'] = apply_filters('give_forms_content_options', array(
262 262
 		'id'           => 'form_content_options',
263
-		'title'        => esc_html( 'Form Content', 'give' ),
264
-		'object_types' => array( 'give_forms' ),
263
+		'title'        => esc_html('Form Content', 'give'),
264
+		'object_types' => array('give_forms'),
265 265
 		'context'      => 'normal',
266 266
 		'priority'     => 'high', //Show above Content WYSIWYG
267
-		'fields'       => apply_filters( 'give_forms_content_options_metabox_fields', array(
267
+		'fields'       => apply_filters('give_forms_content_options_metabox_fields', array(
268 268
 				//Donation Option
269 269
 				array(
270
-					'name'        => esc_html( 'Display Content', 'give' ),
271
-					'description' => esc_html( 'Do you want to display content? If you select "Yes" a WYSIWYG editor will appear which you will be able to enter content to display above or below the form.', 'give' ),
272
-					'id'          => $prefix . 'content_option',
270
+					'name'        => esc_html('Display Content', 'give'),
271
+					'description' => esc_html('Do you want to display content? If you select "Yes" a WYSIWYG editor will appear which you will be able to enter content to display above or below the form.', 'give'),
272
+					'id'          => $prefix.'content_option',
273 273
 					'type'        => 'select',
274
-					'options'     => apply_filters( 'give_forms_content_options_select', array(
275
-							'none'           => esc_html( 'No content', 'give' ),
276
-							'give_pre_form'  => esc_html( 'Yes, display content ABOVE the form fields', 'give' ),
277
-							'give_post_form' => esc_html( 'Yes, display content BELOW the form fields', 'give' ),
274
+					'options'     => apply_filters('give_forms_content_options_select', array(
275
+							'none'           => esc_html('No content', 'give'),
276
+							'give_pre_form'  => esc_html('Yes, display content ABOVE the form fields', 'give'),
277
+							'give_post_form' => esc_html('Yes, display content BELOW the form fields', 'give'),
278 278
 						)
279 279
 					),
280 280
 					'default'     => 'none',
281 281
 				),
282 282
 				array(
283
-					'name'        => esc_html( 'Content', 'give' ),
284
-					'description' => esc_html( 'This content will display on the single give form page.', 'give' ),
285
-					'id'          => $prefix . 'form_content',
283
+					'name'        => esc_html('Content', 'give'),
284
+					'description' => esc_html('This content will display on the single give form page.', 'give'),
285
+					'id'          => $prefix.'form_content',
286 286
 					'row_classes' => 'give-subfield',
287 287
 					'type'        => 'wysiwyg'
288 288
 				),
289 289
 			)
290 290
 		)
291
-	) );
291
+	));
292 292
 
293 293
 
294 294
 	/**
295 295
 	 * Display Options
296 296
 	 */
297
-	$meta_boxes['form_display_options'] = apply_filters( 'give_form_display_options', array(
297
+	$meta_boxes['form_display_options'] = apply_filters('give_form_display_options', array(
298 298
 			'id'           => 'form_display_options',
299
-			'title'        => esc_html( 'Form Display Options', 'give' ),
300
-			'object_types' => array( 'give_forms' ),
299
+			'title'        => esc_html('Form Display Options', 'give'),
300
+			'object_types' => array('give_forms'),
301 301
 			'context'      => 'normal', //  'normal', 'advanced', or 'side'
302 302
 			'priority'     => 'high', //Show above Content WYSIWYG
303 303
 			'show_names'   => true, // Show field names on the left
304
-			'fields'       => apply_filters( 'give_forms_display_options_metabox_fields', array(
304
+			'fields'       => apply_filters('give_forms_display_options_metabox_fields', array(
305 305
 					array(
306
-						'name'    => esc_html( 'Payment Fields', 'give' ),
307
-						'desc'    => esc_html( 'How would you like to display payment information for this form? The "Show on Page" option will display the entire form when the page loads. "Reveal Upon Click" places a button below the donation fields and upon click slides into view the rest of the fields. "Modal Window Upon Click" is a similar option, rather than sliding into view the fields they will open in a shadow box or "modal" window.', 'give' ),
308
-						'id'      => $prefix . 'payment_display',
306
+						'name'    => esc_html('Payment Fields', 'give'),
307
+						'desc'    => esc_html('How would you like to display payment information for this form? The "Show on Page" option will display the entire form when the page loads. "Reveal Upon Click" places a button below the donation fields and upon click slides into view the rest of the fields. "Modal Window Upon Click" is a similar option, rather than sliding into view the fields they will open in a shadow box or "modal" window.', 'give'),
308
+						'id'      => $prefix.'payment_display',
309 309
 						'type'    => 'select',
310 310
 						'options' => array(
311
-							'onpage' => esc_html( 'Show on Page', 'give' ),
312
-							'reveal' => esc_html( 'Reveal Upon Click', 'give' ),
313
-							'modal'  => esc_html( 'Modal Window Upon Click', 'give' ),
311
+							'onpage' => esc_html('Show on Page', 'give'),
312
+							'reveal' => esc_html('Reveal Upon Click', 'give'),
313
+							'modal'  => esc_html('Modal Window Upon Click', 'give'),
314 314
 						),
315 315
 						'default' => 'onpage',
316 316
 					),
317 317
 					array(
318
-						'id'          => $prefix . 'reveal_label',
319
-						'name'        => esc_html( 'Reveal / Modal Open Text', 'give' ),
320
-						'desc'        => esc_html( 'The button label for completing the donation.', 'give' ),
318
+						'id'          => $prefix.'reveal_label',
319
+						'name'        => esc_html('Reveal / Modal Open Text', 'give'),
320
+						'desc'        => esc_html('The button label for completing the donation.', 'give'),
321 321
 						'type'        => 'text_small',
322 322
 						'row_classes' => 'give-subfield',
323 323
 						'attributes'  => array(
324
-							'placeholder' => esc_attr( 'Donate Now', 'give' ),
324
+							'placeholder' => esc_attr('Donate Now', 'give'),
325 325
 						),
326 326
 					),
327 327
 					array(
328
-						'id'         => $prefix . 'checkout_label',
329
-						'name'       => esc_html( 'Complete Donation Text', 'give' ),
330
-						'desc'       => esc_html( 'The button label for completing a donation.', 'give' ),
328
+						'id'         => $prefix.'checkout_label',
329
+						'name'       => esc_html('Complete Donation Text', 'give'),
330
+						'desc'       => esc_html('The button label for completing a donation.', 'give'),
331 331
 						'type'       => 'text_small',
332 332
 						'attributes' => array(
333
-							'placeholder' => esc_attr( 'Donate Now', 'give' ),
333
+							'placeholder' => esc_attr('Donate Now', 'give'),
334 334
 						),
335 335
 					),
336 336
 					array(
337
-						'name' => esc_html( 'Default Gateway', 'give' ),
338
-						'desc' => esc_html( 'By default, the gateway for this form will inherit the global default gateway (set under Give > Settings > Payment Gateways). This option allows you to customize the default gateway for this form only.', 'give' ),
339
-						'id'   => $prefix . 'default_gateway',
337
+						'name' => esc_html('Default Gateway', 'give'),
338
+						'desc' => esc_html('By default, the gateway for this form will inherit the global default gateway (set under Give > Settings > Payment Gateways). This option allows you to customize the default gateway for this form only.', 'give'),
339
+						'id'   => $prefix.'default_gateway',
340 340
 						'type' => 'default_gateway'
341 341
 					),
342 342
 					array(
343
-						'name' => esc_html( 'Disable Guest Donations', 'give' ),
344
-						'desc' => esc_html( 'Do you want to require users be logged-in to make donations?', 'give' ),
345
-						'id'   => $prefix . 'logged_in_only',
343
+						'name' => esc_html('Disable Guest Donations', 'give'),
344
+						'desc' => esc_html('Do you want to require users be logged-in to make donations?', 'give'),
345
+						'id'   => $prefix.'logged_in_only',
346 346
 						'type' => 'checkbox'
347 347
 					),
348 348
 					array(
349
-						'name'    => esc_html( 'Register / Login Form', 'give' ),
350
-						'desc'    => esc_html( 'Display the registration and login forms in the payment section for non-logged-in users.', 'give' ),
351
-						'id'      => $prefix . 'show_register_form',
349
+						'name'    => esc_html('Register / Login Form', 'give'),
350
+						'desc'    => esc_html('Display the registration and login forms in the payment section for non-logged-in users.', 'give'),
351
+						'id'      => $prefix.'show_register_form',
352 352
 						'type'    => 'select',
353 353
 						'options' => array(
354
-							'both'         => esc_html( 'Registration and Login Forms', 'give' ),
355
-							'registration' => esc_html( 'Registration Form Only', 'give' ),
356
-							'login'        => esc_html( 'Login Form Only', 'give' ),
357
-							'none'         => esc_html( 'None', 'give' ),
354
+							'both'         => esc_html('Registration and Login Forms', 'give'),
355
+							'registration' => esc_html('Registration Form Only', 'give'),
356
+							'login'        => esc_html('Login Form Only', 'give'),
357
+							'none'         => esc_html('None', 'give'),
358 358
 						),
359 359
 						'default' => 'none',
360 360
 					),
361 361
 					array(
362
-						'name'    => esc_html( 'Floating Labels', 'give' ),
362
+						'name'    => esc_html('Floating Labels', 'give'),
363 363
 						/* translators: %s: forms http://bradfrost.com/blog/post/float-label-pattern/ */
364
-						'desc'    => sprintf( __( 'Select the <a href="%s" target="_blank">floating labels</a> setting for this Give form.<br>Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give' ), esc_url( "http://bradfrost.com/blog/post/float-label-pattern/" ) ),
365
-						'id'      => $prefix . 'form_floating_labels',
364
+						'desc'    => sprintf(__('Select the <a href="%s" target="_blank">floating labels</a> setting for this Give form.<br>Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give'), esc_url("http://bradfrost.com/blog/post/float-label-pattern/")),
365
+						'id'      => $prefix.'form_floating_labels',
366 366
 						'type'    => 'select',
367 367
 						'options' => array(
368
-							''         => esc_html( 'Use the global setting', 'give' ),
369
-							'enabled'  => esc_html( 'Enabled', 'give' ),
370
-							'disabled' => esc_html( 'Disabled', 'give' ),
368
+							''         => esc_html('Use the global setting', 'give'),
369
+							'enabled'  => esc_html('Enabled', 'give'),
370
+							'disabled' => esc_html('Disabled', 'give'),
371 371
 						),
372 372
 						'default' => 'none',
373 373
 					)
@@ -379,47 +379,47 @@  discard block
 block discarded – undo
379 379
 	/**
380 380
 	 * Terms & Conditions
381 381
 	 */
382
-	$meta_boxes['form_terms_options'] = apply_filters( 'give_forms_terms_options', array(
382
+	$meta_boxes['form_terms_options'] = apply_filters('give_forms_terms_options', array(
383 383
 		'id'           => 'form_terms_options',
384
-		'title'        => esc_html( 'Terms and Conditions', 'give' ),
385
-		'object_types' => array( 'give_forms' ),
384
+		'title'        => esc_html('Terms and Conditions', 'give'),
385
+		'object_types' => array('give_forms'),
386 386
 		'context'      => 'normal',
387 387
 		'priority'     => 'high', //Show above Content WYSIWYG
388
-		'fields'       => apply_filters( 'give_forms_terms_options_metabox_fields', array(
388
+		'fields'       => apply_filters('give_forms_terms_options_metabox_fields', array(
389 389
 				//Donation Option
390 390
 				array(
391
-					'name'        => esc_html( 'Terms and Conditions', 'give' ),
392
-					'description' => esc_html( 'Do you want to require the user to agree to terms and conditions prior to being able to complete their donation?', 'give' ),
393
-					'id'          => $prefix . 'terms_option',
391
+					'name'        => esc_html('Terms and Conditions', 'give'),
392
+					'description' => esc_html('Do you want to require the user to agree to terms and conditions prior to being able to complete their donation?', 'give'),
393
+					'id'          => $prefix.'terms_option',
394 394
 					'type'        => 'select',
395
-					'options'     => apply_filters( 'give_forms_content_options_select', array(
396
-							'none' => esc_html( 'No', 'give' ),
397
-							'yes'  => esc_html( 'Yes', 'give' ),
395
+					'options'     => apply_filters('give_forms_content_options_select', array(
396
+							'none' => esc_html('No', 'give'),
397
+							'yes'  => esc_html('Yes', 'give'),
398 398
 						)
399 399
 					),
400 400
 					'default'     => 'none',
401 401
 				),
402 402
 				array(
403
-					'id'          => $prefix . 'agree_label',
404
-					'name'        => esc_html( 'Agree to Terms Label', 'give' ),
405
-					'desc'        => esc_html( 'The label shown next to the agree to terms check box. Add your own to customize or leave blank to use the default text placeholder.', 'give' ),
403
+					'id'          => $prefix.'agree_label',
404
+					'name'        => esc_html('Agree to Terms Label', 'give'),
405
+					'desc'        => esc_html('The label shown next to the agree to terms check box. Add your own to customize or leave blank to use the default text placeholder.', 'give'),
406 406
 					'type'        => 'text',
407 407
 					'row_classes' => 'give-subfield',
408 408
 					'size'        => 'regular',
409 409
 					'attributes'  => array(
410
-						'placeholder' => esc_attr( 'Agree to Terms?', 'give' ),
410
+						'placeholder' => esc_attr('Agree to Terms?', 'give'),
411 411
 					),
412 412
 				),
413 413
 				array(
414
-					'id'          => $prefix . 'agree_text',
414
+					'id'          => $prefix.'agree_text',
415 415
 					'row_classes' => 'give-subfield',
416
-					'name'        => esc_html( 'Agreement Text', 'give' ),
417
-					'desc'        => esc_html( 'This is the actual text which the user will have to agree to in order to make a donation.', 'give' ),
416
+					'name'        => esc_html('Agreement Text', 'give'),
417
+					'desc'        => esc_html('This is the actual text which the user will have to agree to in order to make a donation.', 'give'),
418 418
 					'type'        => 'wysiwyg'
419 419
 				),
420 420
 			)
421 421
 		)
422
-	) );
422
+	));
423 423
 
424 424
 	return $meta_boxes;
425 425
 
@@ -433,11 +433,11 @@  discard block
 block discarded – undo
433 433
 
434 434
 	<div class="table-container">
435 435
 		<div class="table-row">
436
-			<div class="table-cell col-amount"><?php esc_html_e( 'Amount', 'give' ); ?></div>
437
-			<div class="table-cell col-text"><?php esc_html_e( 'Text', 'give' ); ?></div>
438
-			<div class="table-cell col-default"><?php esc_html_e( 'Default', 'give' ); ?></div>
439
-			<?php do_action( 'give_donation_levels_table_head' ); ?>
440
-			<div class="table-cell col-sort"><?php esc_html_e( 'Sort', 'give' ); ?></div>
436
+			<div class="table-cell col-amount"><?php esc_html_e('Amount', 'give'); ?></div>
437
+			<div class="table-cell col-text"><?php esc_html_e('Text', 'give'); ?></div>
438
+			<div class="table-cell col-default"><?php esc_html_e('Default', 'give'); ?></div>
439
+			<?php do_action('give_donation_levels_table_head'); ?>
440
+			<div class="table-cell col-sort"><?php esc_html_e('Sort', 'give'); ?></div>
441 441
 
442 442
 		</div>
443 443
 	</div>
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
 	<?php
446 446
 }
447 447
 
448
-add_action( 'cmb2_render_levels_repeater_header', 'give_cmb_render_levels_repeater_header', 10 );
448
+add_action('cmb2_render_levels_repeater_header', 'give_cmb_render_levels_repeater_header', 10);
449 449
 
450 450
 
451 451
 /**
@@ -462,25 +462,25 @@  discard block
 block discarded – undo
462 462
  * @param $object_type
463 463
  * @param $field_type_object
464 464
  */
465
-function give_cmb_render_levels_id( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
465
+function give_cmb_render_levels_id($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
466 466
 
467
-	$escaped_value = ( isset( $escaped_value['level_id'] ) ? $escaped_value['level_id'] : '' );
467
+	$escaped_value = (isset($escaped_value['level_id']) ? $escaped_value['level_id'] : '');
468 468
 
469 469
 	$field_options_array = array(
470 470
 		'class' => 'give-hidden give-level-id-input',
471
-		'name'  => $field_type_object->_name( '[level_id]' ),
472
-		'id'    => $field_type_object->_id( '_level_id' ),
471
+		'name'  => $field_type_object->_name('[level_id]'),
472
+		'id'    => $field_type_object->_id('_level_id'),
473 473
 		'value' => $escaped_value,
474 474
 		'type'  => 'number',
475 475
 		'desc'  => '',
476 476
 	);
477 477
 
478
-	echo '<p class="give-level-id">' . $escaped_value . '</p>';
479
-	echo $field_type_object->input( $field_options_array );
478
+	echo '<p class="give-level-id">'.$escaped_value.'</p>';
479
+	echo $field_type_object->input($field_options_array);
480 480
 
481 481
 }
482 482
 
483
-add_action( 'cmb2_render_levels_id', 'give_cmb_render_levels_id', 10, 5 );
483
+add_action('cmb2_render_levels_id', 'give_cmb_render_levels_id', 10, 5);
484 484
 
485 485
 
486 486
 /**
@@ -492,13 +492,13 @@  discard block
 block discarded – undo
492 492
  * @param $object_type
493 493
  * @param $field_type_object
494 494
  */
495
-function give_cmb_give_default_radio_inline( $field_object, $escaped_value, $object_id, $object_type, $field_type_object ) {
496
-	echo '<input type="radio" class="cmb2-option donation-level-radio" name="' . $field_object->args['_name'] . '" id="' . $field_object->args['id'] . '" value="default" ' . checked( 'default', $escaped_value, false ) . '>';
497
-	echo '<label for="' . $field_object->args['id'] . '">Default</label>';
495
+function give_cmb_give_default_radio_inline($field_object, $escaped_value, $object_id, $object_type, $field_type_object) {
496
+	echo '<input type="radio" class="cmb2-option donation-level-radio" name="'.$field_object->args['_name'].'" id="'.$field_object->args['id'].'" value="default" '.checked('default', $escaped_value, false).'>';
497
+	echo '<label for="'.$field_object->args['id'].'">Default</label>';
498 498
 
499 499
 }
500 500
 
501
-add_action( 'cmb2_render_give_default_radio_inline', 'give_cmb_give_default_radio_inline', 10, 5 );
501
+add_action('cmb2_render_give_default_radio_inline', 'give_cmb_give_default_radio_inline', 10, 5);
502 502
 
503 503
 
504 504
 /**
@@ -508,20 +508,20 @@  discard block
 block discarded – undo
508 508
  */
509 509
 function give_add_shortcode_to_publish_metabox() {
510 510
 
511
-	if ( 'give_forms' !== get_post_type() ) {
511
+	if ('give_forms' !== get_post_type()) {
512 512
 		return false;
513 513
 	}
514 514
 
515 515
 	global $post;
516 516
 
517 517
 	//Only enqueue scripts for CPT on post type screen
518
-	if ( 'give_forms' === $post->post_type ) {
518
+	if ('give_forms' === $post->post_type) {
519 519
 		//Shortcode column with select all input
520
-		$shortcode = htmlentities( '[give_form id="' . $post->ID . '"]' );
521
-		echo '<div class="shortcode-wrap box-sizing"><label>' . esc_html( 'Give Form Shortcode:', 'give' ) . '</label><input onClick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly value="' . $shortcode . '"></div>';
520
+		$shortcode = htmlentities('[give_form id="'.$post->ID.'"]');
521
+		echo '<div class="shortcode-wrap box-sizing"><label>'.esc_html('Give Form Shortcode:', 'give').'</label><input onClick="this.setSelectionRange(0, this.value.length)" type="text" class="shortcode-input" readonly value="'.$shortcode.'"></div>';
522 522
 
523 523
 	}
524 524
 
525 525
 }
526 526
 
527
-add_action( 'post_submitbox_misc_actions', 'give_add_shortcode_to_publish_metabox' );
527
+add_action('post_submitbox_misc_actions', 'give_add_shortcode_to_publish_metabox');
Please login to merge, or discard this patch.
includes/admin/upgrades/upgrade-functions.php 1 patch
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
  */
14 14
 
15 15
 // Exit if accessed directly
16
-if ( ! defined( 'ABSPATH' ) ) {
16
+if ( ! defined('ABSPATH')) {
17 17
 	exit;
18 18
 }
19 19
 
@@ -25,18 +25,18 @@  discard block
 block discarded – undo
25 25
  */
26 26
 function give_show_upgrade_notices() {
27 27
 
28
-	if ( isset( $_GET['page'] ) && $_GET['page'] == 'give-upgrades' ) {
28
+	if (isset($_GET['page']) && $_GET['page'] == 'give-upgrades') {
29 29
 		return;
30 30
 	} // Don't show notices on the upgrades page
31 31
 
32
-	$give_version = get_option( 'give_version' );
32
+	$give_version = get_option('give_version');
33 33
 
34
-	if ( ! $give_version ) {
34
+	if ( ! $give_version) {
35 35
 		// 1.0 is the first version to use this option so we must add it
36 36
 		$give_version = '1.0';
37 37
 	}
38 38
 
39
-	$give_version = preg_replace( '/[^0-9.].*/', '', $give_version );
39
+	$give_version = preg_replace('/[^0-9.].*/', '', $give_version);
40 40
 
41 41
 	/*
42 42
 	 *  NOTICE:
@@ -47,20 +47,20 @@  discard block
 block discarded – undo
47 47
 	 */
48 48
 
49 49
 	//v1.3.2 Upgrades
50
-	if ( version_compare( $give_version, '1.3.2', '<' ) || ! give_has_upgrade_completed( 'upgrade_give_payment_customer_id' ) ) {
50
+	if (version_compare($give_version, '1.3.2', '<') || ! give_has_upgrade_completed('upgrade_give_payment_customer_id')) {
51 51
 		printf(
52 52
 			/* translators: %s: upgrade URL */
53
-			'<div class="updated"><p>' . __( 'Give needs to upgrade the donor database, click <a href="%s">here</a> to start the upgrade.', 'give' ) . '</p></div>',
54
-			esc_url( admin_url( 'index.php?page=give-upgrades&give-upgrade=upgrade_give_payment_customer_id' ) )
53
+			'<div class="updated"><p>'.__('Give needs to upgrade the donor database, click <a href="%s">here</a> to start the upgrade.', 'give').'</p></div>',
54
+			esc_url(admin_url('index.php?page=give-upgrades&give-upgrade=upgrade_give_payment_customer_id'))
55 55
 		);
56 56
 	}
57 57
 
58 58
 	//v1.3.4 Upgrades //ensure the user has gone through 1.3.4
59
-	if ( version_compare( $give_version, '1.3.4', '<' ) || ( ! give_has_upgrade_completed( 'upgrade_give_offline_status' ) && give_has_upgrade_completed( 'upgrade_give_payment_customer_id' ) ) ) {
59
+	if (version_compare($give_version, '1.3.4', '<') || ( ! give_has_upgrade_completed('upgrade_give_offline_status') && give_has_upgrade_completed('upgrade_give_payment_customer_id'))) {
60 60
 		printf(
61 61
 			/* translators: %s: upgrade URL */
62
-			'<div class="updated"><p>' . __( 'Give needs to upgrade the transaction database, click <a href="%s">here</a> to start the upgrade.', 'give' ) . '</p></div>',
63
-			esc_url( admin_url( 'index.php?page=give-upgrades&give-upgrade=upgrade_give_offline_status' ) )
62
+			'<div class="updated"><p>'.__('Give needs to upgrade the transaction database, click <a href="%s">here</a> to start the upgrade.', 'give').'</p></div>',
63
+			esc_url(admin_url('index.php?page=give-upgrades&give-upgrade=upgrade_give_offline_status'))
64 64
 		);
65 65
 	}
66 66
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 
71 71
 }
72 72
 
73
-add_action( 'admin_notices', 'give_show_upgrade_notices' );
73
+add_action('admin_notices', 'give_show_upgrade_notices');
74 74
 
75 75
 /**
76 76
  * Triggers all upgrade functions
@@ -82,26 +82,26 @@  discard block
 block discarded – undo
82 82
  */
83 83
 function give_trigger_upgrades() {
84 84
 
85
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
86
-		wp_die( esc_html( 'You do not have permission to do Give upgrades.', 'give' ), esc_html( 'Error', 'give' ), array( 'response' => 403 ) );
85
+	if ( ! current_user_can('manage_give_settings')) {
86
+		wp_die(esc_html('You do not have permission to do Give upgrades.', 'give'), esc_html('Error', 'give'), array('response' => 403));
87 87
 	}
88 88
 
89
-	$give_version = get_option( 'give_version' );
89
+	$give_version = get_option('give_version');
90 90
 
91
-	if ( ! $give_version ) {
91
+	if ( ! $give_version) {
92 92
 		// 1.0 is the first version to use this option so we must add it
93 93
 		$give_version = '1.0';
94
-		add_option( 'give_version', $give_version );
94
+		add_option('give_version', $give_version);
95 95
 	}
96 96
 
97
-	update_option( 'give_version', GIVE_VERSION );
97
+	update_option('give_version', GIVE_VERSION);
98 98
 
99
-	if ( DOING_AJAX ) {
100
-		die( 'complete' );
99
+	if (DOING_AJAX) {
100
+		die('complete');
101 101
 	} // Let AJAX know that the upgrade is complete
102 102
 }
103 103
 
104
-add_action( 'wp_ajax_give_trigger_upgrades', 'give_trigger_upgrades' );
104
+add_action('wp_ajax_give_trigger_upgrades', 'give_trigger_upgrades');
105 105
 
106 106
 /**
107 107
  * Check if the upgrade routine has been run for a specific action
@@ -112,15 +112,15 @@  discard block
 block discarded – undo
112 112
  *
113 113
  * @return bool                   If the action has been added to the completed actions array
114 114
  */
115
-function give_has_upgrade_completed( $upgrade_action = '' ) {
115
+function give_has_upgrade_completed($upgrade_action = '') {
116 116
 
117
-	if ( empty( $upgrade_action ) ) {
117
+	if (empty($upgrade_action)) {
118 118
 		return false;
119 119
 	}
120 120
 
121 121
 	$completed_upgrades = give_get_completed_upgrades();
122 122
 
123
-	return in_array( $upgrade_action, $completed_upgrades );
123
+	return in_array($upgrade_action, $completed_upgrades);
124 124
 
125 125
 }
126 126
 
@@ -133,9 +133,9 @@  discard block
 block discarded – undo
133 133
  *
134 134
  * @return bool                   If the function was successfully added
135 135
  */
136
-function give_set_upgrade_complete( $upgrade_action = '' ) {
136
+function give_set_upgrade_complete($upgrade_action = '') {
137 137
 
138
-	if ( empty( $upgrade_action ) ) {
138
+	if (empty($upgrade_action)) {
139 139
 		return false;
140 140
 	}
141 141
 
@@ -143,9 +143,9 @@  discard block
 block discarded – undo
143 143
 	$completed_upgrades[] = $upgrade_action;
144 144
 
145 145
 	// Remove any blanks, and only show uniques
146
-	$completed_upgrades = array_unique( array_values( $completed_upgrades ) );
146
+	$completed_upgrades = array_unique(array_values($completed_upgrades));
147 147
 
148
-	return update_option( 'give_completed_upgrades', $completed_upgrades );
148
+	return update_option('give_completed_upgrades', $completed_upgrades);
149 149
 }
150 150
 
151 151
 /**
@@ -156,9 +156,9 @@  discard block
 block discarded – undo
156 156
  */
157 157
 function give_get_completed_upgrades() {
158 158
 
159
-	$completed_upgrades = get_option( 'give_completed_upgrades' );
159
+	$completed_upgrades = get_option('give_completed_upgrades');
160 160
 
161
-	if ( false === $completed_upgrades ) {
161
+	if (false === $completed_upgrades) {
162 162
 		$completed_upgrades = array();
163 163
 	}
164 164
 
@@ -177,30 +177,30 @@  discard block
 block discarded – undo
177 177
  */
178 178
 function give_v132_upgrade_give_payment_customer_id() {
179 179
 	global $wpdb;
180
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
181
-		wp_die( esc_html( 'You do not have permission to do Give upgrades.', 'give' ), esc_html( 'Error', 'give' ), array( 'response' => 403 ) );
180
+	if ( ! current_user_can('manage_give_settings')) {
181
+		wp_die(esc_html('You do not have permission to do Give upgrades.', 'give'), esc_html('Error', 'give'), array('response' => 403));
182 182
 	}
183 183
 
184
-	ignore_user_abort( true );
184
+	ignore_user_abort(true);
185 185
 
186
-	if ( ! give_is_func_disabled( 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) {
187
-		@set_time_limit( 0 );
186
+	if ( ! give_is_func_disabled('set_time_limit') && ! ini_get('safe_mode')) {
187
+		@set_time_limit(0);
188 188
 	}
189 189
 
190 190
 	//UPDATE DB METAKEYS
191 191
 	$sql   = "UPDATE $wpdb->postmeta SET meta_key = '_give_payment_customer_id' WHERE meta_key = '_give_payment_donor_id'";
192
-	$query = $wpdb->query( $sql );
192
+	$query = $wpdb->query($sql);
193 193
 
194
-	update_option( 'give_version', preg_replace( '/[^0-9.].*/', '', GIVE_VERSION ) );
195
-	give_set_upgrade_complete( 'upgrade_give_payment_customer_id' );
196
-	delete_option( 'give_doing_upgrade' );
197
-	wp_redirect( admin_url() );
194
+	update_option('give_version', preg_replace('/[^0-9.].*/', '', GIVE_VERSION));
195
+	give_set_upgrade_complete('upgrade_give_payment_customer_id');
196
+	delete_option('give_doing_upgrade');
197
+	wp_redirect(admin_url());
198 198
 	exit;
199 199
 
200 200
 
201 201
 }
202 202
 
203
-add_action( 'give_upgrade_give_payment_customer_id', 'give_v132_upgrade_give_payment_customer_id' );
203
+add_action('give_upgrade_give_payment_customer_id', 'give_v132_upgrade_give_payment_customer_id');
204 204
 
205 205
 /**
206 206
  * Upgrades the Offline Status
@@ -214,14 +214,14 @@  discard block
 block discarded – undo
214 214
 
215 215
 	global $wpdb;
216 216
 
217
-	if ( ! current_user_can( 'manage_give_settings' ) ) {
218
-		wp_die( esc_html( 'You do not have permission to do Give upgrades.', 'give' ), esc_html( 'Error', 'give' ), array( 'response' => 403 ) );
217
+	if ( ! current_user_can('manage_give_settings')) {
218
+		wp_die(esc_html('You do not have permission to do Give upgrades.', 'give'), esc_html('Error', 'give'), array('response' => 403));
219 219
 	}
220 220
 
221
-	ignore_user_abort( true );
221
+	ignore_user_abort(true);
222 222
 
223
-	if ( ! give_is_func_disabled( 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) {
224
-		@set_time_limit( 0 );
223
+	if ( ! give_is_func_disabled('set_time_limit') && ! ini_get('safe_mode')) {
224
+		@set_time_limit(0);
225 225
 	}
226 226
 
227 227
 	// Get abandoned offline payments
@@ -231,35 +231,35 @@  discard block
 block discarded – undo
231 231
 	$where .= "AND ( p.post_status = 'abandoned' )";
232 232
 	$where .= "AND ( m.meta_key = '_give_payment_gateway' AND m.meta_value = 'offline' )";
233 233
 
234
-	$sql            = $select . $join . $where;
235
-	$found_payments = $wpdb->get_col( $sql );
234
+	$sql            = $select.$join.$where;
235
+	$found_payments = $wpdb->get_col($sql);
236 236
 
237 237
 
238
-	foreach ( $found_payments as $payment ) {
238
+	foreach ($found_payments as $payment) {
239 239
 
240 240
 		//Only change ones marked abandoned since our release last week
241 241
 		//because the admin may have marked some abandoned themselves
242
-		$modified_time = get_post_modified_time( 'U', false, $payment );
242
+		$modified_time = get_post_modified_time('U', false, $payment);
243 243
 
244 244
 		//1450124863 =  12/10/2015 20:42:25
245
-		if ( $modified_time >= 1450124863 ) {
245
+		if ($modified_time >= 1450124863) {
246 246
 
247
-			give_update_payment_status( $payment, 'pending' );
247
+			give_update_payment_status($payment, 'pending');
248 248
 
249 249
 		}
250 250
 
251 251
 	}
252 252
 
253
-	update_option( 'give_version', preg_replace( '/[^0-9.].*/', '', GIVE_VERSION ) );
254
-	give_set_upgrade_complete( 'upgrade_give_offline_status' );
255
-	delete_option( 'give_doing_upgrade' );
256
-	wp_redirect( admin_url() );
253
+	update_option('give_version', preg_replace('/[^0-9.].*/', '', GIVE_VERSION));
254
+	give_set_upgrade_complete('upgrade_give_offline_status');
255
+	delete_option('give_doing_upgrade');
256
+	wp_redirect(admin_url());
257 257
 	exit;
258 258
 
259 259
 
260 260
 }
261 261
 
262
-add_action( 'give_upgrade_give_offline_status', 'give_v134_upgrade_give_offline_status' );
262
+add_action('give_upgrade_give_offline_status', 'give_v134_upgrade_give_offline_status');
263 263
 
264 264
 
265 265
 /**
@@ -271,17 +271,17 @@  discard block
 block discarded – undo
271 271
  */
272 272
 function give_v152_cleanup_users() {
273 273
 
274
-	$give_version = get_option( 'give_version' );
274
+	$give_version = get_option('give_version');
275 275
 
276
-	if ( ! $give_version ) {
276
+	if ( ! $give_version) {
277 277
 		// 1.0 is the first version to use this option so we must add it
278 278
 		$give_version = '1.0';
279 279
 	}
280 280
 
281
-	$give_version = preg_replace( '/[^0-9.].*/', '', $give_version );
281
+	$give_version = preg_replace('/[^0-9.].*/', '', $give_version);
282 282
 
283 283
 	//v1.5.2 Upgrades
284
-	if ( version_compare( $give_version, '1.5.2', '<' ) || ! give_has_upgrade_completed( 'upgrade_give_user_caps_cleanup' ) ) {
284
+	if (version_compare($give_version, '1.5.2', '<') || ! give_has_upgrade_completed('upgrade_give_user_caps_cleanup')) {
285 285
 
286 286
 		//Delete all caps with "ss"
287 287
 		//Also delete all unused "campaign" roles
@@ -328,9 +328,9 @@  discard block
 block discarded – undo
328 328
 		);
329 329
 	
330 330
 		global $wp_roles;
331
-		foreach ( $delete_caps as $cap ) {
332
-			foreach ( array_keys( $wp_roles->roles ) as $role ) {
333
-				$wp_roles->remove_cap( $role, $cap );
331
+		foreach ($delete_caps as $cap) {
332
+			foreach (array_keys($wp_roles->roles) as $role) {
333
+				$wp_roles->remove_cap($role, $cap);
334 334
 			}
335 335
 		}
336 336
 	
@@ -340,12 +340,12 @@  discard block
 block discarded – undo
340 340
 		$roles->add_caps();
341 341
 		
342 342
 		//The Update Ran
343
-		update_option( 'give_version', preg_replace( '/[^0-9.].*/', '', GIVE_VERSION ) );
344
-		give_set_upgrade_complete( 'upgrade_give_user_caps_cleanup' );
345
-		delete_option( 'give_doing_upgrade' );
343
+		update_option('give_version', preg_replace('/[^0-9.].*/', '', GIVE_VERSION));
344
+		give_set_upgrade_complete('upgrade_give_user_caps_cleanup');
345
+		delete_option('give_doing_upgrade');
346 346
 
347 347
 	}
348 348
 
349 349
 }
350 350
 
351
-add_action( 'admin_init', 'give_v152_cleanup_users' );
352 351
\ No newline at end of file
352
+add_action('admin_init', 'give_v152_cleanup_users');
353 353
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/upgrades/upgrades.php 2 patches
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	exit;
15 15
 }
16 16
 
@@ -21,12 +21,12 @@  discard block
 block discarded – undo
21 21
  * @return void
22 22
  */
23 23
 function give_upgrades_screen() {
24
-	$action = isset( $_GET['give-upgrade'] ) ? sanitize_text_field( $_GET['give-upgrade'] ) : '';
25
-	$step   = isset( $_GET['step'] ) ? absint( $_GET['step'] ) : 1;
26
-	$total  = isset( $_GET['total'] ) ? absint( $_GET['total'] ) : false;
27
-	$custom = isset( $_GET['custom'] ) ? absint( $_GET['custom'] ) : 0;
28
-	$number = isset( $_GET['number'] ) ? absint( $_GET['number'] ) : 100;
29
-	$steps  = round( ( $total / $number ), 0 );
24
+	$action = isset($_GET['give-upgrade']) ? sanitize_text_field($_GET['give-upgrade']) : '';
25
+	$step   = isset($_GET['step']) ? absint($_GET['step']) : 1;
26
+	$total  = isset($_GET['total']) ? absint($_GET['total']) : false;
27
+	$custom = isset($_GET['custom']) ? absint($_GET['custom']) : 0;
28
+	$number = isset($_GET['number']) ? absint($_GET['number']) : 100;
29
+	$steps  = round(($total / $number), 0);
30 30
 
31 31
 	$doing_upgrade_args = array(
32 32
 		'page'         => 'give-upgrades',
@@ -36,25 +36,25 @@  discard block
 block discarded – undo
36 36
 		'custom'       => $custom,
37 37
 		'steps'        => $steps
38 38
 	);
39
-	update_option( 'give_doing_upgrade', $doing_upgrade_args );
40
-	if ( $step > $steps ) {
39
+	update_option('give_doing_upgrade', $doing_upgrade_args);
40
+	if ($step > $steps) {
41 41
 		// Prevent a weird case where the estimate was off. Usually only a couple.
42 42
 		$steps = $step;
43 43
 	}
44 44
 	?>
45 45
 	<div class="wrap">
46
-		<h2><?php esc_html_e( 'Give - Upgrades', 'give' ); ?></h2>
46
+		<h2><?php esc_html_e('Give - Upgrades', 'give'); ?></h2>
47 47
 
48
-		<?php if ( ! empty( $action ) ) : ?>
48
+		<?php if ( ! empty($action)) : ?>
49 49
 
50 50
 			<div id="give-upgrade-status">
51
-				<p style="font-size: 20px;max-width: 900px;"><?php esc_html_e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' ); ?>
52
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style="  position: relative; top: 3px; left: 6px;" />
51
+				<p style="font-size: 20px;max-width: 900px;"><?php esc_html_e('The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give'); ?>
52
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style="  position: relative; top: 3px; left: 6px;" />
53 53
 				</p>
54 54
 
55
-				<?php if ( ! empty( $total ) ) : ?>
55
+				<?php if ( ! empty($total)) : ?>
56 56
 					<p>
57
-						<strong><?php printf( esc_html( 'Step %d of approximately %d running', 'give' ), $step, $steps ); ?></strong>
57
+						<strong><?php printf(esc_html('Step %d of approximately %d running', 'give'), $step, $steps); ?></strong>
58 58
 					</p>
59 59
 				<?php endif; ?>
60 60
 			</div>
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 
69 69
 			<div id="give-upgrade-status">
70 70
 				<p style="font-size: 20px;max-width: 900px;">
71
-					<?php esc_html_e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' ); ?>
72
-					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style="  position: relative; top: 3px; left: 6px;" />
71
+					<?php esc_html_e('The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give'); ?>
72
+					<img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style="  position: relative; top: 3px; left: 6px;" />
73 73
 				</p>
74 74
 			</div>
75 75
 			<script type="text/javascript">
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,11 +64,14 @@
 block discarded – undo
64 64
 				}, 250 );
65 65
 			</script>
66 66
 
67
-		<?php else : ?>
67
+		<?php else {
68
+	: ?>
68 69
 
69 70
 			<div id="give-upgrade-status">
70 71
 				<p style="font-size: 20px;max-width: 900px;">
71
-					<?php esc_html_e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' ); ?>
72
+					<?php esc_html_e( 'The upgrade process has started, please be patient and do not close this window or navigate away from this page. This could take several minutes depending on the upgrade and the size of your website. You will be automatically redirected when the upgrade is finished.', 'give' );
73
+}
74
+?>
72 75
 					<img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/spinner.gif'; ?>" id="give-upgrade-loader" style="  position: relative; top: 3px; left: 6px;" />
73 76
 				</p>
74 77
 			</div>
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-register.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.3.0
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) or exit;
12
+defined('ABSPATH') or exit;
13 13
 
14 14
 class Give_Shortcode_Register extends Give_Shortcode_Generator {
15 15
 
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	public function __construct() {
20 20
 
21
-		$this->shortcode['title'] = esc_html( 'Register', 'give' );
22
-		$this->shortcode['label'] = esc_html( 'Register', 'give' );
21
+		$this->shortcode['title'] = esc_html('Register', 'give');
22
+		$this->shortcode['label'] = esc_html('Register', 'give');
23 23
 
24
-		parent::__construct( 'give_register' );
24
+		parent::__construct('give_register');
25 25
 	}
26 26
 
27 27
 	/**
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
 		return array(
35 35
 			array(
36 36
 				'type' => 'container',
37
-				'html' => sprintf( '<p class="no-margin">%s</p>', esc_html( 'Redirect URL (optional):', 'give' ) ),
37
+				'html' => sprintf('<p class="no-margin">%s</p>', esc_html('Redirect URL (optional):', 'give')),
38 38
 			),
39 39
 			array(
40 40
 				'type'     => 'textbox',
41 41
 				'name'     => 'redirect',
42 42
 				'minWidth' => 320,
43
-				'tooltip'  => esc_attr( 'Enter an URL here to redirect to after registering.', 'give' ),
43
+				'tooltip'  => esc_attr('Enter an URL here to redirect to after registering.', 'give'),
44 44
 			),
45 45
 		);
46 46
 	}
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-profile-editor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.3.0
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) or exit;
12
+defined('ABSPATH') or exit;
13 13
 
14 14
 class Give_Shortcode_Profile_Editor extends Give_Shortcode_Generator {
15 15
 
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	public function __construct() {
20 20
 
21
-		$this->shortcode['label'] = esc_html( 'Profile Editor', 'give' );
21
+		$this->shortcode['label'] = esc_html('Profile Editor', 'give');
22 22
 
23
-		parent::__construct( 'give_profile_editor' );
23
+		parent::__construct('give_profile_editor');
24 24
 	}
25 25
 }
26 26
 
Please login to merge, or discard this patch.
includes/admin/shortcodes/shortcode-give-login.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
  * @since       1.3.0
10 10
  */
11 11
 
12
-defined( 'ABSPATH' ) or exit;
12
+defined('ABSPATH') or exit;
13 13
 
14 14
 class Give_Shortcode_Login extends Give_Shortcode_Generator {
15 15
 
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	public function __construct() {
20 20
 
21
-		$this->shortcode['title'] = esc_html( 'Login', 'give' );
22
-		$this->shortcode['label'] = esc_html( 'Login', 'give' );
21
+		$this->shortcode['title'] = esc_html('Login', 'give');
22
+		$this->shortcode['label'] = esc_html('Login', 'give');
23 23
 
24
-		parent::__construct( 'give_login' );
24
+		parent::__construct('give_login');
25 25
 	}
26 26
 
27 27
 	/**
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
 		return array(
35 35
 			array(
36 36
 				'type' => 'container',
37
-				'html' => sprintf( '<p class="no-margin">%s</p>', esc_html( 'Redirect URL (optional):', 'give' ) ),
37
+				'html' => sprintf('<p class="no-margin">%s</p>', esc_html('Redirect URL (optional):', 'give')),
38 38
 			),
39 39
 			array(
40 40
 				'type'     => 'textbox',
41 41
 				'name'     => 'redirect',
42 42
 				'minWidth' => 320,
43
-				'tooltip'  => esc_attr( 'Enter an URL here to redirect to after login.', 'give' ),
43
+				'tooltip'  => esc_attr('Enter an URL here to redirect to after login.', 'give'),
44 44
 			),
45 45
 		);
46 46
 	}
Please login to merge, or discard this patch.