Completed
Pull Request — master (#1749)
by Devin
06:21
created
includes/admin/class-give-settings.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1167,12 +1167,12 @@
 block discarded – undo
1167 1167
  */
1168 1168
 function give_slug_to_title( $string, $filters = array() ){
1169 1169
 
1170
-    foreach( $filters as $filter_item ){
1171
-        $string = str_replace( $filter_item, ' ', $string );
1172
-    }
1170
+	foreach( $filters as $filter_item ){
1171
+		$string = str_replace( $filter_item, ' ', $string );
1172
+	}
1173 1173
 
1174
-    // Return updated string after converting it to title case
1175
-    return ucwords( $string );
1174
+	// Return updated string after converting it to title case
1175
+	return ucwords( $string );
1176 1176
 
1177 1177
 }
1178 1178
 
Please login to merge, or discard this patch.
includes/admin/upgrades/upgrade-functions.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 			give_v187_upgrades();
51 51
 			$did_upgrade = true;
52 52
 
53
-        case version_compare( $give_version, '1.8.8', '<' ) :
53
+		case version_compare( $give_version, '1.8.8', '<' ) :
54 54
 			give_v188_upgrades();
55 55
 			$did_upgrade = true;
56 56
 
@@ -909,19 +909,19 @@  discard block
 block discarded – undo
909 909
 
910 910
 	global $wp_roles;
911 911
 
912
-    // Get the role object.
913
-    $give_worker = get_role( 'give_worker' );
912
+	// Get the role object.
913
+	$give_worker = get_role( 'give_worker' );
914 914
 
915 915
 	// A list of capabilities to add for give workers.
916
-    $caps_to_add = array(
917
-        'edit_posts',
918
-        'edit_pages'
919
-    );
920
-
921
-    foreach ( $caps_to_add as $cap ) {
922
-        // Add the capability.
923
-        $give_worker->add_cap( $cap );
924
-    }
916
+	$caps_to_add = array(
917
+		'edit_posts',
918
+		'edit_pages'
919
+	);
920
+
921
+	foreach ( $caps_to_add as $cap ) {
922
+		// Add the capability.
923
+		$give_worker->add_cap( $cap );
924
+	}
925 925
 
926 926
 }
927 927
 
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-display.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -87,13 +87,13 @@  discard block
 block discarded – undo
87 87
 								'disabled' => __( 'Disabled', 'give' ),
88 88
 							)
89 89
 						),
90
-                        array(
91
-                            'name'  => __( 'Display Settings Docs Link', 'give' ),
92
-                            'id'    => 'display_settings_docs_link',
93
-                            'url'   => esc_url( 'http://docs.givewp.com/form-display-options' ),
94
-                            'title' => __( 'Display Options Settings', 'give' ),
95
-                            'type'  => 'give_docs_link',
96
-                        ),
90
+						array(
91
+							'name'  => __( 'Display Settings Docs Link', 'give' ),
92
+							'id'    => 'display_settings_docs_link',
93
+							'url'   => esc_url( 'http://docs.givewp.com/form-display-options' ),
94
+							'title' => __( 'Display Options Settings', 'give' ),
95
+							'type'  => 'give_docs_link',
96
+						),
97 97
 						array(
98 98
 							'id'   => 'give_title_display_settings_1',
99 99
 							'type' => 'sectionend'
@@ -170,13 +170,13 @@  discard block
 block discarded – undo
170 170
 								'disabled' => __( 'Disabled', 'give' ),
171 171
 							)
172 172
 						),
