Test Setup Failed
Pull Request — master (#2014)
by Rami
05:17
created
includes/gateways/actions.php 1 patch
Spacing   +13 added lines, -13 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,14 +21,14 @@  discard block
 block discarded – undo
21 21
  *
22 22
  * @param $data
23 23
  */
24
-function give_process_gateway_select( $data ) {
25
-	if ( isset( $_POST['gateway_submit'] ) ) {
26
-		wp_redirect( esc_url( add_query_arg( 'payment-mode', $_POST['payment-mode'] ) ) );
24
+function give_process_gateway_select($data) {
25
+	if (isset($_POST['gateway_submit'])) {
26
+		wp_redirect(esc_url(add_query_arg('payment-mode', $_POST['payment-mode'])));
27 27
 		exit;
28 28
 	}
29 29
 }
30 30
 
31
-add_action( 'give_gateway_select', 'give_process_gateway_select' );
31
+add_action('give_gateway_select', 'give_process_gateway_select');
32 32
 
33 33
 /**
34 34
  * Loads a payment gateway via AJAX.
@@ -38,20 +38,20 @@  discard block
 block discarded – undo
38 38
  * @return void
39 39
  */
40 40
 function give_load_ajax_gateway() {
41
-	if ( isset( $_POST['give_payment_mode'] ) ) {
41
+	if (isset($_POST['give_payment_mode'])) {
42 42
 		/**
43 43
 		 * Fire to render donation form.
44 44
 		 *
45 45
 		 * @since 1.7
46 46
 		 */
47
-		do_action( 'give_donation_form', $_POST['give_form_id'] );
47
+		do_action('give_donation_form', $_POST['give_form_id']);
48 48
 
49 49
 		exit();
50 50
 	}
51 51
 }
52 52
 
53
-add_action( 'wp_ajax_give_load_gateway', 'give_load_ajax_gateway' );
54
-add_action( 'wp_ajax_nopriv_give_load_gateway', 'give_load_ajax_gateway' );
53
+add_action('wp_ajax_give_load_gateway', 'give_load_ajax_gateway');
54
+add_action('wp_ajax_nopriv_give_load_gateway', 'give_load_ajax_gateway');
55 55
 
56 56
 /**
57 57
  * Sets an error within the donation form if no gateways are enabled.
@@ -63,11 +63,11 @@  discard block
 block discarded – undo
63 63
 function give_no_gateway_error() {
64 64
 	$gateways = give_get_enabled_payment_gateways();
65 65
 
66
-	if ( empty( $gateways ) ) {
67
-		give_set_error( 'no_gateways', esc_html__( 'You must enable a payment gateway to use Give.', 'give' ) );
66
+	if (empty($gateways)) {
67
+		give_set_error('no_gateways', esc_html__('You must enable a payment gateway to use Give.', 'give'));
68 68
 	} else {
69
-		give_unset_error( 'no_gateways' );
69
+		give_unset_error('no_gateways');
70 70
 	}
71 71
 }
72 72
 
73
-add_action( 'init', 'give_no_gateway_error' );
73
+add_action('init', 'give_no_gateway_error');
Please login to merge, or discard this patch.
includes/admin/abstract-admin-settings-page.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Page' ) ) :
16
+if ( ! class_exists('Give_Settings_Page')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Page.
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 			// Get current setting page.
63 63
 			$this->current_setting_page = give_get_current_setting_page();
64 64
 
65
-			add_filter( "give_default_setting_tab_section_{$this->id}", array( $this, 'set_default_setting_tab' ), 10 );
66
-			add_filter( "{$this->current_setting_page}_tabs_array", array( $this, 'add_settings_page' ), 20 );
67
-			add_action( "{$this->current_setting_page}_sections_{$this->id}_page", array( $this, 'output_sections' ) );
68
-			add_action( "{$this->current_setting_page}_settings_{$this->id}_page", array( $this, 'output' ) );
69
-			add_action( "{$this->current_setting_page}_save_{$this->id}", array( $this, 'save' ) );
65
+			add_filter("give_default_setting_tab_section_{$this->id}", array($this, 'set_default_setting_tab'), 10);
66
+			add_filter("{$this->current_setting_page}_tabs_array", array($this, 'add_settings_page'), 20);
67
+			add_action("{$this->current_setting_page}_sections_{$this->id}_page", array($this, 'output_sections'));
68
+			add_action("{$this->current_setting_page}_settings_{$this->id}_page", array($this, 'output'));
69
+			add_action("{$this->current_setting_page}_save_{$this->id}", array($this, 'save'));
70 70
 		}
71 71
 
72 72
 		/**
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 		 *
79 79
 		 * @return string
80 80
 		 */
81
-		function set_default_setting_tab( $setting_tab ) {
81
+		function set_default_setting_tab($setting_tab) {
82 82
 			return $this->default_tab;
83 83
 		}
84 84
 
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
 		 *
92 92
 		 * @return array
93 93
 		 */
94
-		public function add_settings_page( $pages ) {
95
-			$pages[ $this->id ] = $this->label;
94
+		public function add_settings_page($pages) {
95
+			$pages[$this->id] = $this->label;
96 96
 
97 97
 			return $pages;
98 98
 		}
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 			 *
112 112
 			 * @param  array $settings
113 113
 			 */
114
-			$settings = apply_filters( 'give_get_settings_' . $this->id, array() );
114
+			$settings = apply_filters('give_get_settings_'.$this->id, array());
115 115
 
116 116
 			// Output.
117 117
 			return $settings;
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 		 * @return array
125 125
 		 */
126 126
 		public function get_sections() {
127
-			return apply_filters( 'give_get_sections_' . $this->id, array() );
127
+			return apply_filters('give_get_sections_'.$this->id, array());
128 128
 		}
129 129
 
130 130
 		/**
@@ -141,29 +141,29 @@  discard block
 block discarded – undo
141 141
 			$sections = $this->get_sections();
142 142
 
143 143
 			// Show section settings only if setting section exist.
144
-			if ( $current_section && ! in_array( $current_section, array_keys( $sections ) ) ) {
145
-				echo '<div class="error"><p>' . __( 'Oops, this settings page does not exist.', 'give' ) . '</p></div>';
144
+			if ($current_section && ! in_array($current_section, array_keys($sections))) {
145
+				echo '<div class="error"><p>'.__('Oops, this settings page does not exist.', 'give').'</p></div>';
146 146
 				$GLOBALS['give_hide_save_button'] = true;
147 147
 
148 148
 				return;
149 149
 			}
150 150
 
151 151
 			// Bailout.
152
-			if ( empty( $sections ) ) {
152
+			if (empty($sections)) {
153 153
 				return;
154 154
 			}
155 155
 
156
-			if ( is_null( $this->current_setting_page ) ) {
156
+			if (is_null($this->current_setting_page)) {
157 157
 				$this->current_setting_page = give_get_current_setting_page();
158 158
 			}
159 159
 
160 160
 			echo '<ul class="subsubsub">';
161 161
 
162 162
 			// Get section keys.
163
-			$array_keys = array_keys( $sections );
163
+			$array_keys = array_keys($sections);
164 164
 
165
-			foreach ( $sections as $id => $label ) {
166
-				echo '<li><a href="' . admin_url( 'edit.php?post_type=give_forms&page=' . $this->current_setting_page . '&tab=' . $this->id . '&section=' . sanitize_title( $id ) ) . '" class="' . ( $current_section == $id ? 'current' : '' ) . '">' . $label . '</a> ' . ( end( $array_keys ) == $id ? '' : '|' ) . ' </li>';
165
+			foreach ($sections as $id => $label) {
166
+				echo '<li><a href="'.admin_url('edit.php?post_type=give_forms&page='.$this->current_setting_page.'&tab='.$this->id.'&section='.sanitize_title($id)).'" class="'.($current_section == $id ? 'current' : '').'">'.$label.'</a> '.(end($array_keys) == $id ? '' : '|').' </li>';
167 167
 			}
168 168
 
169 169
 			echo '</ul><br class="clear" /><hr>';
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 		public function output() {
179 179
 			$settings = $this->get_settings();
180 180
 
181
-			Give_Admin_Settings::output_fields( $settings, 'give_settings' );
181
+			Give_Admin_Settings::output_fields($settings, 'give_settings');
182 182
 		}
183 183
 
184 184
 		/**
@@ -191,14 +191,14 @@  discard block
 block discarded – undo
191 191
 			$settings        = $this->get_settings();
192 192
 			$current_section = give_get_current_setting_section();
193 193
 
194
-			Give_Admin_Settings::save_fields( $settings, 'give_settings' );
194
+			Give_Admin_Settings::save_fields($settings, 'give_settings');
195 195
 
196 196
 			/**
197 197
 			 * Trigger Action
198 198
 			 *
199 199
 			 * @since 1.8
200 200
 			 */
201
-			do_action( 'give_update_options_' . $this->id . '_' . $current_section );
201
+			do_action('give_update_options_'.$this->id.'_'.$current_section);
202 202
 		}
203 203
 	}
204 204
 
Please login to merge, or discard this patch.
includes/admin/views/html-admin-settings.php 2 patches
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -2,13 +2,13 @@  discard block
 block discarded – undo
2 2
 /**
3 3
  * Admin View: Settings
4 4
  */
5
-if ( ! defined( 'ABSPATH' ) ) {
5
+if ( ! defined('ABSPATH')) {
6 6
 	exit;
7 7
 }
8 8
 
9 9
 
10 10
 // Bailout: Do not output anything if setting tab is not defined.
11
-if( ! empty( $tabs ) && array_key_exists( give_get_current_setting_tab(), $tabs ) ) :
11
+if ( ! empty($tabs) && array_key_exists(give_get_current_setting_tab(), $tabs)) :
12 12
 	/**
13 13
 	 * Filter the form action.
14 14
 	 *
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 *
19 19
 	 * @since 1.8
20 20
 	 */
21
-	$form_method    = apply_filters( self::$setting_filter_prefix . '_form_method_tab_' . $current_tab, 'post' );
21
+	$form_method = apply_filters(self::$setting_filter_prefix.'_form_method_tab_'.$current_tab, 'post');
22 22
 
23 23
 	/**
24 24
 	 * Filter the main form tab.
@@ -30,15 +30,15 @@  discard block
 block discarded – undo
30 30
 	 *
31 31
 	 * @since 1.8
32 32
 	 */
33
-	$form_open_tag  = apply_filters( self::$setting_filter_prefix . '_open_form', '<form method="' . $form_method  . '" id="give-mainform" action="" enctype="multipart/form-data">' );
34
-	$form_close_tag = apply_filters( self::$setting_filter_prefix . '_close_form', '</form>' );
33
+	$form_open_tag  = apply_filters(self::$setting_filter_prefix.'_open_form', '<form method="'.$form_method.'" id="give-mainform" action="" enctype="multipart/form-data">');
34
+	$form_close_tag = apply_filters(self::$setting_filter_prefix.'_close_form', '</form>');
35 35
 	?>
36
-	<div class="wrap give-settings-page <?php echo self::$setting_filter_prefix . '-setting-page'; ?>">
36
+	<div class="wrap give-settings-page <?php echo self::$setting_filter_prefix.'-setting-page'; ?>">
37 37
 		<?php echo $form_open_tag; ?>
38 38
 			<h2 class="nav-tab-wrapper give-nav-tab-wrapper">
39 39
 				<?php
40
-				foreach ( $tabs as $name => $label ) {
41
-					echo '<a href="' . admin_url( "edit.php?post_type=give_forms&page=" . self::$setting_filter_prefix . "&tab={$name}" ) . '" class="nav-tab ' . ( $current_tab == $name ? 'nav-tab-active' : '' ) . '">' . $label . '</a>';
40
+				foreach ($tabs as $name => $label) {
41
+					echo '<a href="'.admin_url("edit.php?post_type=give_forms&page=".self::$setting_filter_prefix."&tab={$name}").'" class="nav-tab '.($current_tab == $name ? 'nav-tab-active' : '').'">'.$label.'</a>';
42 42
 				}
43 43
 
44 44
 				/**
@@ -50,14 +50,14 @@  discard block
 block discarded – undo
50 50
 				 *
51 51
 				 * @since 1.8
52 52
 				 */
53
-				do_action( self::$setting_filter_prefix . '_tabs' );
53
+				do_action(self::$setting_filter_prefix.'_tabs');
54 54
 				?>
55 55
 			</h2>
56 56
 			<div class="give-sub-nav-tab-wrapper">
57
-				<a href="#" id="give-show-sub-nav" class="nav-tab give-not-tab" title="<?php _e( 'View remaining setting tabs', 'give' ); ?>"><span class="dashicons dashicons-arrow-down-alt2"></span></span></a>
57
+				<a href="#" id="give-show-sub-nav" class="nav-tab give-not-tab" title="<?php _e('View remaining setting tabs', 'give'); ?>"><span class="dashicons dashicons-arrow-down-alt2"></span></span></a>
58 58
 				<nav class="give-sub-nav-tab give-hidden"></nav>
59 59
 			</div>
60
-			<h1 class="screen-reader-text"><?php echo esc_html( $tabs[ $current_tab ] ); ?></h1>
60
+			<h1 class="screen-reader-text"><?php echo esc_html($tabs[$current_tab]); ?></h1>
61 61
 			<?php
62 62
 
63 63
 			/**
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 			 *
70 70
 			 * @since 1.8
71 71
 			 */
72
-			do_action( self::$setting_filter_prefix . "_sections_{$current_tab}_page" );
72
+			do_action(self::$setting_filter_prefix."_sections_{$current_tab}_page");
73 73
 
74 74
 			
75 75
 			// Show messages.
@@ -85,15 +85,15 @@  discard block
 block discarded – undo
85 85
 			 *
86 86
 			 * @since 1.8
87 87
 			 */
88
-			do_action( self::$setting_filter_prefix . "_settings_{$current_tab}_page" );
88
+			do_action(self::$setting_filter_prefix."_settings_{$current_tab}_page");
89 89
 
90
-			if ( empty( $GLOBALS['give_hide_save_button'] ) ) : ?>
90
+			if (empty($GLOBALS['give_hide_save_button'])) : ?>
91 91
 				<div class="give-submit-wrap">
92
-					<?php wp_nonce_field( 'give-save-settings', '_give-save-settings' ); ?>
93
-					<input name="save" class="button-primary give-save-button" type="submit" value="<?php esc_attr_e( 'Save changes', 'give' ); ?>" />
92
+					<?php wp_nonce_field('give-save-settings', '_give-save-settings'); ?>
93
+					<input name="save" class="button-primary give-save-button" type="submit" value="<?php esc_attr_e('Save changes', 'give'); ?>" />
94 94
 				</div>
95 95
 			<?php endif; ?>
96 96
 		<?php echo $form_close_tag; ?>
97 97
 	</div>
98
-	<?php else : echo '<div class="error"><p>' . __( 'Oops, this settings page does not exist.', 'give' ) . '</p></div>'; ?>
98
+	<?php else : echo '<div class="error"><p>'.__('Oops, this settings page does not exist.', 'give').'</p></div>'; ?>
99 99
 <?php endif; ?>
100 100
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,5 +95,8 @@
 block discarded – undo
95 95
 			<?php endif; ?>
96 96
 		<?php echo $form_close_tag; ?>
97 97
 	</div>
98
-	<?php else : echo '<div class="error"><p>' . __( 'Oops, this settings page does not exist.', 'give' ) . '</p></div>'; ?>
98
+	<?php else {
99
+	: echo '<div class="error"><p>' . __( 'Oops, this settings page does not exist.', 'give' ) . '</p></div>';
100
+}
101
+?>
99 102
 <?php endif; ?>
100 103
\ No newline at end of file
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-advanced.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -87,13 +87,13 @@
 block discarded – undo
87 87
 								'disabled' => __( 'Head', 'give' ),
88 88
 							)
89 89
 						),
90
-                        array(
91
-                            'name'  => esc_html__( 'Advanced Settings Docs Link', 'give' ),
92
-                            'id'    => 'advanced_settings_docs_link',
93
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-advanced' ),
94
-                            'title' => __( 'Advanced Settings', 'give' ),
95
-                            'type'  => 'give_docs_link',
96
-                        ),
90
+						array(
91
+							'name'  => esc_html__( 'Advanced Settings Docs Link', 'give' ),
92
+							'id'    => 'advanced_settings_docs_link',
93
+							'url'   => esc_url( 'http://docs.givewp.com/settings-advanced' ),
94
+							'title' => __( 'Advanced Settings', 'give' ),
95
+							'type'  => 'give_docs_link',
96
+						),
97 97
 						array(
98 98
 							'id'   => 'give_title_data_control_2',
99 99
 							'type' => 'sectionend'
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Advanced' ) ) :
16
+if ( ! class_exists('Give_Settings_Advanced')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Advanced.
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		 */
28 28
 		public function __construct() {
29 29
 			$this->id    = 'advanced';
30
-			$this->label = esc_html__( 'Advanced', 'give' );
30
+			$this->label = esc_html__('Advanced', 'give');
31 31
 
32 32
 			$this->default_tab = 'advanced-options';
33 33
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
 			$current_section = give_get_current_setting_section();
47 47
 
48
-			switch ( $current_section ) {
48
+			switch ($current_section) {
49 49
 				case 'advanced-options':
50 50
 					$settings = array(
51 51
 						array(
@@ -53,45 +53,45 @@  discard block
 block discarded – undo
53 53
 							'type' => 'title'
54 54
 						),
55 55
 						array(
56
-							'name'    => esc_html__( 'Remove Data on Uninstall', 'give' ),
57
-							'desc'    => esc_html__( 'When the plugin is deleted, completely remove all Give data. This includes all Give settings, forms, form meta, donor, donor data, donations. Everything.', 'give' ),
56
+							'name'    => esc_html__('Remove Data on Uninstall', 'give'),
57
+							'desc'    => esc_html__('When the plugin is deleted, completely remove all Give data. This includes all Give settings, forms, form meta, donor, donor data, donations. Everything.', 'give'),
58 58
 							'id'      => 'uninstall_on_delete',
59 59
 							'type'    => 'radio_inline',
60 60
 							'default' => 'disabled',
61 61
 							'options' => array(
62
-								'enabled'  => __( 'Yes, Remove all data', 'give' ),
63
-								'disabled' => __( 'No, keep my Give settings and donation data', 'give' ),
62
+								'enabled'  => __('Yes, Remove all data', 'give'),
63
+								'disabled' => __('No, keep my Give settings and donation data', 'give'),
64 64
 							)
65 65
 						),
66 66
 						array(
67 67
 							/* translators: %s: the_content */
68
-							'name'    => sprintf( __( '%s filter', 'give' ), '<code>the_content</code>' ),
68
+							'name'    => sprintf(__('%s filter', 'give'), '<code>the_content</code>'),
69 69
 							/* translators: 1: https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content 2: the_content */
70
-							'desc'    => sprintf( __( 'If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give' ), esc_url( 'https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content' ), '<code>the_content</code>' ),
70
+							'desc'    => sprintf(__('If you are seeing extra social buttons, related posts, or other unwanted elements appearing within your forms then you can disable WordPress\' content filter. <a href="%1$s" target="_blank">Learn more</a> about %2$s filter.', 'give'), esc_url('https://codex.wordpress.org/Plugin_API/Filter_Reference/the_content'), '<code>the_content</code>'),
71 71
 							'id'      => 'the_content_filter',
72 72
 							'default' => 'enabled',
73 73
 							'type'    => 'radio_inline',
74 74
 							'options' => array(
75
-								'enabled'  => __( 'Enabled', 'give' ),
76
-								'disabled' => __( 'Disabled', 'give' ),
75
+								'enabled'  => __('Enabled', 'give'),
76
+								'disabled' => __('Disabled', 'give'),
77 77
 							)
78 78
 						),
79 79
 						array(
80
-							'name'    => esc_html__( 'Script Loading Location', 'give' ),
81
-							'desc'    => __( 'This allows you to load your Give scripts either in the <code>&lt;head&gt;</code> or footer of your website.', 'give' ),
80
+							'name'    => esc_html__('Script Loading Location', 'give'),
81
+							'desc'    => __('This allows you to load your Give scripts either in the <code>&lt;head&gt;</code> or footer of your website.', 'give'),
82 82
 							'id'      => 'scripts_footer',
83 83
 							'type'    => 'radio_inline',
84 84
 							'default' => 'disabled',
85 85
 							'options' => array(
86
-								'enabled'  => __( 'Footer', 'give' ),
87
-								'disabled' => __( 'Head', 'give' ),
86
+								'enabled'  => __('Footer', 'give'),
87
+								'disabled' => __('Head', 'give'),
88 88
 							)
89 89
 						),
90 90
                         array(
91
-                            'name'  => esc_html__( 'Advanced Settings Docs Link', 'give' ),
91
+                            'name'  => esc_html__('Advanced Settings Docs Link', 'give'),
92 92
                             'id'    => 'advanced_settings_docs_link',
93
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-advanced' ),
94
-                            'title' => __( 'Advanced Settings', 'give' ),
93
+                            'url'   => esc_url('http://docs.givewp.com/settings-advanced'),
94
+                            'title' => __('Advanced Settings', 'give'),
95 95
                             'type'  => 'give_docs_link',
96 96
                         ),
97 97
 						array(
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 			 * Filter the advanced settings.
108 108
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
109 109
 			 */
110
-			$settings = apply_filters( 'give_settings_advanced', $settings );
110
+			$settings = apply_filters('give_settings_advanced', $settings);
111 111
 
112 112
 			/**
113 113
 			 * Filter the settings.
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 			 *
117 117
 			 * @param  array $settings
118 118
 			 */
119
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
119
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
120 120
 
121 121
 			// Output.
122 122
 			return $settings;
@@ -130,10 +130,10 @@  discard block
 block discarded – undo
130 130
 		 */
131 131
 		public function get_sections() {
132 132
 			$sections = array(
133
-				'advanced-options' => esc_html__( 'Advanced Options', 'give' )
133
+				'advanced-options' => esc_html__('Advanced Options', 'give')
134 134
 			);
135 135
 
136
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
136
+			return apply_filters('give_get_sections_'.$this->id, $sections);
137 137
 		}
138 138
 	}
139 139
 
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-general.php 2 patches
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_General' ) ) :
16
+if ( ! class_exists('Give_Settings_General')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_General.
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		 */
28 28
 		public function __construct() {
29 29
 			$this->id    = 'general';
30
-			$this->label = esc_html__( 'General', 'give' );
30
+			$this->label = esc_html__('General', 'give');
31 31
 
32 32
 			$this->default_tab = 'general-settings';
33 33
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			$settings        = array();
45 45
 			$current_section = give_get_current_setting_section();
46 46
 
47
-			switch ( $current_section ) {
47
+			switch ($current_section) {
48 48
 				case 'access-control':
49 49
 					$settings = array(
50 50
 						// Section 3: Access control.
@@ -54,47 +54,47 @@  discard block
 block discarded – undo
54 54
 						),
55 55
 						array(
56 56
 							'id'      => 'session_lifetime',
57
-							'name'    => esc_html__( 'Session Lifetime', 'give' ),
58
-							'desc'    => esc_html__( 'The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give' ),
57
+							'name'    => esc_html__('Session Lifetime', 'give'),
58
+							'desc'    => esc_html__('The length of time a user\'s session is kept alive. Give starts a new session per user upon donation. Sessions allow donors to view their donation receipts without being logged in.', 'give'),
59 59
 							'type'    => 'select',
60 60
 							'options' => array(
61
-								'86400'  => esc_html__( '24 Hours', 'give' ),
62
-								'172800' => esc_html__( '48 Hours', 'give' ),
63
-								'259200' => esc_html__( '72 Hours', 'give' ),
64
-								'604800' => esc_html__( '1 Week', 'give' ),
61
+								'86400'  => esc_html__('24 Hours', 'give'),
62
+								'172800' => esc_html__('48 Hours', 'give'),
63
+								'259200' => esc_html__('72 Hours', 'give'),
64
+								'604800' => esc_html__('1 Week', 'give'),
65 65
 							)
66 66
 						),
67 67
 						array(
68
-							'name'    => esc_html__( 'Email Access', 'give' ),
69
-							'desc'    => esc_html__( 'Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give' ),
68
+							'name'    => esc_html__('Email Access', 'give'),
69
+							'desc'    => esc_html__('Would you like your donors to be able to access their donation history using only email? Donors whose sessions have expired and do not have an account may still access their donation history via a temporary email access link.', 'give'),
70 70
 							'id'      => 'email_access',
71 71
 							'type'    => 'radio_inline',
72 72
 							'default' => 'disabled',
73 73
 							'options' => array(
74
-								'enabled'  => __( 'Enabled', 'give' ),
75
-								'disabled' => __( 'Disabled', 'give' ),
74
+								'enabled'  => __('Enabled', 'give'),
75
+								'disabled' => __('Disabled', 'give'),
76 76
 							)
77 77
 						),
78 78
 						array(
79 79
 							'id'      => 'recaptcha_key',
80
-							'name'    => esc_html__( 'reCAPTCHA Site Key', 'give' ),
80
+							'name'    => esc_html__('reCAPTCHA Site Key', 'give'),
81 81
 							/* translators: %s: https://www.google.com/recaptcha/ */
82
-							'desc'    => sprintf( __( 'Please paste your reCAPTCHA site key here. <br />If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give' ), esc_url( 'http://docs.givewp.com/recaptcha' ) ),
82
+							'desc'    => sprintf(__('Please paste your reCAPTCHA site key here. <br />If you would like to prevent spam on the email access form navigate to <a href="%s" target="_blank">the reCAPTCHA website</a> and sign up for an API key. The reCAPTCHA uses Google\'s user-friendly single click verification method.', 'give'), esc_url('http://docs.givewp.com/recaptcha')),
83 83
 							'default' => '',
84 84
 							'type'    => 'text'
85 85
 						),
86 86
 						array(
87 87
 							'id'      => 'recaptcha_secret',
88
-							'name'    => esc_html__( 'reCAPTCHA Secret Key', 'give' ),
89
-							'desc'    => esc_html__( 'Please paste the reCAPTCHA secret key here from your  reCAPTCHA API Keys panel.', 'give' ),
88
+							'name'    => esc_html__('reCAPTCHA Secret Key', 'give'),
89
+							'desc'    => esc_html__('Please paste the reCAPTCHA secret key here from your  reCAPTCHA API Keys panel.', 'give'),
90 90
 							'default' => '',
91 91
 							'type'    => 'text'
92 92
 						),
93 93
                         array(
94
-                            'name'  => esc_html__( 'Access Control Docs Link', 'give' ),
94
+                            'name'  => esc_html__('Access Control Docs Link', 'give'),
95 95
                             'id'    => 'access_control_docs_link',
96
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-access-control' ),
97
-                            'title' => __( 'Access Control', 'give' ),
96
+                            'url'   => esc_url('http://docs.givewp.com/settings-access-control'),
97
+                            'title' => __('Access Control', 'give'),
98 98
                             'type'  => 'give_docs_link',
99 99
                         ),
100 100
 						array(
@@ -112,61 +112,61 @@  discard block
 block discarded – undo
112 112
 							'id'   => 'give_title_general_settings_2'
113 113
 						),
114 114
 						array(
115
-							'name' => esc_html__( 'Currency Settings', 'give' ),
115
+							'name' => esc_html__('Currency Settings', 'give'),
116 116
 							'desc' => '',
117 117
 							'type' => 'give_title',
118 118
 							'id'   => 'give_title_general_settings_2'
119 119
 						),
120 120
 						array(
121
-							'name'    => esc_html__( 'Currency', 'give' ),
122
-							'desc'    => esc_html__( 'The donation currency. Note that some payment gateways have currency restrictions.', 'give' ),
121
+							'name'    => esc_html__('Currency', 'give'),
122
+							'desc'    => esc_html__('The donation currency. Note that some payment gateways have currency restrictions.', 'give'),
123 123
 							'id'      => 'currency',
124 124
 							'type'    => 'select',
125 125
 							'options' => give_get_currencies(),
126 126
 							'default' => 'USD',
127 127
 						),
128 128
 						array(
129
-							'name'    => esc_html__( 'Currency Position', 'give' ),
130
-							'desc'    => esc_html__( 'The position of the currency symbol.', 'give' ),
129
+							'name'    => esc_html__('Currency Position', 'give'),
130
+							'desc'    => esc_html__('The position of the currency symbol.', 'give'),
131 131
 							'id'      => 'currency_position',
132 132
 							'type'    => 'select',
133 133
 							'options' => array(
134 134
 								/* translators: %s: currency symbol */
135
-								'before' => sprintf( esc_html__( 'Before - %s10', 'give' ), give_currency_symbol( give_get_currency() ) ),
135
+								'before' => sprintf(esc_html__('Before - %s10', 'give'), give_currency_symbol(give_get_currency())),
136 136
 								/* translators: %s: currency symbol */
137
-								'after'  => sprintf( esc_html__( 'After - 10%s', 'give' ), give_currency_symbol( give_get_currency() ) )
137
+								'after'  => sprintf(esc_html__('After - 10%s', 'give'), give_currency_symbol(give_get_currency()))
138 138
 							),
139 139
 							'default' => 'before',
140 140
 						),
141 141
 						array(
142
-							'name'    => esc_html__( 'Thousands Separator', 'give' ),
143
-							'desc'    => esc_html__( 'The symbol (typically , or .) to separate thousands.', 'give' ),
142
+							'name'    => esc_html__('Thousands Separator', 'give'),
143
+							'desc'    => esc_html__('The symbol (typically , or .) to separate thousands.', 'give'),
144 144
 							'id'      => 'thousands_separator',
145 145
 							'type'    => 'text',
146 146
 							'default' => ',',
147 147
 							'css'     => 'width:12em;',
148 148
 						),
149 149
 						array(
150
-							'name'    => esc_html__( 'Decimal Separator', 'give' ),
151
-							'desc'    => esc_html__( 'The symbol (usually , or .) to separate decimal points.', 'give' ),
150
+							'name'    => esc_html__('Decimal Separator', 'give'),
151
+							'desc'    => esc_html__('The symbol (usually , or .) to separate decimal points.', 'give'),
152 152
 							'id'      => 'decimal_separator',
153 153
 							'type'    => 'text',
154 154
 							'default' => '.',
155 155
 							'css'     => 'width:12em;',
156 156
 						),
157 157
 						array(
158
-							'name'            => __( 'Number of Decimals', 'give' ),
159
-							'desc'            => __( 'The number of decimal points displayed in amounts.', 'give' ),
158
+							'name'            => __('Number of Decimals', 'give'),
159
+							'desc'            => __('The number of decimal points displayed in amounts.', 'give'),
160 160
 							'id'              => 'number_decimals',
161 161
 							'type'            => 'text',
162 162
 							'default'         => 2,
163 163
 							'css'             => 'width:12em;',
164 164
 						),
165 165
                         array(
166
-                            'name'  => esc_html__( 'Currency Options Docs Link', 'give' ),
166
+                            'name'  => esc_html__('Currency Options Docs Link', 'give'),
167 167
                             'id'    => 'currency_settings_docs_link',
168
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-currency' ),
169
-                            'title' => __( 'Currency Settings', 'give' ),
168
+                            'url'   => esc_url('http://docs.givewp.com/settings-currency'),
169
+                            'title' => __('Currency Settings', 'give'),
170 170
                             'type'  => 'give_docs_link',
171 171
                         ),
172 172
 						array(
@@ -184,55 +184,55 @@  discard block
 block discarded – undo
184 184
 							'id'   => 'give_title_general_settings_1'
185 185
 						),
186 186
 						array(
187
-							'name' => esc_html__( 'General Settings', 'give' ),
187
+							'name' => esc_html__('General Settings', 'give'),
188 188
 							'desc' => '',
189 189
 							'type' => 'give_title',
190 190
 							'id'   => 'give_title_general_settings_1'
191 191
 						),
192 192
 						array(
193
-							'name'    => esc_html__( 'Success Page', 'give' ),
193
+							'name'    => esc_html__('Success Page', 'give'),
194 194
 							/* translators: %s: [give_receipt] */
195
-							'desc'    => sprintf( __( 'The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give' ), '<code>[give_receipt]</code>' ),
195
+							'desc'    => sprintf(__('The page donors are sent to after completing their donations. The %s shortcode should be on this page.', 'give'), '<code>[give_receipt]</code>'),
196 196
 							'id'      => 'success_page',
197 197
 							'type'    => 'select',
198
-							'options' => give_cmb2_get_post_options( array(
198
+							'options' => give_cmb2_get_post_options(array(
199 199
 								'post_type'   => 'page',
200
-								'numberposts' => - 1
201
-							) ),
200
+								'numberposts' => -1
201
+							)),
202 202
 						),
203 203
 						array(
204
-							'name'    => esc_html__( 'Failed Donation Page', 'give' ),
205
-							'desc'    => esc_html__( 'The page donors are sent to if their donation is cancelled or fails.', 'give' ),
204
+							'name'    => esc_html__('Failed Donation Page', 'give'),
205
+							'desc'    => esc_html__('The page donors are sent to if their donation is cancelled or fails.', 'give'),
206 206
 							'id'      => 'failure_page',
207 207
 							'type'    => 'select',
208
-							'options' => give_cmb2_get_post_options( array(
208
+							'options' => give_cmb2_get_post_options(array(
209 209
 								'post_type'   => 'page',
210
-								'numberposts' => - 1
211
-							) ),
210
+								'numberposts' => -1
211
+							)),
212 212
 						),
213 213
 						array(
214
-							'name'    => esc_html__( 'Donation History Page', 'give' ),
214
+							'name'    => esc_html__('Donation History Page', 'give'),
215 215
 							/* translators: %s: [donation_history] */
216
-							'desc'    => sprintf( __( 'The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give' ), '<code>[donation_history]</code>' ),
216
+							'desc'    => sprintf(__('The page showing a complete donation history for the current user. The %s shortcode should be on this page.', 'give'), '<code>[donation_history]</code>'),
217 217
 							'id'      => 'history_page',
218 218
 							'type'    => 'select',
219
-							'options' => give_cmb2_get_post_options( array(
219
+							'options' => give_cmb2_get_post_options(array(
220 220
 								'post_type'   => 'page',
221
-								'numberposts' => - 1
222
-							) ),
221
+								'numberposts' => -1
222
+							)),
223 223
 						),
224 224
 						array(
225
-							'name'    => esc_html__( 'Base Country', 'give' ),
226
-							'desc'    => esc_html__( 'The country your site operates from.', 'give' ),
225
+							'name'    => esc_html__('Base Country', 'give'),
226
+							'desc'    => esc_html__('The country your site operates from.', 'give'),
227 227
 							'id'      => 'base_country',
228 228
 							'type'    => 'select',
229 229
 							'options' => give_get_country_list(),
230 230
 						),
231 231
                         array(
232
-                            'name'  => esc_html__( 'General Options Docs Link', 'give' ),
232
+                            'name'  => esc_html__('General Options Docs Link', 'give'),
233 233
                             'id'    => 'general_options_docs_link',
234
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-general' ),
235
-                            'title' => __( 'General Options', 'give' ),
234
+                            'url'   => esc_url('http://docs.givewp.com/settings-general'),
235
+                            'title' => __('General Options', 'give'),
236 236
                             'type'  => 'give_docs_link',
237 237
                         ),
238 238
 						array(
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 			 * Filter the general settings.
248 248
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
249 249
 			 */
250
-			$settings = apply_filters( 'give_settings_general', $settings );
250
+			$settings = apply_filters('give_settings_general', $settings);
251 251
 
252 252
 			/**
253 253
 			 * Filter the settings.
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 			 *
257 257
 			 * @param  array $settings
258 258
 			 */
259
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
259
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
260 260
 
261 261
 			// Output.
262 262
 			return $settings;
@@ -270,12 +270,12 @@  discard block
 block discarded – undo
270 270
 		 */
271 271
 		public function get_sections() {
272 272
 			$sections = array(
273
-				'general-settings'  => esc_html__( 'General', 'give' ),
274
-				'currency-settings' => esc_html__( 'Currency', 'give' ),
275
-				'access-control'    => esc_html__( 'Access Control', 'give' )
273
+				'general-settings'  => esc_html__('General', 'give'),
274
+				'currency-settings' => esc_html__('Currency', 'give'),
275
+				'access-control'    => esc_html__('Access Control', 'give')
276 276
 			);
277 277
 
278
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
278
+			return apply_filters('give_get_sections_'.$this->id, $sections);
279 279
 		}
280 280
 	}
281 281
 
Please login to merge, or discard this patch.
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -90,13 +90,13 @@  discard block
 block discarded – undo
90 90
 							'default' => '',
91 91
 							'type'    => 'text'
92 92
 						),
93
-                        array(
94
-                            'name'  => esc_html__( 'Access Control Docs Link', 'give' ),
95
-                            'id'    => 'access_control_docs_link',
96
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-access-control' ),
97
-                            'title' => __( 'Access Control', 'give' ),
98
-                            'type'  => 'give_docs_link',
99
-                        ),
93
+						array(
94
+							'name'  => esc_html__( 'Access Control Docs Link', 'give' ),
95
+							'id'    => 'access_control_docs_link',
96
+							'url'   => esc_url( 'http://docs.givewp.com/settings-access-control' ),
97
+							'title' => __( 'Access Control', 'give' ),
98
+							'type'  => 'give_docs_link',
99
+						),
100 100
 						array(
101 101
 							'id'   => 'give_title_session_control_1',
102 102
 							'type' => 'sectionend'
@@ -162,13 +162,13 @@  discard block
 block discarded – undo
162 162
 							'default'         => 2,
163 163
 							'css'             => 'width:12em;',
164 164
 						),
165
-                        array(
166
-                            'name'  => esc_html__( 'Currency Options Docs Link', 'give' ),
167
-                            'id'    => 'currency_settings_docs_link',
168
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-currency' ),
169
-                            'title' => __( 'Currency Settings', 'give' ),
170
-                            'type'  => 'give_docs_link',
171
-                        ),
165
+						array(
166
+							'name'  => esc_html__( 'Currency Options Docs Link', 'give' ),
167
+							'id'    => 'currency_settings_docs_link',
168
+							'url'   => esc_url( 'http://docs.givewp.com/settings-currency' ),
169
+							'title' => __( 'Currency Settings', 'give' ),
170
+							'type'  => 'give_docs_link',
171
+						),
172 172
 						array(
173 173
 							'type' => 'sectionend',
174 174
 							'id'   => 'give_title_general_settings_2'
@@ -228,13 +228,13 @@  discard block
 block discarded – undo
228 228
 							'type'    => 'select',
229 229
 							'options' => give_get_country_list(),
230 230
 						),
231
-                        array(
232
-                            'name'  => esc_html__( 'General Options Docs Link', 'give' ),
233
-                            'id'    => 'general_options_docs_link',
234
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-general' ),
235
-                            'title' => __( 'General Options', 'give' ),
236
-                            'type'  => 'give_docs_link',
237
-                        ),
231
+						array(
232
+							'name'  => esc_html__( 'General Options Docs Link', 'give' ),
233
+							'id'    => 'general_options_docs_link',
234
+							'url'   => esc_url( 'http://docs.givewp.com/settings-general' ),
235
+							'title' => __( 'General Options', 'give' ),
236
+							'type'  => 'give_docs_link',
237
+						),
238 238
 						array(
239 239
 							'type' => 'sectionend',
240 240
 							'id'   => 'give_title_general_settings_1'
Please login to merge, or discard this patch.
includes/admin/forms/class-metabox-form-data.php 3 patches
Braces   +15 added lines, -6 removed lines patch added patch discarded remove patch
@@ -641,9 +641,12 @@  discard block
 block discarded – undo
641 641
 							<a href="#<?php echo $form_data_tab['id']; ?>">
642 642
 								<?php if ( ! empty( $form_data_tab['icon-html'] ) ) : ?>
643 643
 									<?php echo $form_data_tab['icon-html']; ?>
644
-								<?php else : ?>
644
+								<?php else {
645
+	: ?>
645 646
 									<span class="give-icon give-icon-default"></span>
646
-								<?php endif; ?>
647
+								<?php endif;
648
+}
649
+?>
647 650
 								<span class="give-label"><?php echo $form_data_tab['label']; ?></span>
648 651
 							</a>
649 652
 							<?php if ( $this->has_sub_tab( $form_data_tab ) ) : ?>
@@ -653,9 +656,12 @@  discard block
 block discarded – undo
653 656
 											<a href="#<?php echo $sub_tab['id']; ?>">
654 657
 												<?php if ( ! empty( $sub_tab['icon-html'] ) ) : ?>
655 658
 													<?php echo $sub_tab['icon-html']; ?>
656
-												<?php else : ?>
659
+												<?php else {
660
+	: ?>
657 661
 													<span class="give-icon give-icon-default"></span>
658
-												<?php endif; ?>
662
+												<?php endif;
663
+}
664
+?>
659 665
 												<span class="give-label"><?php echo $sub_tab['label']; ?></span>
660 666
 											</a>
661 667
 										</li>
@@ -682,11 +688,14 @@  discard block
 block discarded – undo
682 688
 						</div>
683 689
 
684 690
 						<?php do_action( "give_after_{$setting['id']}_settings" ); ?>
685
-					<?php else: ?>
691
+					<?php else {
692
+	: ?>
686 693
 						<?php if ( $this->has_sub_tab( $setting ) ) : ?>
687 694
 							<?php if ( ! empty( $setting['sub-fields'] ) ) : ?>
688 695
 								<?php foreach ( $setting['sub-fields'] as $index => $sub_fields ) : ?>
689
-									<div id="<?php echo $sub_fields['id']; ?>"
696
+									<div id="<?php echo $sub_fields['id'];
697
+}
698
+?>"
690 699
 										 class="panel give_options_panel give-hidden">
691 700
 										<?php if ( ! empty( $sub_fields['fields'] ) ) : ?>
692 701
 											<?php foreach ( $sub_fields['fields'] as $sub_field ) : ?>
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 						'desc'       => __( 'Do you want to display a custom message when the goal is closed?', 'give' ),
400 400
 						'id'         => $prefix . 'form_goal_achieved_message',
401 401
 						'type'       => 'wysiwyg',
402
-                        'default' => __( 'Thank you to all our donors, we have met our fundraising goal.', 'give' ),
402
+						'default' => __( 'Thank you to all our donors, we have met our fundraising goal.', 'give' ),
403 403
 					),
404 404
 					array(
405 405
 						'name'  => 'donation_goal_docs',
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
 
672 672
 						<div id="<?php echo $setting['id']; ?>"
673 673
 							 class="panel give_options_panel<?php echo( $show_first_tab_content ? '' : ' give-hidden' );
674
-						     $show_first_tab_content = false; ?>">
674
+							 $show_first_tab_content = false; ?>">
675 675
 							<?php if ( ! empty( $setting['fields'] ) ) : ?>
676 676
 								<?php foreach ( $setting['fields'] as $field ) : ?>
677 677
 									<?php give_render_field( $field ); ?>
Please login to merge, or discard this patch.
Spacing   +296 added lines, -296 removed lines patch added patch discarded remove patch
@@ -46,21 +46,21 @@  discard block
 block discarded – undo
46 46
 	 */
47 47
 	function __construct() {
48 48
 		$this->metabox_id    = 'give-metabox-form-data';
49
-		$this->metabox_label = __( 'Donation Form Options', 'give' );
49
+		$this->metabox_label = __('Donation Form Options', 'give');
50 50
 
51 51
 		// Setup.
52
-		add_action( 'admin_init', array( $this, 'setup' ) );
52
+		add_action('admin_init', array($this, 'setup'));
53 53
 
54 54
 		// Add metabox.
55
-		add_action( 'add_meta_boxes', array( $this, 'add_meta_box' ), 10 );
55
+		add_action('add_meta_boxes', array($this, 'add_meta_box'), 10);
56 56
 
57 57
 		// Save form meta.
58
-		add_action( 'save_post_give_forms', array( $this, 'save' ), 10, 2 );
58
+		add_action('save_post_give_forms', array($this, 'save'), 10, 2);
59 59
 
60 60
 		// cmb2 old setting loaders.
61 61
 		// add_filter( 'give_metabox_form_data_settings', array( $this, 'cmb2_metabox_settings' ) );
62 62
 		// Add offline donations options.
63
-		add_filter( 'give_metabox_form_data_settings', array( $this, 'add_offline_donations_setting_tab' ), 0, 1 );
63
+		add_filter('give_metabox_form_data_settings', array($this, 'add_offline_donations_setting_tab'), 0, 1);
64 64
 	}
65 65
 
66 66
 
@@ -83,24 +83,24 @@  discard block
 block discarded – undo
83 83
 	 */
84 84
 	function get_settings() {
85 85
 		$post_id               = give_get_admin_post_id();
86
-		$price                 = give_get_form_price( $post_id );
87
-		$custom_amount_minimum = give_get_form_minimum_price( $post_id );
88
-		$goal                  = give_format_amount( give_get_form_goal( $post_id ), array( 'sanitize' => false ) );
89
-		$price_placeholder     = give_format_decimal( '1.00', false, false );
86
+		$price                 = give_get_form_price($post_id);
87
+		$custom_amount_minimum = give_get_form_minimum_price($post_id);
88
+		$goal                  = give_format_amount(give_get_form_goal($post_id), array('sanitize' => false));
89
+		$price_placeholder     = give_format_decimal('1.00', false, false);
90 90
 
91 91
 		// No empty prices - min. 1.00 for new forms
92
-		if ( empty( $price ) && is_null( $post_id ) ) {
92
+		if (empty($price) && is_null($post_id)) {
93 93
 			$price = '1.00';
94 94
 		}
95 95
 
96 96
 		// Min. $1.00 for new forms
97
-		if ( empty( $custom_amount_minimum ) ) {
97
+		if (empty($custom_amount_minimum)) {
98 98
 			$custom_amount_minimum = '1.00';
99 99
 		}
100 100
 
101 101
 		// Format amounts.
102
-		$price = give_format_amount( $price, array( 'sanitize' => false ) );
103
-		$custom_amount_minimum = give_format_amount( $custom_amount_minimum, array( 'sanitize' => false ) );
102
+		$price = give_format_amount($price, array('sanitize' => false));
103
+		$custom_amount_minimum = give_format_amount($custom_amount_minimum, array('sanitize' => false));
104 104
 
105 105
 		// Start with an underscore to hide fields from custom fields list
106 106
 		$prefix = '_give_';
@@ -109,27 +109,27 @@  discard block
 block discarded – undo
109 109
 			/**
110 110
 			 * Repeatable Field Groups
111 111
 			 */
112
-			'form_field_options'    => apply_filters( 'give_forms_field_options', array(
112
+			'form_field_options'    => apply_filters('give_forms_field_options', array(
113 113
 				'id'        => 'form_field_options',
114
-				'title'     => __( 'Donation Options', 'give' ),
114
+				'title'     => __('Donation Options', 'give'),
115 115
 				'icon-html' => '<span class="give-icon give-icon-heart"></span>',
116
-				'fields'    => apply_filters( 'give_forms_donation_form_metabox_fields', array(
116
+				'fields'    => apply_filters('give_forms_donation_form_metabox_fields', array(
117 117
 					// Donation Option
118 118
 					array(
119
-						'name'        => __( 'Donation Option', 'give' ),
120
-						'description' => __( 'Do you want this form to have one set donation price or multiple levels (for example, $10, $20, $50)?', 'give' ),
121
-						'id'          => $prefix . 'price_option',
119
+						'name'        => __('Donation Option', 'give'),
120
+						'description' => __('Do you want this form to have one set donation price or multiple levels (for example, $10, $20, $50)?', 'give'),
121
+						'id'          => $prefix.'price_option',
122 122
 						'type'        => 'radio_inline',
123 123
 						'default'     => 'set',
124
-						'options'     => apply_filters( 'give_forms_price_options', array(
125
-							'set'   => __( 'Set Donation', 'give' ),
126
-							'multi' => __( 'Multi-level Donation', 'give' ),
127
-						) ),
124
+						'options'     => apply_filters('give_forms_price_options', array(
125
+							'set'   => __('Set Donation', 'give'),
126
+							'multi' => __('Multi-level Donation', 'give'),
127
+						)),
128 128
 					),
129 129
 					array(
130
-						'name'        => __( 'Set Donation', 'give' ),
131
-						'description' => __( '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' ),
132
-						'id'          => $prefix . 'set_price',
130
+						'name'        => __('Set Donation', 'give'),
131
+						'description' => __('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'),
132
+						'id'          => $prefix.'set_price',
133 133
 						'type'        => 'text_small',
134 134
 						'data_type'   => 'price',
135 135
 						'attributes'  => array(
@@ -140,33 +140,33 @@  discard block
 block discarded – undo
140 140
 					),
141 141
 					// Display Style
142 142
 					array(
143
-						'name'        => __( 'Display Style', 'give' ),
144
-						'description' => __( 'Set how the donations levels will display on the form.', 'give' ),
145
-						'id'          => $prefix . 'display_style',
143
+						'name'        => __('Display Style', 'give'),
144
+						'description' => __('Set how the donations levels will display on the form.', 'give'),
145
+						'id'          => $prefix.'display_style',
146 146
 						'type'        => 'radio_inline',
147 147
 						'default'     => 'buttons',
148 148
 						'options'     => array(
149
-							'buttons'  => __( 'Buttons', 'give' ),
150
-							'radios'   => __( 'Radios', 'give' ),
151
-							'dropdown' => __( 'Dropdown', 'give' ),
149
+							'buttons'  => __('Buttons', 'give'),
150
+							'radios'   => __('Radios', 'give'),
151
+							'dropdown' => __('Dropdown', 'give'),
152 152
 						),
153 153
 					),
154 154
 					// Custom Amount
155 155
 					array(
156
-						'name'        => __( 'Custom Amount', 'give' ),
157
-						'description' => __( 'Do you want the user to be able to input their own donation amount?', 'give' ),
158
-						'id'          => $prefix . 'custom_amount',
156
+						'name'        => __('Custom Amount', 'give'),
157
+						'description' => __('Do you want the user to be able to input their own donation amount?', 'give'),
158
+						'id'          => $prefix.'custom_amount',
159 159
 						'type'        => 'radio_inline',
160 160
 						'default'     => 'disabled',
161 161
 						'options'     => array(
162
-							'enabled'  => __( 'Enabled', 'give' ),
163
-							'disabled' => __( 'Disabled', 'give' ),
162
+							'enabled'  => __('Enabled', 'give'),
163
+							'disabled' => __('Disabled', 'give'),
164 164
 						),
165 165
 					),
166 166
 					array(
167
-						'name'        => __( 'Minimum Amount', 'give' ),
168
-						'description' => __( 'Enter the minimum custom donation amount.', 'give' ),
169
-						'id'          => $prefix . 'custom_amount_minimum',
167
+						'name'        => __('Minimum Amount', 'give'),
168
+						'description' => __('Enter the minimum custom donation amount.', 'give'),
169
+						'id'          => $prefix.'custom_amount_minimum',
170 170
 						'type'        => 'text_small',
171 171
 						'data_type'   => 'price',
172 172
 						'attributes'  => array(
@@ -176,35 +176,35 @@  discard block
 block discarded – undo
176 176
 						),
177 177
 					),
178 178
 					array(
179
-						'name'        => __( 'Custom Amount Text', 'give' ),
180
-						'description' => __( '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' ),
181
-						'id'          => $prefix . 'custom_amount_text',
179
+						'name'        => __('Custom Amount Text', 'give'),
180
+						'description' => __('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'),
181
+						'id'          => $prefix.'custom_amount_text',
182 182
 						'type'        => 'text_medium',
183 183
 						'attributes'  => array(
184 184
 							'rows'        => 3,
185
-							'placeholder' => esc_attr__( 'Give a Custom Amount', 'give' ),
185
+							'placeholder' => esc_attr__('Give a Custom Amount', 'give'),
186 186
 						),
187 187
 					),
188 188
 					// Donation Levels: Repeatable CMB2 Group
189 189
 					array(
190
-						'id'      => $prefix . 'donation_levels',
190
+						'id'      => $prefix.'donation_levels',
191 191
 						'type'    => 'group',
192 192
 						'options' => array(
193
-							'add_button'    => __( 'Add Level', 'give' ),
194
-							'header_title'  => __( 'Donation Level', 'give' ),
193
+							'add_button'    => __('Add Level', 'give'),
194
+							'header_title'  => __('Donation Level', 'give'),
195 195
 							'remove_button' => '<span class="dashicons dashicons-no"></span>',
196 196
 						),
197 197
 						// Fields array works the same, except id's only need to be unique for this group.
198 198
 						// Prefix is not needed.
199
-						'fields'  => apply_filters( 'give_donation_levels_table_row', array(
199
+						'fields'  => apply_filters('give_donation_levels_table_row', array(
200 200
 							array(
201
-								'name' => __( 'ID', 'give' ),
202
-								'id'   => $prefix . 'id',
201
+								'name' => __('ID', 'give'),
202
+								'id'   => $prefix.'id',
203 203
 								'type' => 'levels_id',
204 204
 							),
205 205
 							array(
206
-								'name'       => __( 'Amount', 'give' ),
207
-								'id'         => $prefix . 'amount',
206
+								'name'       => __('Amount', 'give'),
207
+								'id'         => $prefix.'amount',
208 208
 								'type'       => 'text_small',
209 209
 								'data_type'  => 'price',
210 210
 								'attributes' => array(
@@ -213,111 +213,111 @@  discard block
 block discarded – undo
213 213
 								),
214 214
 							),
215 215
 							array(
216
-								'name'       => __( 'Text', 'give' ),
217
-								'id'         => $prefix . 'text',
216
+								'name'       => __('Text', 'give'),
217
+								'id'         => $prefix.'text',
218 218
 								'type'       => 'text',
219 219
 								'attributes' => array(
220
-									'placeholder' => __( 'Donation Level', 'give' ),
220
+									'placeholder' => __('Donation Level', 'give'),
221 221
 									'class'       => 'give-multilevel-text-field',
222 222
 								),
223 223
 							),
224 224
 							array(
225
-								'name' => __( 'Default', 'give' ),
226
-								'id'   => $prefix . 'default',
225
+								'name' => __('Default', 'give'),
226
+								'id'   => $prefix.'default',
227 227
 								'type' => 'give_default_radio_inline',
228 228
 							),
229
-						) ),
229
+						)),
230 230
 					),
231 231
 					array(
232 232
 						'name'  => 'donation_options_docs',
233 233
 						'type'  => 'docs_link',
234 234
 						'url'   => 'http://docs.givewp.com/form-donation-options',
235
-						'title' => __( 'Donation Options', 'give' ),
235
+						'title' => __('Donation Options', 'give'),
236 236
 					),
237 237
 				),
238 238
 					$post_id
239 239
 				),
240
-			) ),
240
+			)),
241 241
 
242 242
 			/**
243 243
 			 * Display Options
244 244
 			 */
245
-			'form_display_options'  => apply_filters( 'give_form_display_options', array(
245
+			'form_display_options'  => apply_filters('give_form_display_options', array(
246 246
 					'id'        => 'form_display_options',
247
-					'title'     => __( 'Form Display', 'give' ),
247
+					'title'     => __('Form Display', 'give'),
248 248
 					'icon-html' => '<span class="give-icon give-icon-display"></span>',
249
-					'fields'    => apply_filters( 'give_forms_display_options_metabox_fields', array(
249
+					'fields'    => apply_filters('give_forms_display_options_metabox_fields', array(
250 250
 						array(
251
-							'name'    => __( 'Display Options', 'give' ),
252
-							'desc'    => sprintf( __( 'How would you like to display donation information for this form?', 'give' ), '#' ),
253
-							'id'      => $prefix . 'payment_display',
251
+							'name'    => __('Display Options', 'give'),
252
+							'desc'    => sprintf(__('How would you like to display donation information for this form?', 'give'), '#'),
253
+							'id'      => $prefix.'payment_display',
254 254
 							'type'    => 'radio_inline',
255 255
 							'options' => array(
256
-								'onpage' => __( 'All Fields', 'give' ),
257
-								'modal'  => __( 'Modal', 'give' ),
258
-								'reveal' => __( 'Reveal', 'give' ),
259
-								'button' => __( 'Button', 'give' ),
256
+								'onpage' => __('All Fields', 'give'),
257
+								'modal'  => __('Modal', 'give'),
258
+								'reveal' => __('Reveal', 'give'),
259
+								'button' => __('Button', 'give'),
260 260
 							),
261 261
 							'default' => 'onpage',
262 262
 						),
263 263
 						array(
264
-							'id'         => $prefix . 'reveal_label',
265
-							'name'       => __( 'Continue Button', 'give' ),
266
-							'desc'       => __( 'The button label for displaying the additional payment fields.', 'give' ),
264
+							'id'         => $prefix.'reveal_label',
265
+							'name'       => __('Continue Button', 'give'),
266
+							'desc'       => __('The button label for displaying the additional payment fields.', 'give'),
267 267
 							'type'       => 'text_small',
268 268
 							'attributes' => array(
269
-								'placeholder' => esc_attr__( 'Donate Now', 'give' ),
269
+								'placeholder' => esc_attr__('Donate Now', 'give'),
270 270
 							),
271 271
 						),
272 272
 						array(
273
-							'id'         => $prefix . 'checkout_label',
274
-							'name'       => __( 'Submit Button', 'give' ),
275
-							'desc'       => __( 'The button label for completing a donation.', 'give' ),
273
+							'id'         => $prefix.'checkout_label',
274
+							'name'       => __('Submit Button', 'give'),
275
+							'desc'       => __('The button label for completing a donation.', 'give'),
276 276
 							'type'       => 'text_small',
277 277
 							'attributes' => array(
278
-								'placeholder' => __( 'Donate Now', 'give' ),
278
+								'placeholder' => __('Donate Now', 'give'),
279 279
 							),
280 280
 						),
281 281
 						array(
282
-							'name' => __( 'Default Gateway', 'give' ),
283
-							'desc' => __( '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' ),
284
-							'id'   => $prefix . 'default_gateway',
282
+							'name' => __('Default Gateway', 'give'),
283
+							'desc' => __('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'),
284
+							'id'   => $prefix.'default_gateway',
285 285
 							'type' => 'default_gateway',
286 286
 						),
287 287
 						array(
288
-							'name'    => __( 'Guest Donations', 'give' ),
289
-							'desc'    => __( 'Do you want to allow non-logged-in users to make donations?', 'give' ),
290
-							'id'      => $prefix . 'logged_in_only',
288
+							'name'    => __('Guest Donations', 'give'),
289
+							'desc'    => __('Do you want to allow non-logged-in users to make donations?', 'give'),
290
+							'id'      => $prefix.'logged_in_only',
291 291
 							'type'    => 'radio_inline',
292 292
 							'default' => 'enabled',
293 293
 							'options' => array(
294
-								'enabled'  => __( 'Enabled', 'give' ),
295
-								'disabled' => __( 'Disabled', 'give' ),
294
+								'enabled'  => __('Enabled', 'give'),
295
+								'disabled' => __('Disabled', 'give'),
296 296
 							),
297 297
 						),
298 298
 						array(
299
-							'name'    => __( 'Registration', 'give' ),
300
-							'desc'    => __( 'Display the registration and login forms in the payment section for non-logged-in users.', 'give' ),
301
-							'id'      => $prefix . 'show_register_form',
299
+							'name'    => __('Registration', 'give'),
300
+							'desc'    => __('Display the registration and login forms in the payment section for non-logged-in users.', 'give'),
301
+							'id'      => $prefix.'show_register_form',
302 302
 							'type'    => 'radio',
303 303
 							'options' => array(
304
-								'none'         => __( 'None', 'give' ),
305
-								'registration' => __( 'Registration', 'give' ),
306
-								'login'        => __( 'Login', 'give' ),
307
-								'both'         => __( 'Registration + Login', 'give' ),
304
+								'none'         => __('None', 'give'),
305
+								'registration' => __('Registration', 'give'),
306
+								'login'        => __('Login', 'give'),
307
+								'both'         => __('Registration + Login', 'give'),
308 308
 							),
309 309
 							'default' => 'none',
310 310
 						),
311 311
 						array(
312
-							'name'    => __( 'Floating Labels', 'give' ),
312
+							'name'    => __('Floating Labels', 'give'),
313 313
 							/* translators: %s: forms http://docs.givewp.com/form-floating-labels */
314
-							'desc'    => sprintf( __( 'Select the <a href="%s" target="_blank">floating labels</a> setting for this Give form. Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give' ), esc_url( 'http://docs.givewp.com/form-floating-labels' ) ),
315
-							'id'      => $prefix . 'form_floating_labels',
314
+							'desc'    => sprintf(__('Select the <a href="%s" target="_blank">floating labels</a> setting for this Give form. Be aware that if you have the "Disable CSS" option enabled, you will need to style the floating labels yourself.', 'give'), esc_url('http://docs.givewp.com/form-floating-labels')),
315
+							'id'      => $prefix.'form_floating_labels',
316 316
 							'type'    => 'radio_inline',
317 317
 							'options' => array(
318
-								'global'   => __( 'Global Option', 'give' ),
319
-								'enabled'  => __( 'Enabled', 'give' ),
320
-								'disabled' => __( 'Disabled', 'give' ),
318
+								'global'   => __('Global Option', 'give'),
319
+								'enabled'  => __('Enabled', 'give'),
320
+								'disabled' => __('Disabled', 'give'),
321 321
 							),
322 322
 							'default' => 'global',
323 323
 						),
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 							'name'  => 'form_display_docs',
326 326
 							'type'  => 'docs_link',
327 327
 							'url'   => 'http://docs.givewp.com/form-display-options',
328
-							'title' => __( 'Form Display', 'give' ),
328
+							'title' => __('Form Display', 'give'),
329 329
 						),
330 330
 					),
331 331
 						$post_id
@@ -336,172 +336,172 @@  discard block
 block discarded – undo
336 336
 			/**
337 337
 			 * Donation Goals
338 338
 			 */
339
-			'donation_goal_options' => apply_filters( 'give_donation_goal_options', array(
339
+			'donation_goal_options' => apply_filters('give_donation_goal_options', array(
340 340
 				'id'        => 'donation_goal_options',
341
-				'title'     => __( 'Donation Goal', 'give' ),
341
+				'title'     => __('Donation Goal', 'give'),
342 342
 				'icon-html' => '<span class="give-icon give-icon-target"></span>',
343
-				'fields'    => apply_filters( 'give_forms_donation_goal_metabox_fields', array(
343
+				'fields'    => apply_filters('give_forms_donation_goal_metabox_fields', array(
344 344
 					// Goals
345 345
 					array(
346
-						'name'        => __( 'Donation Goal', 'give' ),
347
-						'description' => __( 'Do you want to set a donation goal for this form?', 'give' ),
348
-						'id'          => $prefix . 'goal_option',
346
+						'name'        => __('Donation Goal', 'give'),
347
+						'description' => __('Do you want to set a donation goal for this form?', 'give'),
348
+						'id'          => $prefix.'goal_option',
349 349
 						'type'        => 'radio_inline',
350 350
 						'default'     => 'disabled',
351 351
 						'options'     => array(
352
-							'enabled'  => __( 'Enabled', 'give' ),
353
-							'disabled' => __( 'Disabled', 'give' ),
352
+							'enabled'  => __('Enabled', 'give'),
353
+							'disabled' => __('Disabled', 'give'),
354 354
 						),
355 355
 					),
356 356
 					array(
357
-						'name'        => __( 'Goal Amount', 'give' ),
358
-						'description' => __( 'This is the monetary goal amount you want to reach for this form.', 'give' ),
359
-						'id'          => $prefix . 'set_goal',
357
+						'name'        => __('Goal Amount', 'give'),
358
+						'description' => __('This is the monetary goal amount you want to reach for this form.', 'give'),
359
+						'id'          => $prefix.'set_goal',
360 360
 						'type'        => 'text_small',
361 361
 						'data_type'   => 'price',
362 362
 						'attributes'  => array(
363
-							'placeholder' => give_format_decimal( '0.00', false, false ),
363
+							'placeholder' => give_format_decimal('0.00', false, false),
364 364
 							'value'       => $goal,
365 365
 							'class'       => 'give-money-field',
366 366
 						),
367 367
 					),
368 368
 
369 369
 					array(
370
-						'name'        => __( 'Goal Format', 'give' ),
371
-						'description' => __( 'Do you want 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' ),
372
-						'id'          => $prefix . 'goal_format',
370
+						'name'        => __('Goal Format', 'give'),
371
+						'description' => __('Do you want 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'),
372
+						'id'          => $prefix.'goal_format',
373 373
 						'type'        => 'radio_inline',
374 374
 						'default'     => 'amount',
375 375
 						'options'     => array(
376
-							'amount'     => __( 'Amount', 'give' ),
377
-							'percentage' => __( 'Percentage', 'give' ),
376
+							'amount'     => __('Amount', 'give'),
377
+							'percentage' => __('Percentage', 'give'),
378 378
 						),
379 379
 					),
380 380
 					array(
381
-						'name'    => __( 'Progress Bar Color', 'give' ),
382
-						'desc'    => __( 'Customize the color of the goal progress bar.', 'give' ),
383
-						'id'      => $prefix . 'goal_color',
381
+						'name'    => __('Progress Bar Color', 'give'),
382
+						'desc'    => __('Customize the color of the goal progress bar.', 'give'),
383
+						'id'      => $prefix.'goal_color',
384 384
 						'type'    => 'colorpicker',
385 385
 						'default' => '#2bc253',
386 386
 					),
387 387
 
388 388
 					array(
389
-						'name'    => __( 'Close Form', 'give' ),
390
-						'desc'    => __( 'Do you want to close the donation forms and stop accepting donations once this goal has been met?', 'give' ),
391
-						'id'      => $prefix . 'close_form_when_goal_achieved',
389
+						'name'    => __('Close Form', 'give'),
390
+						'desc'    => __('Do you want to close the donation forms and stop accepting donations once this goal has been met?', 'give'),
391
+						'id'      => $prefix.'close_form_when_goal_achieved',
392 392
 						'type'    => 'radio_inline',
393 393
 						'default' => 'disabled',
394 394
 						'options' => array(
395
-							'enabled'  => __( 'Enabled', 'give' ),
396
-							'disabled' => __( 'Disabled', 'give' ),
395
+							'enabled'  => __('Enabled', 'give'),
396
+							'disabled' => __('Disabled', 'give'),
397 397
 						),
398 398
 					),
399 399
 					array(
400
-						'name'       => __( 'Goal Achieved Message', 'give' ),
401
-						'desc'       => __( 'Do you want to display a custom message when the goal is closed?', 'give' ),
402
-						'id'         => $prefix . 'form_goal_achieved_message',
400
+						'name'       => __('Goal Achieved Message', 'give'),
401
+						'desc'       => __('Do you want to display a custom message when the goal is closed?', 'give'),
402
+						'id'         => $prefix.'form_goal_achieved_message',
403 403
 						'type'       => 'wysiwyg',
404
-                        'default' => __( 'Thank you to all our donors, we have met our fundraising goal.', 'give' ),
404
+                        'default' => __('Thank you to all our donors, we have met our fundraising goal.', 'give'),
405 405
 					),
406 406
 					array(
407 407
 						'name'  => 'donation_goal_docs',
408 408
 						'type'  => 'docs_link',
409 409
 						'url'   => 'http://docs.givewp.com/form-donation-goal',
410
-						'title' => __( 'Donation Goal', 'give' ),
410
+						'title' => __('Donation Goal', 'give'),
411 411
 					),
412 412
 				),
413 413
 					$post_id
414 414
 				),
415
-			) ),
415
+			)),
416 416
 
417 417
 			/**
418 418
 			 * Content Field
419 419
 			 */
420
-			'form_content_options'  => apply_filters( 'give_forms_content_options', array(
420
+			'form_content_options'  => apply_filters('give_forms_content_options', array(
421 421
 				'id'        => 'form_content_options',
422
-				'title'     => __( 'Form Content', 'give' ),
422
+				'title'     => __('Form Content', 'give'),
423 423
 				'icon-html' => '<span class="give-icon give-icon-edit"></span>',
424
-				'fields'    => apply_filters( 'give_forms_content_options_metabox_fields', array(
424
+				'fields'    => apply_filters('give_forms_content_options_metabox_fields', array(
425 425
 
426 426
 					// Donation content.
427 427
 					array(
428
-						'name'        => __( 'Display Content', 'give' ),
429
-						'description' => __( 'Do you want to add custom content to this form?', 'give' ),
430
-						'id'          => $prefix . 'display_content',
428
+						'name'        => __('Display Content', 'give'),
429
+						'description' => __('Do you want to add custom content to this form?', 'give'),
430
+						'id'          => $prefix.'display_content',
431 431
 						'type'        => 'radio_inline',
432 432
 						'options'     => array(
433
-							'enabled'  => __( 'Enabled', 'give' ),
434
-							'disabled' => __( 'Disabled', 'give' ),
433
+							'enabled'  => __('Enabled', 'give'),
434
+							'disabled' => __('Disabled', 'give'),
435 435
 						),
436 436
 						'default'     => 'disabled',
437 437
 					),
438 438
 
439 439
 					// Content placement.
440 440
 					array(
441
-						'name'        => __( 'Content Placement', 'give' ),
442
-						'description' => __( 'This option controls where the content appears within the donation form.', 'give' ),
443
-						'id'          => $prefix . 'content_placement',
441
+						'name'        => __('Content Placement', 'give'),
442
+						'description' => __('This option controls where the content appears within the donation form.', 'give'),
443
+						'id'          => $prefix.'content_placement',
444 444
 						'type'        => 'radio_inline',
445
-						'options'     => apply_filters( 'give_forms_content_options_select', array(
446
-								'give_pre_form'  => __( 'Above fields', 'give' ),
447
-								'give_post_form' => __( 'Below fields', 'give' ),
445
+						'options'     => apply_filters('give_forms_content_options_select', array(
446
+								'give_pre_form'  => __('Above fields', 'give'),
447
+								'give_post_form' => __('Below fields', 'give'),
448 448
 							)
449 449
 						),
450 450
 						'default'     => 'give_pre_form',
451 451
 					),
452 452
 					array(
453
-						'name'        => __( 'Content', 'give' ),
454
-						'description' => __( 'This content will display on the single give form page.', 'give' ),
455
-						'id'          => $prefix . 'form_content',
453
+						'name'        => __('Content', 'give'),
454
+						'description' => __('This content will display on the single give form page.', 'give'),
455
+						'id'          => $prefix.'form_content',
456 456
 						'type'        => 'wysiwyg',
457 457
 					),
458 458
 					array(
459 459
 						'name'  => 'form_content_docs',
460 460
 						'type'  => 'docs_link',
461 461
 						'url'   => 'http://docs.givewp.com/form-content',
462
-						'title' => __( 'Form Content', 'give' ),
462
+						'title' => __('Form Content', 'give'),
463 463
 					),
464 464
 				),
465 465
 					$post_id
466 466
 				),
467
-			) ),
467
+			)),
468 468
 
469 469
 			/**
470 470
 			 * Terms & Conditions
471 471
 			 */
472
-			'form_terms_options'    => apply_filters( 'give_forms_terms_options', array(
472
+			'form_terms_options'    => apply_filters('give_forms_terms_options', array(
473 473
 				'id'        => 'form_terms_options',
474
-				'title'     => __( 'Terms & Conditions', 'give' ),
474
+				'title'     => __('Terms & Conditions', 'give'),
475 475
 				'icon-html' => '<span class="give-icon give-icon-checklist"></span>',
476
-				'fields'    => apply_filters( 'give_forms_terms_options_metabox_fields', array(
476
+				'fields'    => apply_filters('give_forms_terms_options_metabox_fields', array(
477 477
 					// Donation Option
478 478
 					array(
479
-						'name'        => __( 'Terms and Conditions', 'give' ),
480
-						'description' => __( 'Do you want to require the donor to accept terms prior to being able to complete their donation?', 'give' ),
481
-						'id'          => $prefix . 'terms_option',
479
+						'name'        => __('Terms and Conditions', 'give'),
480
+						'description' => __('Do you want to require the donor to accept terms prior to being able to complete their donation?', 'give'),
481
+						'id'          => $prefix.'terms_option',
482 482
 						'type'        => 'radio_inline',
483
-						'options'     => apply_filters( 'give_forms_content_options_select', array(
484
-								'global'   => __( 'Global Option', 'give' ),
485
-								'enabled'  => __( 'Customize', 'give' ),
486
-								'disabled' => __( 'Disable', 'give' ),
483
+						'options'     => apply_filters('give_forms_content_options_select', array(
484
+								'global'   => __('Global Option', 'give'),
485
+								'enabled'  => __('Customize', 'give'),
486
+								'disabled' => __('Disable', 'give'),
487 487
 							)
488 488
 						),
489 489
 						'default'     => 'global',
490 490
 					),
491 491
 					array(
492
-						'id'         => $prefix . 'agree_label',
493
-						'name'       => __( 'Agreement Label', 'give' ),
494
-						'desc'       => __( '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' ),
492
+						'id'         => $prefix.'agree_label',
493
+						'name'       => __('Agreement Label', 'give'),
494
+						'desc'       => __('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'),
495 495
 						'type'       => 'text',
496 496
 						'size'       => 'regular',
497 497
 						'attributes' => array(
498
-							'placeholder' => esc_attr__( 'Agree to Terms?', 'give' ),
498
+							'placeholder' => esc_attr__('Agree to Terms?', 'give'),
499 499
 						),
500 500
 					),
501 501
 					array(
502
-						'id'   => $prefix . 'agree_text',
503
-						'name' => __( 'Agreement Text', 'give' ),
504
-						'desc' => __( 'This is the actual text which the user will have to agree to in order to make a donation.', 'give' ),
502
+						'id'   => $prefix.'agree_text',
503
+						'name' => __('Agreement Text', 'give'),
504
+						'desc' => __('This is the actual text which the user will have to agree to in order to make a donation.', 'give'),
505 505
 						'default' => give_get_option('agreement_text'),
506 506
 						'type' => 'wysiwyg',
507 507
 					),
@@ -509,19 +509,19 @@  discard block
 block discarded – undo
509 509
 						'name'  => 'terms_docs',
510 510
 						'type'  => 'docs_link',
511 511
 						'url'   => 'http://docs.givewp.com/form-terms',
512
-						'title' => __( 'Terms and Conditions', 'give' ),
512
+						'title' => __('Terms and Conditions', 'give'),
513 513
 					),
514 514
 				),
515 515
 					$post_id
516 516
 				),
517
-			) ),
517
+			)),
518 518
 		);
519 519
 
520 520
 
521 521
 		/**
522 522
 		 * Filter the metabox tabbed panel settings.
523 523
 		 */
524
-		$settings = apply_filters( 'give_metabox_form_data_settings', $settings, $post_id );
524
+		$settings = apply_filters('give_metabox_form_data_settings', $settings, $post_id);
525 525
 
526 526
 		// Output.
527 527
 		return $settings;
@@ -537,8 +537,8 @@  discard block
 block discarded – undo
537 537
 		add_meta_box(
538 538
 			$this->get_metabox_ID(),
539 539
 			$this->get_metabox_label(),
540
-			array( $this, 'output' ),
541
-			array( 'give_forms' ),
540
+			array($this, 'output'),
541
+			array('give_forms'),
542 542
 			'normal',
543 543
 			'high'
544 544
 		);
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 	function enqueue_script() {
555 555
 		global $post;
556 556
 
557
-		if ( is_object( $post ) && 'give_forms' === $post->post_type ) {
557
+		if (is_object($post) && 'give_forms' === $post->post_type) {
558 558
 
559 559
 		}
560 560
 	}
@@ -589,32 +589,32 @@  discard block
 block discarded – undo
589 589
 	public function get_tabs() {
590 590
 		$tabs = array();
591 591
 
592
-		if ( ! empty( $this->settings ) ) {
593
-			foreach ( $this->settings as $setting ) {
594
-				if ( ! isset( $setting['id'] ) || ! isset( $setting['title'] ) ) {
592
+		if ( ! empty($this->settings)) {
593
+			foreach ($this->settings as $setting) {
594
+				if ( ! isset($setting['id']) || ! isset($setting['title'])) {
595 595
 					continue;
596 596
 				}
597 597
 				$tab = array(
598 598
 					'id'        => $setting['id'],
599 599
 					'label'     => $setting['title'],
600
-					'icon-html' => ( ! empty( $setting['icon-html'] ) ? $setting['icon-html'] : '' ),
600
+					'icon-html' => ( ! empty($setting['icon-html']) ? $setting['icon-html'] : ''),
601 601
 				);
602 602
 
603
-				if ( $this->has_sub_tab( $setting ) ) {
604
-					if ( empty( $setting['sub-fields'] ) ) {
603
+				if ($this->has_sub_tab($setting)) {
604
+					if (empty($setting['sub-fields'])) {
605 605
 						$tab = array();
606 606
 					} else {
607
-						foreach ( $setting['sub-fields'] as $sub_fields ) {
607
+						foreach ($setting['sub-fields'] as $sub_fields) {
608 608
 							$tab['sub-fields'][] = array(
609 609
 								'id'        => $sub_fields['id'],
610 610
 								'label'     => $sub_fields['title'],
611
-								'icon-html' => ( ! empty( $sub_fields['icon-html'] ) ? $sub_fields['icon-html'] : '' ),
611
+								'icon-html' => ( ! empty($sub_fields['icon-html']) ? $sub_fields['icon-html'] : ''),
612 612
 							);
613 613
 						}
614 614
 					}
615 615
 				}
616 616
 
617
-				if ( ! empty( $tab ) ) {
617
+				if ( ! empty($tab)) {
618 618
 					$tabs[] = $tab;
619 619
 				}
620 620
 			}
@@ -631,27 +631,27 @@  discard block
 block discarded – undo
631 631
 	 */
632 632
 	public function output() {
633 633
 		// Bailout.
634
-		if ( $form_data_tabs = $this->get_tabs() ) {
635
-			wp_nonce_field( 'give_save_form_meta', 'give_form_meta_nonce' );
634
+		if ($form_data_tabs = $this->get_tabs()) {
635
+			wp_nonce_field('give_save_form_meta', 'give_form_meta_nonce');
636 636
 			?>
637 637
 			<div class="give-metabox-panel-wrap">
638 638
 				<ul class="give-form-data-tabs give-metabox-tabs">
639
-					<?php foreach ( $form_data_tabs as $index => $form_data_tab ) : ?>
640
-						<li class="<?php echo "{$form_data_tab['id']}_tab" . ( ! $index ? ' active' : '' ) . ( $this->has_sub_tab( $form_data_tab ) ? ' has-sub-fields' : '' ); ?>">
639
+					<?php foreach ($form_data_tabs as $index => $form_data_tab) : ?>
640
+						<li class="<?php echo "{$form_data_tab['id']}_tab".( ! $index ? ' active' : '').($this->has_sub_tab($form_data_tab) ? ' has-sub-fields' : ''); ?>">
641 641
 							<a href="#<?php echo $form_data_tab['id']; ?>">
642
-								<?php if ( ! empty( $form_data_tab['icon-html'] ) ) : ?>
642
+								<?php if ( ! empty($form_data_tab['icon-html'])) : ?>
643 643
 									<?php echo $form_data_tab['icon-html']; ?>
644 644
 								<?php else : ?>
645 645
 									<span class="give-icon give-icon-default"></span>
646 646
 								<?php endif; ?>
647 647
 								<span class="give-label"><?php echo $form_data_tab['label']; ?></span>
648 648
 							</a>
649
-							<?php if ( $this->has_sub_tab( $form_data_tab ) ) : ?>
649
+							<?php if ($this->has_sub_tab($form_data_tab)) : ?>
650 650
 								<ul class="give-metabox-sub-tabs give-hidden">
651
-									<?php foreach ( $form_data_tab['sub-fields'] as $sub_tab ) : ?>
651
+									<?php foreach ($form_data_tab['sub-fields'] as $sub_tab) : ?>
652 652
 										<li class="<?php echo "{$sub_tab['id']}_tab"; ?>">
653 653
 											<a href="#<?php echo $sub_tab['id']; ?>">
654
-												<?php if ( ! empty( $sub_tab['icon-html'] ) ) : ?>
654
+												<?php if ( ! empty($sub_tab['icon-html'])) : ?>
655 655
 													<?php echo $sub_tab['icon-html']; ?>
656 656
 												<?php else : ?>
657 657
 													<span class="give-icon give-icon-default"></span>
@@ -667,30 +667,30 @@  discard block
 block discarded – undo
667 667
 				</ul>
668 668
 
669 669
 				<?php $show_first_tab_content = true; ?>
670
-				<?php foreach ( $this->settings as $setting ) : ?>
671
-					<?php if ( ! $this->has_sub_tab( $setting ) ) : ?>
672
-						<?php do_action( "give_before_{$setting['id']}_settings" ); ?>
670
+				<?php foreach ($this->settings as $setting) : ?>
671
+					<?php if ( ! $this->has_sub_tab($setting)) : ?>
672
+						<?php do_action("give_before_{$setting['id']}_settings"); ?>
673 673
 
674 674
 						<div id="<?php echo $setting['id']; ?>"
675
-							 class="panel give_options_panel<?php echo( $show_first_tab_content ? '' : ' give-hidden' );
675
+							 class="panel give_options_panel<?php echo($show_first_tab_content ? '' : ' give-hidden');
676 676
 						     $show_first_tab_content = false; ?>">
677
-							<?php if ( ! empty( $setting['fields'] ) ) : ?>
678
-								<?php foreach ( $setting['fields'] as $field ) : ?>
679
-									<?php give_render_field( $field ); ?>
677
+							<?php if ( ! empty($setting['fields'])) : ?>
678
+								<?php foreach ($setting['fields'] as $field) : ?>
679
+									<?php give_render_field($field); ?>
680 680
 								<?php endforeach; ?>
681 681
 							<?php endif; ?>
682 682
 						</div>
683 683
 
684
-						<?php do_action( "give_after_{$setting['id']}_settings" ); ?>
684
+						<?php do_action("give_after_{$setting['id']}_settings"); ?>
685 685
 					<?php else: ?>
686
-						<?php if ( $this->has_sub_tab( $setting ) ) : ?>
687
-							<?php if ( ! empty( $setting['sub-fields'] ) ) : ?>
688
-								<?php foreach ( $setting['sub-fields'] as $index => $sub_fields ) : ?>
686
+						<?php if ($this->has_sub_tab($setting)) : ?>
687
+							<?php if ( ! empty($setting['sub-fields'])) : ?>
688
+								<?php foreach ($setting['sub-fields'] as $index => $sub_fields) : ?>
689 689
 									<div id="<?php echo $sub_fields['id']; ?>"
690 690
 										 class="panel give_options_panel give-hidden">
691
-										<?php if ( ! empty( $sub_fields['fields'] ) ) : ?>
692
-											<?php foreach ( $sub_fields['fields'] as $sub_field ) : ?>
693
-												<?php give_render_field( $sub_field ); ?>
691
+										<?php if ( ! empty($sub_fields['fields'])) : ?>
692
+											<?php foreach ($sub_fields['fields'] as $sub_field) : ?>
693
+												<?php give_render_field($sub_field); ?>
694 694
 											<?php endforeach; ?>
695 695
 										<?php endif; ?>
696 696
 									</div>
@@ -714,9 +714,9 @@  discard block
 block discarded – undo
714 714
 	 *
715 715
 	 * @return bool
716 716
 	 */
717
-	private function has_sub_tab( $field_setting ) {
717
+	private function has_sub_tab($field_setting) {
718 718
 		$has_sub_tab = false;
719
-		if ( array_key_exists( 'sub-fields', $field_setting ) ) {
719
+		if (array_key_exists('sub-fields', $field_setting)) {
720 720
 			$has_sub_tab = true;
721 721
 		}
722 722
 
@@ -730,13 +730,13 @@  discard block
 block discarded – undo
730 730
 	 * @return array
731 731
 	 */
732 732
 	function cmb2_metabox_settings() {
733
-		$all_cmb2_settings   = apply_filters( 'cmb2_meta_boxes', array() );
733
+		$all_cmb2_settings   = apply_filters('cmb2_meta_boxes', array());
734 734
 		$give_forms_settings = $all_cmb2_settings;
735 735
 
736 736
 		// Filter settings: Use only give forms related settings.
737
-		foreach ( $all_cmb2_settings as $index => $setting ) {
738
-			if ( ! in_array( 'give_forms', $setting['object_types'] ) ) {
739
-				unset( $give_forms_settings[ $index ] );
737
+		foreach ($all_cmb2_settings as $index => $setting) {
738
+			if ( ! in_array('give_forms', $setting['object_types'])) {
739
+				unset($give_forms_settings[$index]);
740 740
 			}
741 741
 		}
742 742
 
@@ -754,97 +754,97 @@  discard block
 block discarded – undo
754 754
 	 *
755 755
 	 * @return void
756 756
 	 */
757
-	public function save( $post_id, $post ) {
757
+	public function save($post_id, $post) {
758 758
 
759 759
 		// $post_id and $post are required.
760
-		if ( empty( $post_id ) || empty( $post ) ) {
760
+		if (empty($post_id) || empty($post)) {
761 761
 			return;
762 762
 		}
763 763
 
764 764
 		// Don't save meta boxes for revisions or autosaves.
765
-		if ( defined( 'DOING_AUTOSAVE' ) || is_int( wp_is_post_revision( $post ) ) || is_int( wp_is_post_autosave( $post ) ) ) {
765
+		if (defined('DOING_AUTOSAVE') || is_int(wp_is_post_revision($post)) || is_int(wp_is_post_autosave($post))) {
766 766
 			return;
767 767
 		}
768 768
 
769 769
 		// Check the nonce.
770
-		if ( empty( $_POST['give_form_meta_nonce'] ) || ! wp_verify_nonce( $_POST['give_form_meta_nonce'], 'give_save_form_meta' ) ) {
770
+		if (empty($_POST['give_form_meta_nonce']) || ! wp_verify_nonce($_POST['give_form_meta_nonce'], 'give_save_form_meta')) {
771 771
 			return;
772 772
 		}
773 773
 
774 774
 		// Check the post being saved == the $post_id to prevent triggering this call for other save_post events.
775
-		if ( empty( $_POST['post_ID'] ) || $_POST['post_ID'] != $post_id ) {
775
+		if (empty($_POST['post_ID']) || $_POST['post_ID'] != $post_id) {
776 776
 			return;
777 777
 		}
778 778
 
779 779
 		// Check user has permission to edit.
780
-		if ( ! current_user_can( 'edit_post', $post_id ) ) {
780
+		if ( ! current_user_can('edit_post', $post_id)) {
781 781
 			return;
782 782
 		}
783 783
 
784 784
 		// Fire action before saving form meta.
785
-		do_action( 'give_pre_process_give_forms_meta', $post_id, $post );
785
+		do_action('give_pre_process_give_forms_meta', $post_id, $post);
786 786
 
787 787
 		/**
788 788
 		 * Filter the meta key to save.
789 789
 		 * Third party addon developer can remove there meta keys from this array to handle saving data on there own.
790 790
 		 */
791
-		$form_meta_keys = apply_filters( 'give_process_form_meta_keys', $this->get_meta_keys_from_settings() );
791
+		$form_meta_keys = apply_filters('give_process_form_meta_keys', $this->get_meta_keys_from_settings());
792 792
 
793 793
 		// Save form meta data.
794
-		if ( ! empty( $form_meta_keys ) ) {
795
-			foreach ( $form_meta_keys as $form_meta_key ) {
794
+		if ( ! empty($form_meta_keys)) {
795
+			foreach ($form_meta_keys as $form_meta_key) {
796 796
 
797 797
 				// Set default value for checkbox fields.
798 798
 				if (
799
-					! isset( $_POST[ $form_meta_key ] )
800
-					&& ( 'checkbox' === $this->get_field_type( $form_meta_key ) )
799
+					! isset($_POST[$form_meta_key])
800
+					&& ('checkbox' === $this->get_field_type($form_meta_key))
801 801
 				) {
802
-					$_POST[ $form_meta_key ] = '';
802
+					$_POST[$form_meta_key] = '';
803 803
 				}
804 804
 
805
-				if ( isset( $_POST[ $form_meta_key ] ) ) {
806
-					$setting_field = $this->get_setting_field( $form_meta_key );
807
-					if ( ! empty( $setting_field['type'] ) ) {
808
-						switch ( $setting_field['type'] ) {
805
+				if (isset($_POST[$form_meta_key])) {
806
+					$setting_field = $this->get_setting_field($form_meta_key);
807
+					if ( ! empty($setting_field['type'])) {
808
+						switch ($setting_field['type']) {
809 809
 							case 'textarea':
810 810
 							case 'wysiwyg':
811
-								$form_meta_value = wp_kses_post( $_POST[ $form_meta_key ] );
811
+								$form_meta_value = wp_kses_post($_POST[$form_meta_key]);
812 812
 								break;
813 813
 
814 814
 							case 'group':
815 815
 								$form_meta_value = array();
816 816
 
817
-								foreach ( $_POST[ $form_meta_key ] as $index => $group ) {
817
+								foreach ($_POST[$form_meta_key] as $index => $group) {
818 818
 
819 819
 									// Do not save template input field values.
820
-									if ( '{{row-count-placeholder}}' === $index ) {
820
+									if ('{{row-count-placeholder}}' === $index) {
821 821
 										continue;
822 822
 									}
823 823
 
824 824
 									$group_meta_value = array();
825
-									foreach ( $group as $field_id => $field_value ) {
826
-										switch ( $this->get_field_type( $field_id, $form_meta_key ) ) {
825
+									foreach ($group as $field_id => $field_value) {
826
+										switch ($this->get_field_type($field_id, $form_meta_key)) {
827 827
 											case 'wysiwyg':
828
-												$group_meta_value[ $field_id ] = wp_kses_post( $field_value );
828
+												$group_meta_value[$field_id] = wp_kses_post($field_value);
829 829
 												break;
830 830
 
831 831
 											default:
832
-												$group_meta_value[ $field_id ] = give_clean( $field_value );
832
+												$group_meta_value[$field_id] = give_clean($field_value);
833 833
 										}
834 834
 									}
835 835
 
836
-									if ( ! empty( $group_meta_value ) ) {
837
-										$form_meta_value[ $index ] = $group_meta_value;
836
+									if ( ! empty($group_meta_value)) {
837
+										$form_meta_value[$index] = $group_meta_value;
838 838
 									}
839 839
 								}
840 840
 
841 841
 
842 842
 								// Arrange repeater field keys in order.
843
-								$form_meta_value = array_values( $form_meta_value );
843
+								$form_meta_value = array_values($form_meta_value);
844 844
 								break;
845 845
 
846 846
 							default:
847
-								$form_meta_value = give_clean( $_POST[ $form_meta_key ] );
847
+								$form_meta_value = give_clean($_POST[$form_meta_key]);
848 848
 						}
849 849
 
850 850
 
@@ -855,24 +855,24 @@  discard block
 block discarded – undo
855 855
 						 */
856 856
 						$form_meta_value = apply_filters(
857 857
 								'give_pre_save_form_meta_value',
858
-								$this->sanitize_form_meta( $form_meta_value, $setting_field ),
858
+								$this->sanitize_form_meta($form_meta_value, $setting_field),
859 859
 								$form_meta_key,
860 860
 								$this,
861 861
 								$post_id
862 862
 						);
863 863
 
864 864
 						// Save data.
865
-						give_update_meta( $post_id, $form_meta_key, $form_meta_value );
865
+						give_update_meta($post_id, $form_meta_key, $form_meta_value);
866 866
 
867 867
 						// Fire after saving form meta key.
868
-						do_action( "give_save_{$form_meta_key}", $form_meta_key, $form_meta_value, $post_id, $post );
868
+						do_action("give_save_{$form_meta_key}", $form_meta_key, $form_meta_value, $post_id, $post);
869 869
 					}
870 870
 				}
871 871
 			}
872 872
 		}
873 873
 
874 874
 		// Fire action after saving form meta.
875
-		do_action( 'give_post_process_give_forms_meta', $post_id, $post );
875
+		do_action('give_post_process_give_forms_meta', $post_id, $post);
876 876
 	}
877 877
 
878 878
 
@@ -885,10 +885,10 @@  discard block
 block discarded – undo
885 885
 	 *
886 886
 	 * @return string
887 887
 	 */
888
-	private function get_field_id( $field ) {
888
+	private function get_field_id($field) {
889 889
 		$field_id = '';
890 890
 
891
-		if ( array_key_exists( 'id', $field ) ) {
891
+		if (array_key_exists('id', $field)) {
892 892
 			$field_id = $field['id'];
893 893
 
894 894
 		}
@@ -905,12 +905,12 @@  discard block
 block discarded – undo
905 905
 	 *
906 906
 	 * @return array
907 907
 	 */
908
-	private function get_fields_id( $setting ) {
908
+	private function get_fields_id($setting) {
909 909
 		$meta_keys = array();
910 910
 
911
-		if ( ! empty( $setting ) ) {
912
-			foreach ( $setting['fields'] as $field ) {
913
-				if ( $field_id = $this->get_field_id( $field ) ) {
911
+		if ( ! empty($setting)) {
912
+			foreach ($setting['fields'] as $field) {
913
+				if ($field_id = $this->get_field_id($field)) {
914 914
 					$meta_keys[] = $field_id;
915 915
 				}
916 916
 			}
@@ -928,14 +928,14 @@  discard block
 block discarded – undo
928 928
 	 *
929 929
 	 * @return array
930 930
 	 */
931
-	private function get_sub_fields_id( $setting ) {
931
+	private function get_sub_fields_id($setting) {
932 932
 		$meta_keys = array();
933 933
 
934
-		if ( $this->has_sub_tab( $setting ) && ! empty( $setting['sub-fields'] ) ) {
935
-			foreach ( $setting['sub-fields'] as $fields ) {
936
-				if ( ! empty( $fields['fields'] ) ) {
937
-					foreach ( $fields['fields'] as $field ) {
938
-						if ( $field_id = $this->get_field_id( $field ) ) {
934
+		if ($this->has_sub_tab($setting) && ! empty($setting['sub-fields'])) {
935
+			foreach ($setting['sub-fields'] as $fields) {
936
+				if ( ! empty($fields['fields'])) {
937
+					foreach ($fields['fields'] as $field) {
938
+						if ($field_id = $this->get_field_id($field)) {
939 939
 							$meta_keys[] = $field_id;
940 940
 						}
941 941
 					}
@@ -956,14 +956,14 @@  discard block
 block discarded – undo
956 956
 	private function get_meta_keys_from_settings() {
957 957
 		$meta_keys = array();
958 958
 
959
-		foreach ( $this->settings as $setting ) {
960
-			if ( $this->has_sub_tab( $setting ) ) {
961
-				$meta_key = $this->get_sub_fields_id( $setting );
959
+		foreach ($this->settings as $setting) {
960
+			if ($this->has_sub_tab($setting)) {
961
+				$meta_key = $this->get_sub_fields_id($setting);
962 962
 			} else {
963
-				$meta_key = $this->get_fields_id( $setting );
963
+				$meta_key = $this->get_fields_id($setting);
964 964
 			}
965 965
 
966
-			$meta_keys = array_merge( $meta_keys, $meta_key );
966
+			$meta_keys = array_merge($meta_keys, $meta_key);
967 967
 		}
968 968
 
969 969
 		return $meta_keys;
@@ -980,10 +980,10 @@  discard block
 block discarded – undo
980 980
 	 *
981 981
 	 * @return string
982 982
 	 */
983
-	function get_field_type( $field_id, $group_id = '' ) {
984
-		$field = $this->get_setting_field( $field_id, $group_id );
983
+	function get_field_type($field_id, $group_id = '') {
984
+		$field = $this->get_setting_field($field_id, $group_id);
985 985
 
986
-		$type = array_key_exists( 'type', $field )
986
+		$type = array_key_exists('type', $field)
987 987
 			? $field['type']
988 988
 			: '';
989 989
 
@@ -1001,12 +1001,12 @@  discard block
 block discarded – undo
1001 1001
 	 *
1002 1002
 	 * @return array
1003 1003
 	 */
1004
-	private function get_field( $setting, $field_id ) {
1004
+	private function get_field($setting, $field_id) {
1005 1005
 		$setting_field = array();
1006 1006
 
1007
-		if ( ! empty( $setting['fields'] ) ) {
1008
-			foreach ( $setting['fields'] as $field ) {
1009
-				if ( array_key_exists( 'id', $field ) && $field['id'] === $field_id ) {
1007
+		if ( ! empty($setting['fields'])) {
1008
+			foreach ($setting['fields'] as $field) {
1009
+				if (array_key_exists('id', $field) && $field['id'] === $field_id) {
1010 1010
 					$setting_field = $field;
1011 1011
 					break;
1012 1012
 				}
@@ -1026,12 +1026,12 @@  discard block
 block discarded – undo
1026 1026
 	 *
1027 1027
 	 * @return array
1028 1028
 	 */
1029
-	private function get_sub_field( $setting, $field_id ) {
1029
+	private function get_sub_field($setting, $field_id) {
1030 1030
 		$setting_field = array();
1031 1031
 
1032
-		if ( ! empty( $setting['sub-fields'] ) ) {
1033
-			foreach ( $setting['sub-fields'] as $fields ) {
1034
-				if ( $field = $this->get_field( $fields, $field_id ) ) {
1032
+		if ( ! empty($setting['sub-fields'])) {
1033
+			foreach ($setting['sub-fields'] as $fields) {
1034
+				if ($field = $this->get_field($fields, $field_id)) {
1035 1035
 					$setting_field = $field;
1036 1036
 					break;
1037 1037
 				}
@@ -1051,17 +1051,17 @@  discard block
 block discarded – undo
1051 1051
 	 *
1052 1052
 	 * @return array
1053 1053
 	 */
1054
-	function get_setting_field( $field_id, $group_id = '' ) {
1054
+	function get_setting_field($field_id, $group_id = '') {
1055 1055
 		$setting_field = array();
1056 1056
 
1057 1057
 		$_field_id = $field_id;
1058
-		$field_id  = empty( $group_id ) ? $field_id : $group_id;
1058
+		$field_id  = empty($group_id) ? $field_id : $group_id;
1059 1059
 
1060
-		if ( ! empty( $this->settings ) ) {
1061
-			foreach ( $this->settings as $setting ) {
1060
+		if ( ! empty($this->settings)) {
1061
+			foreach ($this->settings as $setting) {
1062 1062
 				if (
1063
-					( $this->has_sub_tab( $setting ) && ( $setting_field = $this->get_sub_field( $setting, $field_id ) ) )
1064
-					|| ( $setting_field = $this->get_field( $setting, $field_id ) )
1063
+					($this->has_sub_tab($setting) && ($setting_field = $this->get_sub_field($setting, $field_id)))
1064
+					|| ($setting_field = $this->get_field($setting, $field_id))
1065 1065
 				) {
1066 1066
 					break;
1067 1067
 				}
@@ -1070,9 +1070,9 @@  discard block
 block discarded – undo
1070 1070
 
1071 1071
 
1072 1072
 		// Get field from group.
1073
-		if ( ! empty( $group_id ) ) {
1074
-			foreach ( $setting_field['fields'] as $field ) {
1075
-				if ( array_key_exists( 'id', $field ) && $field['id'] === $_field_id ) {
1073
+		if ( ! empty($group_id)) {
1074
+			foreach ($setting_field['fields'] as $field) {
1075
+				if (array_key_exists('id', $field) && $field['id'] === $_field_id) {
1076 1076
 					$setting_field = $field;
1077 1077
 				}
1078 1078
 			}
@@ -1091,14 +1091,14 @@  discard block
 block discarded – undo
1091 1091
 	 *
1092 1092
 	 * @return mixed
1093 1093
 	 */
1094
-	function add_offline_donations_setting_tab( $settings ) {
1095
-		if ( give_is_gateway_active( 'offline' ) ) {
1096
-			$settings['offline_donations_options'] = apply_filters( 'give_forms_offline_donations_options', array(
1094
+	function add_offline_donations_setting_tab($settings) {
1095
+		if (give_is_gateway_active('offline')) {
1096
+			$settings['offline_donations_options'] = apply_filters('give_forms_offline_donations_options', array(
1097 1097
 				'id'        => 'offline_donations_options',
1098
-				'title'     => __( 'Offline Donations', 'give' ),
1098
+				'title'     => __('Offline Donations', 'give'),
1099 1099
 				'icon-html' => '<span class="give-icon give-icon-purse"></span>',
1100
-				'fields'    => apply_filters( 'give_forms_offline_donations_metabox_fields', array() ),
1101
-			) );
1100
+				'fields'    => apply_filters('give_forms_offline_donations_metabox_fields', array()),
1101
+			));
1102 1102
 		}
1103 1103
 
1104 1104
 		return $settings;
@@ -1116,22 +1116,22 @@  discard block
 block discarded – undo
1116 1116
 	 *
1117 1117
 	 * @return mixed
1118 1118
 	 */
1119
-	function sanitize_form_meta( $meta_value, $setting_field ) {
1120
-		switch ( $setting_field['type'] ) {
1119
+	function sanitize_form_meta($meta_value, $setting_field) {
1120
+		switch ($setting_field['type']) {
1121 1121
 			case 'group':
1122
-				if ( ! empty( $setting_field['fields'] ) ) {
1123
-					foreach ( $setting_field['fields'] as $field ) {
1124
-						if ( empty( $field['data_type'] ) || 'price' !== $field['data_type'] ) {
1122
+				if ( ! empty($setting_field['fields'])) {
1123
+					foreach ($setting_field['fields'] as $field) {
1124
+						if (empty($field['data_type']) || 'price' !== $field['data_type']) {
1125 1125
 							continue;
1126 1126
 						}
1127 1127
 
1128
-						foreach ( $meta_value as $index => $meta_data ) {
1129
-							if( ! isset( $meta_value[ $index ][ $field['id'] ] ) ) {
1128
+						foreach ($meta_value as $index => $meta_data) {
1129
+							if ( ! isset($meta_value[$index][$field['id']])) {
1130 1130
 								continue;
1131 1131
 							}
1132 1132
 
1133
-							$meta_value[ $index ][ $field['id'] ] = ! empty( $meta_value[ $index ][ $field['id'] ] )
1134
-								? give_sanitize_amount_for_db( $meta_value[ $index ][ $field['id'] ] )
1133
+							$meta_value[$index][$field['id']] = ! empty($meta_value[$index][$field['id']])
1134
+								? give_sanitize_amount_for_db($meta_value[$index][$field['id']])
1135 1135
 								: 0;
1136 1136
 						}
1137 1137
 					}
@@ -1139,8 +1139,8 @@  discard block
 block discarded – undo
1139 1139
 				break;
1140 1140
 
1141 1141
 			default:
1142
-				if ( ! empty( $setting_field['data_type'] ) && 'price' === $setting_field['data_type'] ) {
1143
-					$meta_value = $meta_value ? give_sanitize_amount_for_db( $meta_value ) : 0;
1142
+				if ( ! empty($setting_field['data_type']) && 'price' === $setting_field['data_type']) {
1143
+					$meta_value = $meta_value ? give_sanitize_amount_for_db($meta_value) : 0;
1144 1144
 				}
1145 1145
 		}
1146 1146
 
Please login to merge, or discard this patch.
includes/emails/class-give-emails.php 1 patch
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
  */
13 13
 
14 14
 // Exit if accessed directly.
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
 	 */
88 88
 	public function __construct() {
89 89
 
90
-		if ( 'none' === $this->get_template() ) {
90
+		if ('none' === $this->get_template()) {
91 91
 			$this->html = false;
92 92
 		}
93 93
 
94
-		add_action( 'give_email_send_before', array( $this, 'send_before' ) );
95
-		add_action( 'give_email_send_after', array( $this, 'send_after' ) );
94
+		add_action('give_email_send_before', array($this, 'send_before'));
95
+		add_action('give_email_send_after', array($this, 'send_after'));
96 96
 
97 97
 	}
98 98
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 	 * @param $key
105 105
 	 * @param $value
106 106
 	 */
107
-	public function __set( $key, $value ) {
107
+	public function __set($key, $value) {
108 108
 		$this->$key = $value;
109 109
 	}
110 110
 
@@ -114,11 +114,11 @@  discard block
 block discarded – undo
114 114
 	 * @since 1.0
115 115
 	 */
116 116
 	public function get_from_name() {
117
-		if ( ! $this->from_name ) {
118
-			$this->from_name = give_get_option( 'from_name', get_bloginfo( 'name' ) );
117
+		if ( ! $this->from_name) {
118
+			$this->from_name = give_get_option('from_name', get_bloginfo('name'));
119 119
 		}
120 120
 
121
-		return apply_filters( 'give_email_from_name', wp_specialchars_decode( $this->from_name ), $this );
121
+		return apply_filters('give_email_from_name', wp_specialchars_decode($this->from_name), $this);
122 122
 	}
123 123
 
124 124
 	/**
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
 	 * @since 1.0
128 128
 	 */
129 129
 	public function get_from_address() {
130
-		if ( ! $this->from_address ) {
131
-			$this->from_address = give_get_option( 'from_email', get_option( 'admin_email' ) );
130
+		if ( ! $this->from_address) {
131
+			$this->from_address = give_get_option('from_email', get_option('admin_email'));
132 132
 		}
133 133
 
134
-		return apply_filters( 'give_email_from_address', $this->from_address, $this );
134
+		return apply_filters('give_email_from_address', $this->from_address, $this);
135 135
 	}
136 136
 
137 137
 	/**
@@ -140,13 +140,13 @@  discard block
 block discarded – undo
140 140
 	 * @since 1.0
141 141
 	 */
142 142
 	public function get_content_type() {
143
-		if ( ! $this->content_type && $this->html ) {
144
-			$this->content_type = apply_filters( 'give_email_default_content_type', 'text/html', $this );
145
-		} else if ( ! $this->html ) {
143
+		if ( ! $this->content_type && $this->html) {
144
+			$this->content_type = apply_filters('give_email_default_content_type', 'text/html', $this);
145
+		} else if ( ! $this->html) {
146 146
 			$this->content_type = 'text/plain';
147 147
 		}
148 148
 
149
-		return apply_filters( 'give_email_content_type', $this->content_type, $this );
149
+		return apply_filters('give_email_content_type', $this->content_type, $this);
150 150
 	}
151 151
 
152 152
 	/**
@@ -155,13 +155,13 @@  discard block
 block discarded – undo
155 155
 	 * @since 1.0
156 156
 	 */
157 157
 	public function get_headers() {
158
-		if ( ! $this->headers ) {
158
+		if ( ! $this->headers) {
159 159
 			$this->headers = "From: {$this->get_from_name()} <{$this->get_from_address()}>\r\n";
160 160
 			$this->headers .= "Reply-To: {$this->get_from_address()}\r\n";
161 161
 			$this->headers .= "Content-Type: {$this->get_content_type()}; charset=utf-8\r\n";
162 162
 		}
163 163
 
164
-		return apply_filters( 'give_email_headers', $this->headers, $this );
164
+		return apply_filters('give_email_headers', $this->headers, $this);
165 165
 	}
166 166
 
167 167
 	/**
@@ -171,11 +171,11 @@  discard block
 block discarded – undo
171 171
 	 */
172 172
 	public function get_templates() {
173 173
 		$templates = array(
174
-			'default' => esc_html__( 'Default Template', 'give' ),
175
-			'none'    => esc_html__( 'No template, plain text only', 'give' )
174
+			'default' => esc_html__('Default Template', 'give'),
175
+			'none'    => esc_html__('No template, plain text only', 'give')
176 176
 		);
177 177
 
178
-		return apply_filters( 'give_email_templates', $templates );
178
+		return apply_filters('give_email_templates', $templates);
179 179
 	}
180 180
 
181 181
 	/**
@@ -184,11 +184,11 @@  discard block
 block discarded – undo
184 184
 	 * @since 1.0
185 185
 	 */
186 186
 	public function get_template() {
187
-		if ( ! $this->template ) {
188
-			$this->template = give_get_option( 'email_template', 'default' );
187
+		if ( ! $this->template) {
188
+			$this->template = give_get_option('email_template', 'default');
189 189
 		}
190 190
 
191
-		return apply_filters( 'give_email_template', $this->template );
191
+		return apply_filters('give_email_template', $this->template);
192 192
 	}
193 193
 
194 194
 	/**
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 	 * @since 1.0
198 198
 	 */
199 199
 	public function get_heading() {
200
-		return apply_filters( 'give_email_heading', $this->heading );
200
+		return apply_filters('give_email_heading', $this->heading);
201 201
 	}
202 202
 
203 203
 	/**
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	 *
208 208
 	 * @return mixed
209 209
 	 */
210
-	public function parse_tags( $content ) {
210
+	public function parse_tags($content) {
211 211
 		return $content;
212 212
 	}
213 213
 
@@ -220,19 +220,19 @@  discard block
 block discarded – undo
220 220
 	 *
221 221
 	 * @return string
222 222
 	 */
223
-	public function build_email( $message ) {
223
+	public function build_email($message) {
224 224
 
225
-		if ( false === $this->html ) {
226
-			return apply_filters( 'give_email_message', wp_strip_all_tags( $message ), $this );
225
+		if (false === $this->html) {
226
+			return apply_filters('give_email_message', wp_strip_all_tags($message), $this);
227 227
 		}
228 228
 
229
-		$message = $this->text_to_html( $message );
229
+		$message = $this->text_to_html($message);
230 230
 
231 231
 		$template = $this->get_template();
232 232
 
233 233
 		ob_start();
234 234
 
235
-		give_get_template_part( 'emails/header', $template, true );
235
+		give_get_template_part('emails/header', $template, true);
236 236
 
237 237
 		/**
238 238
 		 * Fires in the email head.
@@ -241,17 +241,17 @@  discard block
 block discarded – undo
241 241
 		 *
242 242
 		 * @param Give_Emails $this The email object.
243 243
 		 */
244
-		do_action( 'give_email_header', $this );
244
+		do_action('give_email_header', $this);
245 245
 
246
-		if ( has_action( 'give_email_template_' . $template ) ) {
246
+		if (has_action('give_email_template_'.$template)) {
247 247
 			/**
248 248
 			 * Fires in a specific email template.
249 249
 			 *
250 250
 			 * @since 1.0
251 251
 			 */
252
-			do_action( "give_email_template_{$template}" );
252
+			do_action("give_email_template_{$template}");
253 253
 		} else {
254
-			give_get_template_part( 'emails/body', $template, true );
254
+			give_get_template_part('emails/body', $template, true);
255 255
 		}
256 256
 
257 257
 		/**
@@ -261,9 +261,9 @@  discard block
 block discarded – undo
261 261
 		 *
262 262
 		 * @param Give_Emails $this The email object.
263 263
 		 */
264
-		do_action( 'give_email_body', $this );
264
+		do_action('give_email_body', $this);
265 265
 
266
-		give_get_template_part( 'emails/footer', $template, true );
266
+		give_get_template_part('emails/footer', $template, true);
267 267
 
268 268
 		/**
269 269
 		 * Fires in the email footer.
@@ -272,12 +272,12 @@  discard block
 block discarded – undo
272 272
 		 *
273 273
 		 * @param Give_Emails $this The email object.
274 274
 		 */
275
-		do_action( 'give_email_footer', $this );
275
+		do_action('give_email_footer', $this);
276 276
 
277 277
 		$body    = ob_get_clean();
278
-		$message = str_replace( '{email}', $message, $body );
278
+		$message = str_replace('{email}', $message, $body);
279 279
 
280
-		return apply_filters( 'give_email_message', $message, $this );
280
+		return apply_filters('give_email_message', $message, $this);
281 281
 	}
282 282
 
283 283
 	/**
@@ -290,10 +290,10 @@  discard block
 block discarded – undo
290 290
 	 *
291 291
 	 * @return bool
292 292
 	 */
293
-	public function send( $to, $subject, $message, $attachments = '' ) {
293
+	public function send($to, $subject, $message, $attachments = '') {
294 294
 
295
-		if ( ! did_action( 'init' ) && ! did_action( 'admin_init' ) ) {
296
-			_doing_it_wrong( __FUNCTION__, esc_html__( 'You cannot send email with Give_Emails until init/admin_init has been reached.', 'give' ), null );
295
+		if ( ! did_action('init') && ! did_action('admin_init')) {
296
+			_doing_it_wrong(__FUNCTION__, esc_html__('You cannot send email with Give_Emails until init/admin_init has been reached.', 'give'), null);
297 297
 
298 298
 			return false;
299 299
 		}
@@ -305,16 +305,16 @@  discard block
 block discarded – undo
305 305
 		 *
306 306
 		 * @param Give_Emails $this The email object.
307 307
 		 */
308
-		do_action( 'give_email_send_before', $this );
308
+		do_action('give_email_send_before', $this);
309 309
 
310
-		$subject = $this->parse_tags( $subject );
311
-		$message = $this->parse_tags( $message );
310
+		$subject = $this->parse_tags($subject);
311
+		$message = $this->parse_tags($message);
312 312
 
313
-		$message = $this->build_email( $message );
313
+		$message = $this->build_email($message);
314 314
 
315
-		$attachments = apply_filters( 'give_email_attachments', $attachments, $this );
315
+		$attachments = apply_filters('give_email_attachments', $attachments, $this);
316 316
 
317
-		$sent = wp_mail( $to, $subject, $message, $this->get_headers(), $attachments );
317
+		$sent = wp_mail($to, $subject, $message, $this->get_headers(), $attachments);
318 318
 
319 319
 		/**
320 320
 		 * Fires after sending an email.
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 		 *
324 324
 		 * @param Give_Emails $this The email object.
325 325
 		 */
326
-		do_action( 'give_email_send_after', $this );
326
+		do_action('give_email_send_after', $this);
327 327
 
328 328
 		return $sent;
329 329
 
@@ -335,9 +335,9 @@  discard block
 block discarded – undo
335 335
 	 * @since 1.0
336 336
 	 */
337 337
 	public function send_before() {
338
-		add_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );
339
-		add_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );
340
-		add_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );
338
+		add_filter('wp_mail_from', array($this, 'get_from_address'));
339
+		add_filter('wp_mail_from_name', array($this, 'get_from_name'));
340
+		add_filter('wp_mail_content_type', array($this, 'get_content_type'));
341 341
 	}
342 342
 
343 343
 	/**
@@ -346,9 +346,9 @@  discard block
 block discarded – undo
346 346
 	 * @since 1.0
347 347
 	 */
348 348
 	public function send_after() {
349
-		remove_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );
350
-		remove_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );
351
-		remove_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );
349
+		remove_filter('wp_mail_from', array($this, 'get_from_address'));
350
+		remove_filter('wp_mail_from_name', array($this, 'get_from_name'));
351
+		remove_filter('wp_mail_content_type', array($this, 'get_content_type'));
352 352
 
353 353
 		// Reset heading to an empty string
354 354
 		$this->heading = '';
@@ -359,10 +359,10 @@  discard block
 block discarded – undo
359 359
 	 *
360 360
 	 * @since 1.0
361 361
 	 */
362
-	public function text_to_html( $message ) {
362
+	public function text_to_html($message) {
363 363
 
364
-		if ( 'text/html' == $this->content_type || true === $this->html ) {
365
-			$message = wpautop( $message );
364
+		if ('text/html' == $this->content_type || true === $this->html) {
365
+			$message = wpautop($message);
366 366
 		}
367 367
 
368 368
 		return $message;
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-gateways.php 2 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
 								'disabled' => __( 'Disabled', 'give' ),
87 87
 							)
88 88
 						),
89
-                        array(
90
-                            'name'  => __( 'PayPal Standard Gateway Settings Docs Link', 'give' ),
91
-                            'id'    => 'paypal_standard_gateway_settings_docs_link',
92
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-gateway-paypal-standard' ),
93
-                            'title' => __( 'PayPal Standard Gateway Settings', 'give' ),
94
-                            'type'  => 'give_docs_link',
95
-                        ),
89
+						array(
90
+							'name'  => __( 'PayPal Standard Gateway Settings Docs Link', 'give' ),
91
+							'id'    => 'paypal_standard_gateway_settings_docs_link',
92
+							'url'   => esc_url( 'http://docs.givewp.com/settings-gateway-paypal-standard' ),
93
+							'title' => __( 'PayPal Standard Gateway Settings', 'give' ),
94
+							'type'  => 'give_docs_link',
95
+						),
96 96
 						array(
97 97
 							'type' => 'sectionend',
98 98
 							'id'   => 'give_title_gateway_settings_2',
@@ -145,13 +145,13 @@  discard block
 block discarded – undo
145 145
 								'textarea_rows' => 6,
146 146
 							)
147 147
 						),
148
-                        array(
149
-                            'name'  => __( 'Offline Donations Settings Docs Link', 'give' ),
150
-                            'id'    => 'offline_gateway_settings_docs_link',
151
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-gateway-offline-donations' ),
152
-                            'title' => __( 'Offline Gateway Settings', 'give' ),
153
-                            'type'  => 'give_docs_link',
154
-                        ),
148
+						array(
149
+							'name'  => __( 'Offline Donations Settings Docs Link', 'give' ),
150
+							'id'    => 'offline_gateway_settings_docs_link',
151
+							'url'   => esc_url( 'http://docs.givewp.com/settings-gateway-offline-donations' ),
152
+							'title' => __( 'Offline Gateway Settings', 'give' ),
153
+							'type'  => 'give_docs_link',
154
+						),
155 155
 						array(
156 156
 							'type' => 'sectionend',
157 157
 							'id'   => 'give_title_gateway_settings_3',
@@ -189,13 +189,13 @@  discard block
 block discarded – undo
189 189
 							'id'   => 'default_gateway',
190 190
 							'type' => 'default_gateway'
191 191
 						),
192
-                        array(
193
-                            'name'  => __( 'Gateways Docs Link', 'give' ),
194
-                            'id'    => 'gateway_settings_docs_link',
195
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-gateways' ),
196
-                            'title' => __( 'Gateway Settings', 'give' ),
197
-                            'type'  => 'give_docs_link',
198
-                        ),
192
+						array(
193
+							'name'  => __( 'Gateways Docs Link', 'give' ),
194
+							'id'    => 'gateway_settings_docs_link',
195
+							'url'   => esc_url( 'http://docs.givewp.com/settings-gateways' ),
196
+							'title' => __( 'Gateway Settings', 'give' ),
197
+							'type'  => 'give_docs_link',
198
+						),
199 199
 						array(
200 200
 							'id'   => 'give_title_gateway_settings_1',
201 201
 							'type' => 'sectionend'
Please login to merge, or discard this patch.
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Gateways' ) ) :
16
+if ( ! class_exists('Give_Settings_Gateways')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Gateways.
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		 */
28 28
 		public function __construct() {
29 29
 			$this->id    = 'gateways';
30
-			$this->label = esc_html__( 'Payment Gateways', 'give' );
30
+			$this->label = esc_html__('Payment Gateways', 'give');
31 31
 
32 32
 			$this->default_tab = 'gateways-settings';
33 33
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 			$settings        = array();
45 45
 			$current_section = give_get_current_setting_section();
46 46
 
47
-			switch ( $current_section ) {
47
+			switch ($current_section) {
48 48
 				case 'paypal-standard':
49 49
 					$settings = array(
50 50
 						// Section 2: PayPal Standard.
@@ -53,55 +53,55 @@  discard block
 block discarded – undo
53 53
 							'id'   => 'give_title_gateway_settings_2',
54 54
 						),
55 55
 						array(
56
-							'name' => __( 'PayPal Email', 'give' ),
57
-							'desc' => __( 'Enter your PayPal account\'s email.', 'give' ),
56
+							'name' => __('PayPal Email', 'give'),
57
+							'desc' => __('Enter your PayPal account\'s email.', 'give'),
58 58
 							'id'   => 'paypal_email',
59 59
 							'type' => 'email',
60 60
 						),
61 61
 						array(
62
-							'name' => __( 'PayPal Page Style', 'give' ),
63
-							'desc' => __( 'Enter the name of the PayPal page style to use, or leave blank to use the default.', 'give' ),
62
+							'name' => __('PayPal Page Style', 'give'),
63
+							'desc' => __('Enter the name of the PayPal page style to use, or leave blank to use the default.', 'give'),
64 64
 							'id'   => 'paypal_page_style',
65 65
 							'type' => 'text',
66 66
 						),
67 67
 						array(
68
-							'name'    => __( 'PayPal Transaction Type', 'give' ),
69
-							'desc'    => __( 'Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give' ),
68
+							'name'    => __('PayPal Transaction Type', 'give'),
69
+							'desc'    => __('Nonprofits must verify their status to withdraw donations they receive via PayPal. PayPal users that are not verified nonprofits must demonstrate how their donations will be used, once they raise more than $10,000. By default, Give transactions are sent to PayPal as donations. You may change the transaction type using this option if you feel you may not meet PayPal\'s donation requirements.', 'give'),
70 70
 							'id'      => 'paypal_button_type',
71 71
 							'type'    => 'radio_inline',
72 72
 							'options' => array(
73
-								'donation' => __( 'Donation', 'give' ),
74
-								'standard' => __( 'Standard Transaction', 'give' )
73
+								'donation' => __('Donation', 'give'),
74
+								'standard' => __('Standard Transaction', 'give')
75 75
 							),
76 76
 							'default' => 'donation',
77 77
 						),
78 78
 						array(
79
-							'name'    => __( 'Billing Details', 'give' ),
80
-							'desc'    => __( 'This option will enable the billing details section for PayPal Standard which requires the donor\'s address to complete the donation. These fields are not required by PayPal to process the transaction, but you may have a need to collect the data.', 'give' ),
79
+							'name'    => __('Billing Details', 'give'),
80
+							'desc'    => __('This option will enable the billing details section for PayPal Standard which requires the donor\'s address to complete the donation. These fields are not required by PayPal to process the transaction, but you may have a need to collect the data.', 'give'),
81 81
 							'id'      => 'paypal_standard_billing_details',
82 82
 							'type'    => 'radio_inline',
83 83
 							'default' => 'disabled',
84 84
 							'options' => array(
85
-								'enabled'  => __( 'Enabled', 'give' ),
86
-								'disabled' => __( 'Disabled', 'give' ),
85
+								'enabled'  => __('Enabled', 'give'),
86
+								'disabled' => __('Disabled', 'give'),
87 87
 							)
88 88
 						),
89 89
 						array(
90
-							'name'    => __( 'PayPal IPN Verification', 'give' ),
91
-							'desc'    => __( 'If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give' ),
90
+							'name'    => __('PayPal IPN Verification', 'give'),
91
+							'desc'    => __('If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give'),
92 92
 							'id'      => 'paypal_verification',
93 93
 							'type'    => 'radio_inline',
94 94
 							'default' => 'enabled',
95 95
 							'options' => array(
96
-								'enabled'  => __( 'Enabled', 'give' ),
97
-								'disabled' => __( 'Disabled', 'give' ),
96
+								'enabled'  => __('Enabled', 'give'),
97
+								'disabled' => __('Disabled', 'give'),
98 98
 							)
99 99
 						),
100 100
                         array(
101
-                            'name'  => __( 'PayPal Standard Gateway Settings Docs Link', 'give' ),
101
+                            'name'  => __('PayPal Standard Gateway Settings Docs Link', 'give'),
102 102
                             'id'    => 'paypal_standard_gateway_settings_docs_link',
103
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-gateway-paypal-standard' ),
104
-                            'title' => __( 'PayPal Standard Gateway Settings', 'give' ),
103
+                            'url'   => esc_url('http://docs.givewp.com/settings-gateway-paypal-standard'),
104
+                            'title' => __('PayPal Standard Gateway Settings', 'give'),
105 105
                             'type'  => 'give_docs_link',
106 106
                         ),
107 107
 						array(
@@ -119,19 +119,19 @@  discard block
 block discarded – undo
119 119
 							'id'   => 'give_title_gateway_settings_3',
120 120
 						),
121 121
 						array(
122
-							'name'    => __( 'Collect Billing Details', 'give' ),
123
-							'desc'    => __( 'Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give' ),
122
+							'name'    => __('Collect Billing Details', 'give'),
123
+							'desc'    => __('Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give'),
124 124
 							'id'      => 'give_offline_donation_enable_billing_fields',
125 125
 							'type'    => 'radio_inline',
126 126
 							'default' => 'disabled',
127 127
 							'options' => array(
128
-								'enabled'  => __( 'Enabled', 'give' ),
129
-								'disabled' => __( 'Disabled', 'give' )
128
+								'enabled'  => __('Enabled', 'give'),
129
+								'disabled' => __('Disabled', 'give')
130 130
 							)
131 131
 						),
132 132
 						array(
133
-							'name'    => __( 'Offline Donation Instructions', 'give' ),
134
-							'desc'    => __( 'The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give' ),
133
+							'name'    => __('Offline Donation Instructions', 'give'),
134
+							'desc'    => __('The following content will appear for all forms when the user selects the offline donation payment option. Note: You may customize the content per form as needed.', 'give'),
135 135
 							'id'      => 'global_offline_donation_content',
136 136
 							'default' => give_get_default_offline_donation_content(),
137 137
 							'type'    => 'wysiwyg',
@@ -140,15 +140,15 @@  discard block
 block discarded – undo
140 140
 							)
141 141
 						),
142 142
 						array(
143
-							'name'    => __( 'Offline Donation Email Instructions Subject', 'give' ),
144
-							'desc'    => __( 'Enter the subject line for the donation receipt email.', 'give' ),
143
+							'name'    => __('Offline Donation Email Instructions Subject', 'give'),
144
+							'desc'    => __('Enter the subject line for the donation receipt email.', 'give'),
145 145
 							'id'      => 'offline_donation_subject',
146
-							'default' => esc_attr__( '{donation} - Offline Donation Instructions', 'give' ),
146
+							'default' => esc_attr__('{donation} - Offline Donation Instructions', 'give'),
147 147
 							'type'    => 'text'
148 148
 						),
149 149
 						array(
150
-							'name'    => __( 'Offline Donation Email Instructions', 'give' ),
151
-							'desc'    => __( 'Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give' ) . ' ' . __( 'Available template tags:', 'give' ) . give_get_emails_tags_list(),
150
+							'name'    => __('Offline Donation Email Instructions', 'give'),
151
+							'desc'    => __('Enter the instructions you want emailed to the donor after they have submitted the donation form. Most likely this would include important information like mailing address and who to make the check out to.', 'give').' '.__('Available template tags:', 'give').give_get_emails_tags_list(),
152 152
 							'id'      => 'global_offline_donation_email',
153 153
 							'default' => give_get_default_offline_donation_email_content(),
154 154
 							'type'    => 'wysiwyg',
@@ -157,10 +157,10 @@  discard block
 block discarded – undo
157 157
 							)
158 158
 						),
159 159
                         array(
160
-                            'name'  => __( 'Offline Donations Settings Docs Link', 'give' ),
160
+                            'name'  => __('Offline Donations Settings Docs Link', 'give'),
161 161
                             'id'    => 'offline_gateway_settings_docs_link',
162
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-gateway-offline-donations' ),
163
-                            'title' => __( 'Offline Gateway Settings', 'give' ),
162
+                            'url'   => esc_url('http://docs.givewp.com/settings-gateway-offline-donations'),
163
+                            'title' => __('Offline Gateway Settings', 'give'),
164 164
                             'type'  => 'give_docs_link',
165 165
                         ),
166 166
 						array(
@@ -178,33 +178,33 @@  discard block
 block discarded – undo
178 178
 							'type' => 'title'
179 179
 						),
180 180
 						array(
181
-							'name'    => __( 'Test Mode', 'give' ),
182
-							'desc'    => __( 'While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give' ),
181
+							'name'    => __('Test Mode', 'give'),
182
+							'desc'    => __('While in test mode no live donations are processed. To fully use test mode, you must have a sandbox (test) account for the payment gateway you are testing.', 'give'),
183 183
 							'id'      => 'test_mode',
184 184
 							'type'    => 'radio_inline',
185 185
 							'default' => 'disabled',
186 186
 							'options' => array(
187
-								'enabled'  => __( 'Enabled', 'give' ),
188
-								'disabled' => __( 'Disabled', 'give' ),
187
+								'enabled'  => __('Enabled', 'give'),
188
+								'disabled' => __('Disabled', 'give'),
189 189
 							)
190 190
 						),
191 191
 						array(
192
-							'name' => __( 'Enabled Gateways', 'give' ),
193
-							'desc' => __( 'Enable your payment gateway. Can be ordered by dragging.', 'give' ),
192
+							'name' => __('Enabled Gateways', 'give'),
193
+							'desc' => __('Enable your payment gateway. Can be ordered by dragging.', 'give'),
194 194
 							'id'   => 'gateways',
195 195
 							'type' => 'enabled_gateways'
196 196
 						),
197 197
 						array(
198
-							'name' => __( 'Default Gateway', 'give' ),
199
-							'desc' => __( 'The gateway that will be selected by default.', 'give' ),
198
+							'name' => __('Default Gateway', 'give'),
199
+							'desc' => __('The gateway that will be selected by default.', 'give'),
200 200
 							'id'   => 'default_gateway',
201 201
 							'type' => 'default_gateway'
202 202
 						),
203 203
                         array(
204
-                            'name'  => __( 'Gateways Docs Link', 'give' ),
204
+                            'name'  => __('Gateways Docs Link', 'give'),
205 205
                             'id'    => 'gateway_settings_docs_link',
206
-                            'url'   => esc_url( 'http://docs.givewp.com/settings-gateways' ),
207
-                            'title' => __( 'Gateway Settings', 'give' ),
206
+                            'url'   => esc_url('http://docs.givewp.com/settings-gateways'),
207
+                            'title' => __('Gateway Settings', 'give'),
208 208
                             'type'  => 'give_docs_link',
209 209
                         ),
210 210
 						array(
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 			 * Filter the payment gateways settings.
220 220
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
221 221
 			 */
222
-			$settings = apply_filters( 'give_settings_gateways', $settings );
222
+			$settings = apply_filters('give_settings_gateways', $settings);
223 223
 
224 224
 			/**
225 225
 			 * Filter the settings.
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 			 *
229 229
 			 * @param  array $settings
230 230
 			 */
231
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
231
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
232 232
 
233 233
 			// Output.
234 234
 			return $settings;
@@ -242,12 +242,12 @@  discard block
 block discarded – undo
242 242
 		 */
243 243
 		public function get_sections() {
244 244
 			$sections = array(
245
-				'gateways-settings' => __( 'Gateways', 'give' ),
246
-				'paypal-standard'   => __( 'PayPal Standard', 'give' ),
247
-				'offline-donations' => __( 'Offline Donations', 'give' )
245
+				'gateways-settings' => __('Gateways', 'give'),
246
+				'paypal-standard'   => __('PayPal Standard', 'give'),
247
+				'offline-donations' => __('Offline Donations', 'give')
248 248
 			);
249 249
 
250
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
250
+			return apply_filters('give_get_sections_'.$this->id, $sections);
251 251
 		}
252 252
 	}
253 253
 
Please login to merge, or discard this patch.
includes/class-give-email-access.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -232,7 +232,7 @@
 block discarded – undo
232 232
 	 * @since  1.0
233 233
 	 * @access public
234 234
 	 *
235
-	 * @return bool
235
+	 * @return null|boolean
236 236
 	 */
237 237
 	public function check_for_token() {
238 238
 
Please login to merge, or discard this patch.
Spacing   +61 added lines, -61 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
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	public function __construct() {
97 97
 
98 98
 		// get it started
99
-		add_action( 'init', array( $this, 'init' ) );
99
+		add_action('init', array($this, 'init'));
100 100
 	}
101 101
 
102 102
 	/**
@@ -120,29 +120,29 @@  discard block
 block discarded – undo
120 120
 		 */
121 121
 		if (
122 122
 			is_user_logged_in()
123
-			|| ! give_is_setting_enabled( give_get_option( 'email_access' ) )
123
+			|| ! give_is_setting_enabled(give_get_option('email_access'))
124 124
 			|| is_admin()
125 125
 		) {
126 126
 			return;
127 127
 		}
128 128
 
129 129
 		// Are db columns setup?
130
-		$is_setup = give_get_option( 'email_access_installed' );
131
-		if ( empty( $is_setup ) ) {
130
+		$is_setup = give_get_option('email_access_installed');
131
+		if (empty($is_setup)) {
132 132
 			$this->create_columns();
133 133
 		}
134 134
 
135 135
 		// Timeouts.
136
-		$this->verify_throttle  = apply_filters( 'give_nl_verify_throttle', 300 );
137
-		$this->token_expiration = apply_filters( 'give_nl_token_expiration', 7200 );
136
+		$this->verify_throttle  = apply_filters('give_nl_verify_throttle', 300);
137
+		$this->token_expiration = apply_filters('give_nl_token_expiration', 7200);
138 138
 
139 139
 		// Setup login.
140 140
 		$this->check_for_token();
141 141
 
142
-		if ( $this->token_exists ) {
143
-			add_filter( 'give_can_view_receipt', '__return_true' );
144
-			add_filter( 'give_user_pending_verification', '__return_false' );
145
-			add_filter( 'give_get_users_donations_args', array( $this, 'users_donations_args' ) );
142
+		if ($this->token_exists) {
143
+			add_filter('give_can_view_receipt', '__return_true');
144
+			add_filter('give_user_pending_verification', '__return_false');
145
+			add_filter('give_get_users_donations_args', array($this, 'users_donations_args'));
146 146
 		}
147 147
 
148 148
 	}
@@ -157,25 +157,25 @@  discard block
 block discarded – undo
157 157
 	 *
158 158
 	 * @return bool
159 159
 	 */
160
-	public function can_send_email( $customer_id ) {
160
+	public function can_send_email($customer_id) {
161 161
 		/* @var WPDB $wpdb */
162 162
 		global $wpdb;
163 163
 
164 164
 		// Prevent multiple emails within X minutes
165
-		$throttle = date( 'Y-m-d H:i:s', time() - $this->verify_throttle );
165
+		$throttle = date('Y-m-d H:i:s', time() - $this->verify_throttle);
166 166
 
167 167
 		// Does a user row exist?
168 168
 		$exists = (int) $wpdb->get_var(
169
-			$wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->prefix}give_customers WHERE id = %d", $customer_id )
169
+			$wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->prefix}give_customers WHERE id = %d", $customer_id)
170 170
 		);
171 171
 
172
-		if ( 0 < $exists ) {
172
+		if (0 < $exists) {
173 173
 			$row_id = (int) $wpdb->get_var(
174
-				$wpdb->prepare( "SELECT id FROM {$wpdb->prefix}give_customers WHERE id = %d AND (verify_throttle < %s OR verify_key = '') LIMIT 1", $customer_id, $throttle )
174
+				$wpdb->prepare("SELECT id FROM {$wpdb->prefix}give_customers WHERE id = %d AND (verify_throttle < %s OR verify_key = '') LIMIT 1", $customer_id, $throttle)
175 175
 			);
176 176
 
177
-			if ( $row_id < 1 ) {
178
-				give_set_error( 'give_email_access_attempts_exhausted', __( 'Please wait a few minutes before requesting a new email access link.', 'give' ) );
177
+			if ($row_id < 1) {
178
+				give_set_error('give_email_access_attempts_exhausted', __('Please wait a few minutes before requesting a new email access link.', 'give'));
179 179
 
180 180
 				return false;
181 181
 			}
@@ -195,34 +195,34 @@  discard block
 block discarded – undo
195 195
 	 *
196 196
 	 * @return void
197 197
 	 */
198
-	public function send_email( $customer_id, $email ) {
198
+	public function send_email($customer_id, $email) {
199 199
 
200
-		$verify_key = wp_generate_password( 20, false );
200
+		$verify_key = wp_generate_password(20, false);
201 201
 
202 202
 		// Generate a new verify key
203
-		$this->set_verify_key( $customer_id, $email, $verify_key );
203
+		$this->set_verify_key($customer_id, $email, $verify_key);
204 204
 
205 205
 		// Get the donation history page
206
-		$page_id = give_get_option( 'history_page' );
206
+		$page_id = give_get_option('history_page');
207 207
 
208
-		$access_url = add_query_arg( array(
208
+		$access_url = add_query_arg(array(
209 209
 			'give_nl' => $verify_key,
210
-		), get_permalink( $page_id ) );
210
+		), get_permalink($page_id));
211 211
 
212 212
 		// Nice subject and message.
213
-		$subject = apply_filters( 'give_email_access_token_subject', sprintf( __( 'Your Access Link to %s', 'give' ), get_bloginfo( 'name' ) ) );
213
+		$subject = apply_filters('give_email_access_token_subject', sprintf(__('Your Access Link to %s', 'give'), get_bloginfo('name')));
214 214
 
215
-		$message = __( 'You or someone in your organization requested an access link be sent to this email address. This is a temporary access link for you to view your donation information. Click on the link below to view:', 'give' ) . "\n\n";
216
-		$message .= '<a href="' . esc_url( $access_url ) . '" target="_blank">' . __( 'Access Donation Details &raquo;', 'give' ) . '</a>' . "\n\n";
215
+		$message = __('You or someone in your organization requested an access link be sent to this email address. This is a temporary access link for you to view your donation information. Click on the link below to view:', 'give')."\n\n";
216
+		$message .= '<a href="'.esc_url($access_url).'" target="_blank">'.__('Access Donation Details &raquo;', 'give').'</a>'."\n\n";
217 217
 		$message .= "\n\n";
218
-		$message .= __( 'Sincerely,', 'give' ) . "\n";
219
-		$message .= get_bloginfo( 'name' ) . "\n";
218
+		$message .= __('Sincerely,', 'give')."\n";
219
+		$message .= get_bloginfo('name')."\n";
220 220
 
221
-		$message = apply_filters( 'give_email_access_token_message', $message );
221
+		$message = apply_filters('give_email_access_token_message', $message);
222 222
 
223 223
 		// Send the email.
224
-		Give()->emails->__set( 'heading', apply_filters( 'give_email_access_token_heading', __( 'Your Access Link', 'give' ) ) );
225
-		Give()->emails->send( $email, $subject, $message );
224
+		Give()->emails->__set('heading', apply_filters('give_email_access_token_heading', __('Your Access Link', 'give')));
225
+		Give()->emails->send($email, $subject, $message);
226 226
 
227 227
 	}
228 228
 
@@ -236,26 +236,26 @@  discard block
 block discarded – undo
236 236
 	 */
237 237
 	public function check_for_token() {
238 238
 
239
-		$token = isset( $_GET['give_nl'] ) ? $_GET['give_nl'] : '';
239
+		$token = isset($_GET['give_nl']) ? $_GET['give_nl'] : '';
240 240
 
241 241
 		// Check for cookie.
242
-		if ( empty( $token ) ) {
243
-			$token = isset( $_COOKIE['give_nl'] ) ? $_COOKIE['give_nl'] : '';
242
+		if (empty($token)) {
243
+			$token = isset($_COOKIE['give_nl']) ? $_COOKIE['give_nl'] : '';
244 244
 		}
245 245
 
246 246
 		// Must have a token.
247
-		if ( ! empty( $token ) ) {
247
+		if ( ! empty($token)) {
248 248
 
249
-			if ( ! $this->is_valid_token( $token ) ) {
250
-				if ( ! $this->is_valid_verify_key( $token ) ) {
249
+			if ( ! $this->is_valid_token($token)) {
250
+				if ( ! $this->is_valid_verify_key($token)) {
251 251
 					return;
252 252
 				}
253 253
 			}
254 254
 
255 255
 			$this->token_exists = true;
256 256
 			// Set cookie.
257
-			$lifetime = current_time( 'timestamp' ) + Give()->session->set_expiration_time();
258
-			@setcookie( 'give_nl', $token, $lifetime, COOKIEPATH, COOKIE_DOMAIN, false );
257
+			$lifetime = current_time('timestamp') + Give()->session->set_expiration_time();
258
+			@setcookie('give_nl', $token, $lifetime, COOKIEPATH, COOKIE_DOMAIN, false);
259 259
 
260 260
 			return true;
261 261
 		}
@@ -271,26 +271,26 @@  discard block
 block discarded – undo
271 271
 	 *
272 272
 	 * @return bool
273 273
 	 */
274
-	public function is_valid_token( $token ) {
274
+	public function is_valid_token($token) {
275 275
 
276 276
 		global $wpdb;
277 277
 
278 278
 		// Make sure token isn't expired.
279
-		$expires = date( 'Y-m-d H:i:s', time() - $this->token_expiration );
279
+		$expires = date('Y-m-d H:i:s', time() - $this->token_expiration);
280 280
 
281 281
 		$email = $wpdb->get_var(
282
-			$wpdb->prepare( "SELECT email FROM {$wpdb->prefix}give_customers WHERE token = %s AND verify_throttle >= %s LIMIT 1", $token, $expires )
282
+			$wpdb->prepare("SELECT email FROM {$wpdb->prefix}give_customers WHERE token = %s AND verify_throttle >= %s LIMIT 1", $token, $expires)
283 283
 		);
284 284
 
285
-		if ( ! empty( $email ) ) {
285
+		if ( ! empty($email)) {
286 286
 			$this->token_email = $email;
287 287
 			$this->token       = $token;
288 288
 			return true;
289 289
 		}
290 290
 
291 291
 		// Set error only if email access form isn't being submitted
292
-		if ( ! isset( $_POST['give_email'] ) && ! isset( $_POST['_wpnonce'] ) ) {
293
-			give_set_error( 'give_email_token_expired', apply_filters( 'give_email_token_expired_message', __( 'Your access token has expired. Please request a new one below:', 'give' ) ) );
292
+		if ( ! isset($_POST['give_email']) && ! isset($_POST['_wpnonce'])) {
293
+			give_set_error('give_email_token_expired', apply_filters('give_email_token_expired_message', __('Your access token has expired. Please request a new one below:', 'give')));
294 294
 		}
295 295
 
296 296
 		return false;
@@ -309,25 +309,25 @@  discard block
 block discarded – undo
309 309
 	 *
310 310
 	 * @return void
311 311
 	 */
312
-	public function set_verify_key( $customer_id, $email, $verify_key ) {
312
+	public function set_verify_key($customer_id, $email, $verify_key) {
313 313
 		global $wpdb;
314 314
 
315
-		$now = date( 'Y-m-d H:i:s' );
315
+		$now = date('Y-m-d H:i:s');
316 316
 
317 317
 		// Insert or update?
318 318
 		$row_id = (int) $wpdb->get_var(
319
-			$wpdb->prepare( "SELECT id FROM {$wpdb->prefix}give_customers WHERE id = %d LIMIT 1", $customer_id )
319
+			$wpdb->prepare("SELECT id FROM {$wpdb->prefix}give_customers WHERE id = %d LIMIT 1", $customer_id)
320 320
 		);
321 321
 
322 322
 		// Update.
323
-		if ( ! empty( $row_id ) ) {
323
+		if ( ! empty($row_id)) {
324 324
 			$wpdb->query(
325
-				$wpdb->prepare( "UPDATE {$wpdb->prefix}give_customers SET verify_key = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $verify_key, $now, $row_id )
325
+				$wpdb->prepare("UPDATE {$wpdb->prefix}give_customers SET verify_key = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $verify_key, $now, $row_id)
326 326
 			);
327 327
 		} // Insert.
328 328
 		else {
329 329
 			$wpdb->query(
330
-				$wpdb->prepare( "INSERT INTO {$wpdb->prefix}give_customers ( verify_key, verify_throttle) VALUES (%s, %s)", $verify_key, $now )
330
+				$wpdb->prepare("INSERT INTO {$wpdb->prefix}give_customers ( verify_key, verify_throttle) VALUES (%s, %s)", $verify_key, $now)
331 331
 			);
332 332
 		}
333 333
 	}
@@ -342,21 +342,21 @@  discard block
 block discarded – undo
342 342
 	 *
343 343
 	 * @return bool
344 344
 	 */
345
-	public function is_valid_verify_key( $token ) {
345
+	public function is_valid_verify_key($token) {
346 346
 		/* @var WPDB $wpdb */
347 347
 		global $wpdb;
348 348
 
349 349
 		// See if the verify_key exists.
350 350
 		$row = $wpdb->get_row(
351
-			$wpdb->prepare( "SELECT id, email FROM {$wpdb->prefix}give_customers WHERE verify_key = %s LIMIT 1", $token )
351
+			$wpdb->prepare("SELECT id, email FROM {$wpdb->prefix}give_customers WHERE verify_key = %s LIMIT 1", $token)
352 352
 		);
353 353
 
354
-		$now = date( 'Y-m-d H:i:s' );
354
+		$now = date('Y-m-d H:i:s');
355 355
 
356 356
 		// Set token and remove verify key.
357
-		if ( ! empty( $row ) ) {
357
+		if ( ! empty($row)) {
358 358
 			$wpdb->query(
359
-				$wpdb->prepare( "UPDATE {$wpdb->prefix}give_customers SET verify_key = '', token = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $token, $now, $row->id )
359
+				$wpdb->prepare("UPDATE {$wpdb->prefix}give_customers SET verify_key = '', token = %s, verify_throttle = %s WHERE id = %d LIMIT 1", $token, $now, $row->id)
360 360
 			);
361 361
 
362 362
 			$this->token_email = $row->email;
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 	 *
381 381
 	 * @return mixed
382 382
 	 */
383
-	public function users_donations_args( $args ) {
383
+	public function users_donations_args($args) {
384 384
 		$args['user'] = $this->token_email;
385 385
 
386 386
 		return $args;
@@ -401,11 +401,11 @@  discard block
 block discarded – undo
401 401
 		global $wpdb;
402 402
 
403 403
 		// Create columns in customers table
404
-		$query = $wpdb->query( "ALTER TABLE {$wpdb->prefix}give_customers ADD `token` VARCHAR(255) CHARACTER SET utf8 NOT NULL, ADD `verify_key` VARCHAR(255) CHARACTER SET utf8 NOT NULL AFTER `token`, ADD `verify_throttle` DATETIME NOT NULL AFTER `verify_key`" );
404
+		$query = $wpdb->query("ALTER TABLE {$wpdb->prefix}give_customers ADD `token` VARCHAR(255) CHARACTER SET utf8 NOT NULL, ADD `verify_key` VARCHAR(255) CHARACTER SET utf8 NOT NULL AFTER `token`, ADD `verify_throttle` DATETIME NOT NULL AFTER `verify_key`");
405 405
 
406 406
 		// Columns added properly
407
-		if ( $query ) {
408
-			give_update_option( 'email_access_installed', 1 );
407
+		if ($query) {
408
+			give_update_option('email_access_installed', 1);
409 409
 		}
410 410
 
411 411
 	}
Please login to merge, or discard this patch.