173
-                        array(
174
-                            'name'  => __( 'Post Types Docs Link', 'give' ),
175
-                            'id'    => 'post_types_settings_docs_link',
176
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-post-types' ),
177
-                            'title' => __( 'Post Types Settings', 'give' ),
178
-                            'type'  => 'give_docs_link',
179
-                        ),
173
+						array(
174
+							'name'  => __( 'Post Types Docs Link', 'give' ),
175
+							'id'    => 'post_types_settings_docs_link',
176
+							'url'   => esc_url( 'http://docs.givewp.com/settings-post-types' ),
177
+							'title' => __( 'Post Types Settings', 'give' ),
178
+							'type'  => 'give_docs_link',
179
+						),
180 180
 						array(
181 181
 							'id'   => 'give_title_display_settings_2',
182 182
 							'type' => 'sectionend'
@@ -212,13 +212,13 @@  discard block
 block discarded – undo
212 212
 								'disabled' => __( 'Disabled', 'give' ),
213 213
 							)
214 214
 						),
215
-                        array(
216
-                            'name'  => __( 'Taxonomies Docs Link', 'give' ),
217
-                            'id'    => 'taxonomies_settings_docs_link',
218
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-taxonomies' ),
219
-                            'title' => __( 'Taxonomies Settings', 'give' ),
220
-                            'type'  => 'give_docs_link',
221
-                        ),
215
+						array(
216
+							'name'  => __( 'Taxonomies Docs Link', 'give' ),
217
+							'id'    => 'taxonomies_settings_docs_link',
218
+							'url'   => esc_url( 'http://docs.givewp.com/settings-taxonomies' ),
219
+							'title' => __( 'Taxonomies Settings', 'give' ),
220
+							'type'  => 'give_docs_link',
221
+						),
222 222
 						array(
223 223
 							'id'   => 'give_title_display_settings_3',
224 224
 							'type' => 'sectionend'
@@ -258,13 +258,13 @@  discard block
 block discarded – undo
258 258
 							'id'   => 'agreement_text',
259 259
 							'type' => 'wysiwyg'
260 260
 						),
261
-                        array(
262
-                            'name'  => __( 'Terms and Conditions Docs Link', 'give' ),
263
-                            'id'    => 'terms_settings_docs_link',
264
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-terms' ),
265
-                            'title' => __( 'Terms and Conditions Settings', 'give' ),
266
-                            'type'  => 'give_docs_link',
267
-                        ),
261
+						array(
262
+							'name'  => __( 'Terms and Conditions Docs Link', 'give' ),
263
+							'id'    => 'terms_settings_docs_link',
264
+							'url'   => esc_url( 'http://docs.givewp.com/settings-terms' ),
265
+							'title' => __( 'Terms and Conditions Settings', 'give' ),
266
+							'type'  => 'give_docs_link',
267
+						),
268 268
 						array(
269 269
 							'id'   => 'give_title_display_settings_4',
270 270
 							'type' => 'sectionend'
Please login to merge, or discard this patch.
includes/class-give-roles.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
 		add_role( 'give_worker', esc_html__( 'Give Worker', 'give' ), array(
90 90
 			'read'         => true,
91 91
 			'edit_posts'   => true,
92
-            'edit_pages'   => true,
92
+			'edit_pages'   => true,
93 93
 			'upload_files' => true,
94 94
 			'delete_posts' => false
95 95
 		) );
Please login to merge, or discard this patch.
includes/api/class-give-api.php 1 patch
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -378,8 +378,8 @@  discard block
 block discarded – undo
378 378
 	}
379 379
 
380 380
 	/**
381
-     * Get user public key.
382
-     *
381
+	 * Get user public key.
382
+	 *
383 383
 	 * @param int $user_id
384 384
 	 *
385 385
 	 * @return mixed|null|string
@@ -403,8 +403,8 @@  discard block
 block discarded – undo
403 403
 	}
404 404
 
405 405
 	/**
406
-     * Get user secret key.
407
-     *
406
+	 * Get user secret key.
407
+	 *
408 408
 	 * @param int $user_id
409 409
 	 *
410 410
 	 * @return mixed|null|string
@@ -567,14 +567,14 @@  discard block
 block discarded – undo
567 567
 
568 568
 			case 'donations' :
569 569
 
570
-                /**
571
-                 *  Call to get recent donations
572
-                 *
573
-                 *  @params text date | today, yesterday or range
574
-                 *  @params date startdate | required when date = range and format to be YYYYMMDD (i.e. 20170524)
575
-                 *  @params date enddate | required when date = range and format to be YYYYMMDD (i.e. 20170524)
576
-                 */
577
-                $data = $this->routes->get_recent_donations( array(
570
+				/**
571
+				 *  Call to get recent donations
572
+				 *
573
+				 *  @params text date | today, yesterday or range
574
+				 *  @params date startdate | required when date = range and format to be YYYYMMDD (i.e. 20170524)
575
+				 *  @params date enddate | required when date = range and format to be YYYYMMDD (i.e. 20170524)
576
+				 */
577
+				$data = $this->routes->get_recent_donations( array(
578 578
 					'date'      => isset( $wp_query->query_vars['date'] ) ? $wp_query->query_vars['date'] : null,
579 579
 					'startdate' => isset( $wp_query->query_vars['startdate'] ) ? $wp_query->query_vars['startdate'] : null,
580 580
 					'enddate'   => isset( $wp_query->query_vars['enddate'] ) ? $wp_query->query_vars['enddate'] : null,
@@ -1364,7 +1364,7 @@  discard block
 block discarded – undo
1364 1364
 	public function get_recent_donations( $args = array() ) {
1365 1365
 		global $wp_query;
1366 1366
 
1367
-        $defaults = array(
1367
+		$defaults = array(
1368 1368
 			'date'      => null,
1369 1369
 			'startdate' => null,
1370 1370
 			'enddate'   => null,
@@ -1372,7 +1372,7 @@  discard block
 block discarded – undo
1372 1372
 
1373 1373
 		$args = wp_parse_args( $args, $defaults );
1374 1374
 
1375
-        $sales = array();
1375
+		$sales = array();
1376 1376
 
1377 1377
 		if ( ! user_can( $this->user_id, 'view_give_reports' ) && ! $this->override ) {
1378 1378
 			return $sales;
@@ -1396,55 +1396,55 @@  discard block
 block discarded – undo
1396 1396
 			$query = give_get_payments( $args );
1397 1397
 		} elseif ( isset( $wp_query->query_vars['date'] ) ) {
1398 1398
 
1399
-            $current_time = current_time( 'timestamp' );
1400
-            $dates = $this->get_dates( $args );
1399
+			$current_time = current_time( 'timestamp' );
1400
+			$dates = $this->get_dates( $args );
1401 1401
 
1402
-            /**
1403
-             *  Switch case for date query argument
1404
-             *
1405
-             *  @since 1.8.8
1406
-             *
1407
-             *  @params text date | today, yesterday or range
1408
-             *  @params date startdate | required when date = range and format to be YYYYMMDD (i.e. 20170524)
1409
-             *  @params date enddate | required when date = range and format to be YYYYMMDD (i.e. 20170524)
1410
-             */
1411
-            switch( $wp_query->query_vars['date'] ){
1402
+			/**
1403
+			 *  Switch case for date query argument
1404
+			 *
1405
+			 *  @since 1.8.8
1406
+			 *
1407
+			 *  @params text date | today, yesterday or range
1408
+			 *  @params date startdate | required when date = range and format to be YYYYMMDD (i.e. 20170524)
1409
+			 *  @params date enddate | required when date = range and format to be YYYYMMDD (i.e. 20170524)
1410
+			 */
1411
+			switch( $wp_query->query_vars['date'] ){
1412 1412
 
1413
-                case 'today':
1413
+				case 'today':
1414 1414
 
1415
-                    // Set and Format Start and End Date to be date of today.
1416
-                    $start_date = $end_date = date( 'Y/m/d', $current_time );
1415
+					// Set and Format Start and End Date to be date of today.
1416
+					$start_date = $end_date = date( 'Y/m/d', $current_time );
1417 1417
 
1418
-                break;
1418
+				break;
1419 1419
 
1420
-                case 'yesterday':
1420
+				case 'yesterday':
1421 1421
 
1422
-                    // Set and Format Start and End Date to be date of yesterday.
1423
-                    $start_date = $end_date = date( 'Y/m', $current_time ) . '/'. ( date( 'd', $current_time ) - 1 );
1422
+					// Set and Format Start and End Date to be date of yesterday.
1423
+					$start_date = $end_date = date( 'Y/m', $current_time ) . '/'. ( date( 'd', $current_time ) - 1 );
1424 1424
 
1425
-                break;
1425
+				break;
1426 1426
 
1427
-                case 'range':
1427
+				case 'range':
1428 1428
 
1429
-                    // Format Start Date and End Date for filtering payment based on date range.
1430
-                    $start_date = $dates['year'] . '/' . $dates['m_start'] . '/' . $dates['day_start'];
1431
-                    $end_date = $dates['year_end'] . '/' . $dates['m_end'] . '/' . $dates['day_end'];
1429
+					// Format Start Date and End Date for filtering payment based on date range.
1430
+					$start_date = $dates['year'] . '/' . $dates['m_start'] . '/' . $dates['day_start'];
1431
+					$end_date = $dates['year_end'] . '/' . $dates['m_end'] . '/' . $dates['day_end'];
1432 1432
 
1433
-                break;
1433
+				break;
1434 1434
 
1435
-            }
1435
+			}
1436 1436
 
1437
-            $args  = array(
1438
-                'fields'     => 'ids',
1439
-                'start_date' => $start_date,
1440
-                'end_date'   => $end_date,
1441
-                'number'     => $this->per_page(),
1442
-                'page'       => $this->get_paged(),
1443
-                'status'     => 'publish',
1444
-            );
1437
+			$args  = array(
1438
+				'fields'     => 'ids',
1439
+				'start_date' => $start_date,
1440
+				'end_date'   => $end_date,
1441
+				'number'     => $this->per_page(),
1442
+				'page'       => $this->get_paged(),
1443
+				'status'     => 'publish',
1444
+			);
1445 1445
 
1446 1446
 			$query = give_get_payments( $args );
1447
-        } else {
1447
+		} else {
1448 1448
 			$args  = array(
1449 1449
 				'fields' => 'ids',
1450 1450
 				'number' => $this->per_page(),
Please login to merge, or discard this patch.
includes/admin/class-api-keys-table.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -254,8 +254,8 @@
 block discarded – undo
254 254
 		$args = array(
255 255
 		  'id' => 'give-api-user-search',
256 256
 		  'name' => 'user_id',
257
-        );
258
-        echo Give()->html->ajax_user_search($args); ?>
257
+		);
258
+		echo Give()->html->ajax_user_search($args); ?>
259 259
 		<?php submit_button( esc_html__( 'Generate New API Keys', 'give' ), 'secondary', 'submit', false ); ?>
260 260
 		<?php
261 261
 		$give_api_is_bottom = true;
Please login to merge, or discard this patch.
includes/admin/tools/export/pdf-reports.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 		)
48 48
 	);
49 49
 
50
-    $categories_enabled = give_is_setting_enabled( give_get_option( 'categories', 'disabled' ) );
51
-    $tags_enabled = give_is_setting_enabled( give_get_option( 'tags', 'disabled' ) );
50
+	$categories_enabled = give_is_setting_enabled( give_get_option( 'categories', 'disabled' ) );
51
+	$tags_enabled = give_is_setting_enabled( give_get_option( 'tags', 'disabled' ) );
52 52
 
53 53
 	$pdf = new give_pdf();
54 54
 	$pdf->AddPage( 'L', 'A4' );
@@ -80,15 +80,15 @@  discard block
 block discarded – undo
80 80
 	$pdf->Cell( 70, 6, utf8_decode( __( 'Form Name', 'give' ) ), 1, 0, 'L', true );
81 81
 	$pdf->Cell( 30, 6, utf8_decode( __( 'Price', 'give' ) ), 1, 0, 'L', true );
82 82
 
83
-    // Display Categories Heading only, if user has opted for it.
84
-    if ( $categories_enabled ) {
83
+	// Display Categories Heading only, if user has opted for it.
84
+	if ( $categories_enabled ) {
85 85
 	   $pdf->Cell( 45, 6, utf8_decode( __( 'Categories', 'give' ) ), 1, 0, 'L', true );
86
-    }
86
+	}
87 87
 
88
-    // Display Tags Heading only, if user has opted for it.
89
-    if ( $tags_enabled ) {
88
+	// Display Tags Heading only, if user has opted for it.
89
+	if ( $tags_enabled ) {
90 90
 	   $pdf->Cell( 45, 6, utf8_decode( __( 'Tags', 'give' ) ), 1, 0, 'L', true );
91
-    }
91
+	}
92 92
 
93 93
 	$pdf->Cell( 45, 6, utf8_decode( __( 'Number of Donations', 'give' ) ), 1, 0, 'L', true );
94 94
 	$pdf->Cell( 45, 6, utf8_decode( __( 'Income to Date', 'give' ) ), 1, 1, 'L', true );
@@ -125,17 +125,17 @@  discard block
 block discarded – undo
125 125
 				$price = give_currency_filter( give_get_form_price( $form->ID ), '', true );
126 126
 			}
127 127
 
128
-            // Display Categories Data only, if user has opted for it.
129
-            if ( $categories_enabled ) {
130
-                $categories = get_the_term_list( $form->ID, 'give_forms_category', '', ', ', '' );
131
-                $categories = ! is_wp_error( $categories ) ? strip_tags( $categories ) : '';
132
-            }
128
+			// Display Categories Data only, if user has opted for it.
129
+			if ( $categories_enabled ) {
130
+				$categories = get_the_term_list( $form->ID, 'give_forms_category', '', ', ', '' );
131
+				$categories = ! is_wp_error( $categories ) ? strip_tags( $categories ) : '';
132
+			}
133 133
 
134
-            // Display Tags Data only, if user has opted for it.
135
-            if ( $tags_enabled ) {
136
-                $tags = get_the_term_list( $form->ID, 'give_forms_tag', '', ', ', '' );
137
-                $tags = ! is_wp_error( $tags ) ? strip_tags( $tags ) : '';
138
-            }
134
+			// Display Tags Data only, if user has opted for it.
135
+			if ( $tags_enabled ) {
136
+				$tags = get_the_term_list( $form->ID, 'give_forms_tag', '', ', ', '' );
137
+				$tags = ! is_wp_error( $tags ) ? strip_tags( $tags ) : '';
138
+			}
139 139
 
140 140
 			$sales    = give_get_form_sales_stats( $form->ID );
141 141
 			$link     = get_permalink( $form->ID );
@@ -147,38 +147,38 @@  discard block
 block discarded – undo
147 147
 				$earnings = iconv( 'UTF-8', 'windows-1252', utf8_encode( $earnings ) );
148 148
 			}
149 149
 
150
-            // This will help filter data before appending it to PDF Receipt.
151
-            $prepare_pdf_data = array();
152
-            $prepare_pdf_data[] = $title;
153
-            $prepare_pdf_data[] = $price;
150
+			// This will help filter data before appending it to PDF Receipt.
151
+			$prepare_pdf_data = array();
152
+			$prepare_pdf_data[] = $title;
153
+			$prepare_pdf_data[] = $price;
154 154
 
155
-            // Append Categories Data only, if user has opted for it.
156
-            if ( $categories_enabled ) {
157
-                $prepare_pdf_data[] = $categories;
158
-            }
155
+			// Append Categories Data only, if user has opted for it.
156
+			if ( $categories_enabled ) {
157
+				$prepare_pdf_data[] = $categories;
158
+			}
159 159
 
160
-            // Append Tags Data only, if user has opted for it.
161
-            if ( $tags_enabled ) {
162
-                $prepare_pdf_data[] = $tags;
163
-            }
160
+			// Append Tags Data only, if user has opted for it.
161
+			if ( $tags_enabled ) {
162
+				$prepare_pdf_data[] = $tags;
163
+			}
164 164
 
165
-            $prepare_pdf_data[] = $sales;
166
-            $prepare_pdf_data[] = $earnings;
165
+			$prepare_pdf_data[] = $sales;
166
+			$prepare_pdf_data[] = $earnings;
167 167
 
168 168
 			$pdf->Row( $prepare_pdf_data );
169 169
 		endforeach;
170 170
 	} else {
171 171
 
172
-        // Fix: Minor Styling Alignment Issue for PDF
173
-        if( $categories_enabled && $tags_enabled ) {
174
-            $pdf->SetWidths( array( 280 ) );
175
-        } elseif( $categories_enabled || $tags_enabled ) {
176
-            $pdf->SetWidths( array( 235 ) );
177
-        } else {
178
-            $pdf->SetWidths( array( 190 ) );
179
-        }
172
+		// Fix: Minor Styling Alignment Issue for PDF
173
+		if( $categories_enabled && $tags_enabled ) {
174
+			$pdf->SetWidths( array( 280 ) );
175
+		} elseif( $categories_enabled || $tags_enabled ) {
176
+			$pdf->SetWidths( array( 235 ) );
177
+		} else {
178
+			$pdf->SetWidths( array( 190 ) );
179
+		}
180 180
 
181
-        $title = utf8_decode( __( 'No forms found.', 'give' ) );
181
+		$title = utf8_decode( __( 'No forms found.', 'give' ) );
182 182
 		$pdf->Row( array( $title ) );
183 183
 	}
184 184
 
Please login to merge, or discard this patch.
includes/admin/admin-actions.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -158,20 +158,20 @@
 block discarded – undo
158 158
 
159 159
 	$current_user = wp_get_current_user();
160 160
 
161
-    // Get notice id.
162
-    $notice_id = sanitize_text_field( $_POST['_give_hide_license_notices_shortly'] );
161
+	// Get notice id.
162
+	$notice_id = sanitize_text_field( $_POST['_give_hide_license_notices_shortly'] );
163 163
 
164
-    // Transient key name.
165
-    $transient_key = "_give_hide_license_notices_shortly_{$current_user->ID}_{$notice_id}";
164
+	// Transient key name.
165
+	$transient_key = "_give_hide_license_notices_shortly_{$current_user->ID}_{$notice_id}";
166 166
 
167
-    if ( Give_Cache::get( $transient_key, true ) ) {
168
-        return;
169
-    }
167
+	if ( Give_Cache::get( $transient_key, true ) ) {
168
+		return;
169
+	}
170 170
 
171
-    // Hide notice for 24 hours.
172
-    Give_Cache::set( $transient_key, true, DAY_IN_SECONDS, true );
171
+	// Hide notice for 24 hours.
172
+	Give_Cache::set( $transient_key, true, DAY_IN_SECONDS, true );
173 173
 
174
-    die();
174
+	die();
175 175
 
176 176
 }
177 177
 
Please login to merge, or discard this patch.
includes/admin/customers/customer-actions.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
 
50 50
 	$donor = new Give_Customer( $donor_id );
51 51
 
52
-    if ( empty( $donor->id ) ) {
52
+	if ( empty( $donor->id ) ) {
53 53
 		return false;
54 54
 	}
55 55
 
Please login to merge, or discard this patch.