Completed
Pull Request — master (#1203)
by Devin
20:46
created
includes/admin/settings/class-settings-license.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_License' ) ) :
16
+if ( ! class_exists('Give_Settings_License')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_License.
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
 		 */
44 44
 		public function __construct() {
45 45
 			$this->id    = 'licenses';
46
-			$this->label = esc_html__( 'Licenses', 'give' );
46
+			$this->label = esc_html__('Licenses', 'give');
47 47
 
48
-			add_filter( 'give-settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
49
-			add_action( "give-settings_settings_{$this->id}_page", array( $this, 'output' ) );
48
+			add_filter('give-settings_tabs_array', array($this, 'add_settings_page'), 20);
49
+			add_action("give-settings_settings_{$this->id}_page", array($this, 'output'));
50 50
 		}
51 51
 
52 52
 		/**
@@ -56,10 +56,10 @@  discard block
 block discarded – undo
56 56
 		 * @param  array $pages Lst of pages.
57 57
 		 * @return array
58 58
 		 */
59
-		public function add_settings_page( $pages ) {
59
+		public function add_settings_page($pages) {
60 60
 			// Bailout: Do not add licenses setting tab if it does not contain any setting fields.
61
-			if( ! empty( $this->get_settings() ) ) {
62
-				$pages[ $this->id ] = $this->label;
61
+			if ( ! empty($this->get_settings())) {
62
+				$pages[$this->id] = $this->label;
63 63
 			}
64 64
 
65 65
 			return $pages;
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 			 * Filter the licenses settings.
79 79
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
80 80
 			 */
81
-			$settings = apply_filters( 'give_settings_licenses', $settings );
81
+			$settings = apply_filters('give_settings_licenses', $settings);
82 82
 
83 83
 			/**
84 84
 			 * Filter the settings.
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 			 * @since  1.8
87 87
 			 * @param  array $settings
88 88
 			 */
89
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
89
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
90 90
 
91 91
 			// Output.
92 92
 			return $settings;
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		public function output() {
102 102
 			$settings = $this->get_settings();
103 103
 
104
-			Give_Admin_Settings::output_fields( $settings, 'give_settings' );
104
+			Give_Admin_Settings::output_fields($settings, 'give_settings');
105 105
 		}
106 106
 	}
107 107
 
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-addon.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
  * @since       1.8
10 10
  */
11 11
 
12
-if ( ! defined( 'ABSPATH' ) ) {
12
+if ( ! defined('ABSPATH')) {
13 13
 	exit; // Exit if accessed directly
14 14
 }
15 15
 
16
-if ( ! class_exists( 'Give_Settings_Addon' ) ) :
16
+if ( ! class_exists('Give_Settings_Addon')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Addon.
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 		 */
27 27
 		public function __construct() {
28 28
 			$this->id    = 'addons';
29
-			$this->label = esc_html__( 'Add-ons', 'give' );
29
+			$this->label = esc_html__('Add-ons', 'give');
30 30
 
31 31
 			parent::__construct();
32 32
 		}
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
 		 * @param  $setting_tab
39 39
 		 * @return string
40 40
 		 */
41
-		function set_default_setting_tab( $setting_tab ) {
41
+		function set_default_setting_tab($setting_tab) {
42 42
 			$default_tab = '';
43 43
 
44 44
 			// Set default tab to first setting tab.
45
-			if( $sections = array_keys( $this->get_sections() ) ) {
46
-				$default_tab = current( $sections );
45
+			if ($sections = array_keys($this->get_sections())) {
46
+				$default_tab = current($sections);
47 47
 			}
48 48
 			return $default_tab;
49 49
 		}
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
 		 * @param  array $pages Lst of pages.
56 56
 		 * @return array
57 57
 		 */
58
-		public function add_settings_page( $pages ) {
58
+		public function add_settings_page($pages) {
59 59
 			// Bailout: Do not add addons setting tab if it does not contain any setting fields.
60
-			if( ! empty( $this->get_settings() ) ) {
61
-				$pages[ $this->id ] = $this->label;
60
+			if ( ! empty($this->get_settings())) {
61
+				$pages[$this->id] = $this->label;
62 62
 			}
63 63
 
64 64
 			return $pages;
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 			 * Filter the addons settings.
78 78
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
79 79
 			 */
80
-			$settings = apply_filters( 'give_settings_addons', $settings );
80
+			$settings = apply_filters('give_settings_addons', $settings);
81 81
 
82 82
 			/**
83 83
 			 * Filter the settings.
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 			 * @since  1.8
86 86
 			 * @param  array $settings
87 87
 			 */
88
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
88
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
89 89
 
90 90
 			// Output.
91 91
 			return $settings;
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-display.php 1 patch
Spacing   +62 added lines, -62 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_Display' ) ) :
16
+if ( ! class_exists('Give_Settings_Display')) :
17 17
 
18 18
 	/**
19 19
 	 * Give_Settings_Display.
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 		 */
28 28
 		public function __construct() {
29 29
 			$this->id    = 'display';
30
-			$this->label = esc_html__( 'Display Options', 'give' );
30
+			$this->label = esc_html__('Display Options', 'give');
31 31
 
32 32
 			$this->default_tab = 'display-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 'display-settings' :
49 49
 					$settings = array(
50 50
 						// Section 1: Display
@@ -53,38 +53,38 @@  discard block
 block discarded – undo
53 53
 							'type' => 'title'
54 54
 						),
55 55
 						array(
56
-							'name'    => esc_html__( 'Default Give Styles', 'give' ),
57
-							'desc'    => esc_html__( 'Give includes default styles for donation forms and other frontend elements.', 'give' ),
56
+							'name'    => esc_html__('Default Give Styles', 'give'),
57
+							'desc'    => esc_html__('Give includes default styles for donation forms and other frontend elements.', 'give'),
58 58
 							'id'      => 'css',
59 59
 							'type'    => 'radio_inline',
60 60
 							'default' => 'enabled',
61 61
 							'options' => array(
62
-								'enabled' => __( 'Enabled', 'give' ),
63
-								'disabled' => __( 'Disabled', 'give' ),
62
+								'enabled' => __('Enabled', 'give'),
63
+								'disabled' => __('Disabled', 'give'),
64 64
 							)
65 65
 						),
66 66
 						array(
67
-							'name' => esc_html__( 'Floating Labels', 'give' ),
67
+							'name' => esc_html__('Floating Labels', 'give'),
68 68
 							/* translators: %s: https://givewp.com/documentation/core/give-forms/creating-give-forms/#floating-labels */
69
-							'desc' => sprintf( wp_kses( __( '<a href="%s" target="_blank">Floating labels</a> in set form labels within fields and can improve the donor experience. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url( 'https://givewp.com/documentation/core/give-forms/creating-give-forms/#floating-labels' ) ),
69
+							'desc' => sprintf(wp_kses(__('<a href="%s" target="_blank">Floating labels</a> in set form labels within fields and can improve the donor experience. Note that if the "Disable CSS" option is enabled, you will need to style the floating labels yourself.', 'give'), array('a' => array('href' => array(), 'target' => array()))), esc_url('https://givewp.com/documentation/core/give-forms/creating-give-forms/#floating-labels')),
70 70
 							'id'   => 'floatlabels',
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
-							'name'    => esc_html__( 'Welcome Screen', 'give' ),
79
+							'name'    => esc_html__('Welcome Screen', 'give'),
80 80
 							/* translators: %s: about page URL */
81
-							'desc'    => sprintf( wp_kses( __( 'Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> that display each time Give is activated or updated.', 'give' ), array( 'a' => array( 'href' => array(), 'target' => array() ) ) ), esc_url( admin_url( 'index.php?page=give-about' ) ) ),
81
+							'desc'    => sprintf(wp_kses(__('Enable this option if you would like to disable the <a href="%s" target="_blank">Give Welcome screen</a> that display each time Give is activated or updated.', 'give'), array('a' => array('href' => array(), 'target' => array()))), esc_url(admin_url('index.php?page=give-about'))),
82 82
 							'id'      => 'welcome',
83 83
 							'type'    => 'radio_inline',
84 84
 							'default' => 'enabled',
85 85
 							'options' => array(
86
-								'enabled' => __( 'Enabled', 'give' ),
87
-								'disabled' => __( 'Disabled', 'give' ),
86
+								'enabled' => __('Enabled', 'give'),
87
+								'disabled' => __('Disabled', 'give'),
88 88
 							)
89 89
 						),
90 90
 						array(
@@ -101,66 +101,66 @@  discard block
 block discarded – undo
101 101
 							'type' => 'title'
102 102
 						),
103 103
 						array(
104
-							'name'    => esc_html__( 'Form Single Views', 'give' ),
105
-							'desc'    => esc_html__( 'By default, all donation form have single views enabled which creates a specific URL on your website for that form. This option disables the singular posts from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give' ),
104
+							'name'    => esc_html__('Form Single Views', 'give'),
105
+							'desc'    => esc_html__('By default, all donation form have single views enabled which creates a specific URL on your website for that form. This option disables the singular posts from being publicly viewable. Note: you will need to embed forms using a shortcode or widget if enabled.', 'give'),
106 106
 							'id'      => 'forms_singular',
107 107
 							'type'    => 'radio_inline',
108 108
 							'default' => 'enabled',
109 109
 							'options' => array(
110
-								'enabled' => __( 'Enabled', 'give' ),
111
-								'disabled' => __( 'Disabled', 'give' ),
110
+								'enabled' => __('Enabled', 'give'),
111
+								'disabled' => __('Disabled', 'give'),
112 112
 							)
113 113
 						),
114 114
 						array(
115
-							'name'    => esc_html__( 'Form Archives', 'give' ),
116
-							'desc'    => esc_html__( 'Archives pages list all the donation forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give' ),
115
+							'name'    => esc_html__('Form Archives', 'give'),
116
+							'desc'    => esc_html__('Archives pages list all the donation forms you have created. This option will disable only the form\'s archive page(s). The single form\'s view will remain in place. Note: you will need to refresh your permalinks after this option has been enabled.', 'give'),
117 117
 							'id'      => 'forms_archives',
118 118
 							'type'    => 'radio_inline',
119 119
 							'default' => 'enabled',
120 120
 							'options' => array(
121
-								'enabled' => __( 'Enabled', 'give' ),
122
-								'disabled' => __( 'Disabled', 'give' ),
121
+								'enabled' => __('Enabled', 'give'),
122
+								'disabled' => __('Disabled', 'give'),
123 123
 							)
124 124
 						),
125 125
 						array(
126
-							'name'    => esc_html__( 'Form Excerpts', 'give' ),
127
-							'desc'    => esc_html__( 'The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give' ),
126
+							'name'    => esc_html__('Form Excerpts', 'give'),
127
+							'desc'    => esc_html__('The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.', 'give'),
128 128
 							'id'      => 'forms_excerpt',
129 129
 							'type'    => 'radio_inline',
130 130
 							'default' => 'enabled',
131 131
 							'options' => array(
132
-								'enabled' => __( 'Enabled', 'give' ),
133
-								'disabled' => __( 'Disabled', 'give' ),
132
+								'enabled' => __('Enabled', 'give'),
133
+								'disabled' => __('Disabled', 'give'),
134 134
 							)
135 135
 						),
136 136
 						array(
137
-							'name'    => esc_html__( 'Form Featured Image', 'give' ),
138
-							'desc'    => esc_html__( 'If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give' ),
137
+							'name'    => esc_html__('Form Featured Image', 'give'),
138
+							'desc'    => esc_html__('If you do not wish to use the featured image functionality you can disable it using this option and it will not be displayed for single donation forms.', 'give'),
139 139
 							'id'      => 'form_featured_img',
140 140
 							'type'    => 'radio_inline',
141 141
 							'default' => 'enabled',
142 142
 							'options' => array(
143
-								'enabled' => __( 'Enabled', 'give' ),
144
-								'disabled' => __( 'Disabled', 'give' ),
143
+								'enabled' => __('Enabled', 'give'),
144
+								'disabled' => __('Disabled', 'give'),
145 145
 							)
146 146
 						),
147 147
 						array(
148
-							'name'    => esc_html__( 'Featured Image Size', 'give' ),
149
-							'desc'    => esc_html__( 'The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation forms\' featured image.', 'give' ),
148
+							'name'    => esc_html__('Featured Image Size', 'give'),
149
+							'desc'    => esc_html__('The Featured Image is an image that is chosen as the representative image for a donation form. Some themes may have custom featured image sizes. Please select the size you would like to display for your single donation forms\' featured image.', 'give'),
150 150
 							'id'      => 'featured_image_size',
151 151
 							'type'    => 'select',
152 152
 							'default' => 'large',
153 153
 							'options' => give_get_featured_image_sizes()
154 154
 						),
155 155
 						array(
156
-							'name'    => esc_html__( 'Single Form Sidebar', 'give' ),
157
-							'desc'    => esc_html__( 'The sidebar allows you to add additional widgets to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give' ),
156
+							'name'    => esc_html__('Single Form Sidebar', 'give'),
157
+							'desc'    => esc_html__('The sidebar allows you to add additional widgets to the Give single form view. If you don\'t plan on using the sidebar you may disable it with this option.', 'give'),
158 158
 							'id'      => 'form_sidebar',
159 159
 							'type'    => 'radio_inline',
160 160
 							'default' => 'enabled',
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(
@@ -177,25 +177,25 @@  discard block
 block discarded – undo
177 177
 							'type' => 'title'
178 178
 						),
179 179
 						array(
180
-							'name' => esc_html__( 'Form Categories', 'give' ),
181
-							'desc' => esc_html__( 'Enable the "Category" taxonomy for all Give forms.', 'give' ),
180
+							'name' => esc_html__('Form Categories', 'give'),
181
+							'desc' => esc_html__('Enable the "Category" taxonomy for all Give forms.', 'give'),
182 182
 							'id'   => 'categories',
183 183
 							'type'    => 'radio_inline',
184 184
 							'default' => 'disabled',
185 185
 							'options' => array(
186
-								'enabled' => __( 'Enabled', 'give' ),
187
-								'disabled' => __( 'Disabled', 'give' ),
186
+								'enabled' => __('Enabled', 'give'),
187
+								'disabled' => __('Disabled', 'give'),
188 188
 							)
189 189
 						),
190 190
 						array(
191
-							'name' => esc_html__( 'Form Tags', 'give' ),
192
-							'desc' => esc_html__( 'Enable the "Tag" taxonomy for all Give forms.', 'give' ),
191
+							'name' => esc_html__('Form Tags', 'give'),
192
+							'desc' => esc_html__('Enable the "Tag" taxonomy for all Give forms.', 'give'),
193 193
 							'id'   => 'tags',
194 194
 							'type'    => 'radio_inline',
195 195
 							'default' => 'disabled',
196 196
 							'options' => array(
197
-								'enabled' => __( 'Enabled', 'give' ),
198
-								'disabled' => __( 'Disabled', 'give' ),
197
+								'enabled' => __('Enabled', 'give'),
198
+								'disabled' => __('Disabled', 'give'),
199 199
 							)
200 200
 						),
201 201
 						array(
@@ -212,28 +212,28 @@  discard block
 block discarded – undo
212 212
 							'type' => 'title'
213 213
 						),
214 214
 						array(
215
-							'name'    => esc_html__( 'Terms and Conditions', 'give' ),
216
-							'desc'    => esc_html__( 'Would you like donors to have to agree to your terms when making a donation? Note: You can toggle this option and customize the terms per form.', 'give' ),
215
+							'name'    => esc_html__('Terms and Conditions', 'give'),
216
+							'desc'    => esc_html__('Would you like donors to have to agree to your terms when making a donation? Note: You can toggle this option and customize the terms per form.', 'give'),
217 217
 							'id'      => 'terms',
218 218
 							'type'    => 'radio_inline',
219 219
 							'default' => 'disabled',
220 220
 							'options' => array(
221
-								'enabled' => __( 'Enabled', 'give' ),
222
-								'disabled' => __( 'Disabled', 'give' ),
221
+								'enabled' => __('Enabled', 'give'),
222
+								'disabled' => __('Disabled', 'give'),
223 223
 							)
224 224
 						),
225 225
 						array(
226
-							'name' => esc_html__( 'Agree to Terms Label', 'give' ),
227
-							'desc' => esc_html__( 'The label shown next to the agree to terms check box. Add your own to customize or leave blank to use the default text placeholder. Note: You can customize the label per form as needed.', 'give' ),
226
+							'name' => esc_html__('Agree to Terms Label', 'give'),
227
+							'desc' => esc_html__('The label shown next to the agree to terms check box. Add your own to customize or leave blank to use the default text placeholder. Note: You can customize the label per form as needed.', 'give'),
228 228
 							'id'   => 'agree_to_terms_label',
229 229
 							'attributes'  => array(
230
-								'placeholder' => esc_attr__( 'Agree to Terms?', 'give' ),
230
+								'placeholder' => esc_attr__('Agree to Terms?', 'give'),
231 231
 							),
232 232
 							'type' => 'text'
233 233
 						),
234 234
 						array(
235
-							'name' => esc_html__( 'Agreement Text', 'give' ),
236
-							'desc' => esc_html__( 'This is the actual text which the user will have to agree to in order to make a donation. Note: You can customize the content per form as needed.', 'give' ),
235
+							'name' => esc_html__('Agreement Text', 'give'),
236
+							'desc' => esc_html__('This is the actual text which the user will have to agree to in order to make a donation. Note: You can customize the content per form as needed.', 'give'),
237 237
 							'id'   => 'agreement_text',
238 238
 							'type' => 'wysiwyg'
239 239
 						),
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 			 * Filter the display options settings.
250 250
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
251 251
 			 */
252
-			$settings = apply_filters( 'give_settings_display', $settings );
252
+			$settings = apply_filters('give_settings_display', $settings);
253 253
 
254 254
 			/**
255 255
 			 * Filter the settings.
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 			 * @since  1.8
258 258
 			 * @param  array $settings
259 259
 			 */
260
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
260
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
261 261
 
262 262
 			// Output.
263 263
 			return $settings;
@@ -271,13 +271,13 @@  discard block
 block discarded – undo
271 271
 		 */
272 272
 		public function get_sections() {
273 273
 			$sections = array(
274
-				'display-settings'    => esc_html__( 'Display', 'give' ),
275
-				'post-types'          => esc_html__( 'Post Types', 'give' ),
276
-				'taxonomies'          => esc_html__( 'Taxonomies', 'give' ),
277
-				'term-and-conditions' => esc_html__( 'Term and Conditions', 'give' )
274
+				'display-settings'    => esc_html__('Display', 'give'),
275
+				'post-types'          => esc_html__('Post Types', 'give'),
276
+				'taxonomies'          => esc_html__('Taxonomies', 'give'),
277
+				'term-and-conditions' => esc_html__('Term and Conditions', 'give')
278 278
 			);
279 279
 
280
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
280
+			return apply_filters('give_get_sections_'.$this->id, $sections);
281 281
 		}
282 282
 	}
283 283
 
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-general.php 1 patch
Spacing   +55 added lines, -55 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,39 +54,39 @@  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( __( '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( 'https://www.google.com/recaptcha/' ) ),
82
+							'desc'    => sprintf(__('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('https://www.google.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 manage 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 manage reCAPTCHA API Keys panel.', 'give'),
90 90
 							'default' => '',
91 91
 							'type'    => 'text'
92 92
 						),
@@ -105,51 +105,51 @@  discard block
 block discarded – undo
105 105
 							'id'   => 'give_title_general_settings_2'
106 106
 						),
107 107
 						array(
108
-							'name' => esc_html__( 'Currency Settings', 'give' ),
108
+							'name' => esc_html__('Currency Settings', 'give'),
109 109
 							'desc' => '',
110 110
 							'type' => 'give_title',
111 111
 							'id'   => 'give_title_general_settings_2'
112 112
 						),
113 113
 						array(
114
-							'name'    => esc_html__( 'Currency', 'give' ),
115
-							'desc'    => esc_html__( 'The donation currency. Note that some payment gateways have currency restrictions.', 'give' ),
114
+							'name'    => esc_html__('Currency', 'give'),
115
+							'desc'    => esc_html__('The donation currency. Note that some payment gateways have currency restrictions.', 'give'),
116 116
 							'id'      => 'currency',
117 117
 							'type'    => 'select',
118 118
 							'options' => give_get_currencies(),
119 119
 							'default' => 'USD',
120 120
 						),
121 121
 						array(
122
-							'name'    => esc_html__( 'Currency Position', 'give' ),
123
-							'desc'    => esc_html__( 'The position of the currency symbol.', 'give' ),
122
+							'name'    => esc_html__('Currency Position', 'give'),
123
+							'desc'    => esc_html__('The position of the currency symbol.', 'give'),
124 124
 							'id'      => 'currency_position',
125 125
 							'type'    => 'select',
126 126
 							'options' => array(
127 127
 								/* translators: %s: currency symbol */
128
-								'before' => sprintf( esc_html__( 'Before - %s10', 'give' ), give_currency_symbol( give_get_currency() ) ),
128
+								'before' => sprintf(esc_html__('Before - %s10', 'give'), give_currency_symbol(give_get_currency())),
129 129
 								/* translators: %s: currency symbol */
130
-								'after'  => sprintf( esc_html__( 'After - 10%s', 'give' ), give_currency_symbol( give_get_currency() ) )
130
+								'after'  => sprintf(esc_html__('After - 10%s', 'give'), give_currency_symbol(give_get_currency()))
131 131
 							),
132 132
 							'default' => 'before',
133 133
 						),
134 134
 						array(
135
-							'name'    => esc_html__( 'Thousands Separator', 'give' ),
136
-							'desc'    => esc_html__( 'The symbol (typically , or .) to separate thousands.', 'give' ),
135
+							'name'    => esc_html__('Thousands Separator', 'give'),
136
+							'desc'    => esc_html__('The symbol (typically , or .) to separate thousands.', 'give'),
137 137
 							'id'      => 'thousands_separator',
138 138
 							'type'    => 'text',
139 139
 							'default' => ',',
140 140
 							'css'     => 'width:12em;',
141 141
 						),
142 142
 						array(
143
-							'name'    => esc_html__( 'Decimal Separator', 'give' ),
144
-							'desc'    => esc_html__( 'The symbol (usually , or .) to separate decimal points.', 'give' ),
143
+							'name'    => esc_html__('Decimal Separator', 'give'),
144
+							'desc'    => esc_html__('The symbol (usually , or .) to separate decimal points.', 'give'),
145 145
 							'id'      => 'decimal_separator',
146 146
 							'type'    => 'text',
147 147
 							'default' => '.',
148 148
 							'css'     => 'width:12em;',
149 149
 						),
150 150
 						array(
151
-							'name'            => __( 'Number of Decimals', 'give' ),
152
-							'desc'            => __( 'The number of decimal points displayed in amounts.', 'give' ),
151
+							'name'            => __('Number of Decimals', 'give'),
152
+							'desc'            => __('The number of decimal points displayed in amounts.', 'give'),
153 153
 							'id'              => 'number_decimals',
154 154
 							'type'            => 'text',
155 155
 							'default'         => 2,
@@ -171,46 +171,46 @@  discard block
 block discarded – undo
171 171
 							'id'   => 'give_title_general_settings_1'
172 172
 						),
173 173
 						array(
174
-							'name' => esc_html__( 'General Settings', 'give' ),
174
+							'name' => esc_html__('General Settings', 'give'),
175 175
 							'desc' => '',
176 176
 							'type' => 'give_title',
177 177
 							'id'   => 'give_title_general_settings_1'
178 178
 						),
179 179
 						array(
180
-							'name'    => esc_html__( 'Success Page', 'give' ),
180
+							'name'    => esc_html__('Success Page', 'give'),
181 181
 							/* translators: %s: [give_receipt] */
182
-							'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>' ),
182
+							'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>'),
183 183
 							'id'      => 'success_page',
184 184
 							'type'    => 'select',
185
-							'options' => give_cmb2_get_post_options( array(
185
+							'options' => give_cmb2_get_post_options(array(
186 186
 								'post_type'   => 'page',
187
-								'numberposts' => - 1
188
-							) ),
187
+								'numberposts' => -1
188
+							)),
189 189
 						),
190 190
 						array(
191
-							'name'    => esc_html__( 'Failed Donation Page', 'give' ),
192
-							'desc'    => esc_html__( 'The page donors are sent to if their donation is cancelled or fails.', 'give' ),
191
+							'name'    => esc_html__('Failed Donation Page', 'give'),
192
+							'desc'    => esc_html__('The page donors are sent to if their donation is cancelled or fails.', 'give'),
193 193
 							'id'      => 'failure_page',
194 194
 							'type'    => 'select',
195
-							'options' => give_cmb2_get_post_options( array(
195
+							'options' => give_cmb2_get_post_options(array(
196 196
 								'post_type'   => 'page',
197
-								'numberposts' => - 1
198
-							) ),
197
+								'numberposts' => -1
198
+							)),
199 199
 						),
200 200
 						array(
201
-							'name'    => esc_html__( 'Donation History Page', 'give' ),
201
+							'name'    => esc_html__('Donation History Page', 'give'),
202 202
 							/* translators: %s: [donation_history] */
203
-							'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>' ),
203
+							'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>'),
204 204
 							'id'      => 'history_page',
205 205
 							'type'    => 'select',
206
-							'options' => give_cmb2_get_post_options( array(
206
+							'options' => give_cmb2_get_post_options(array(
207 207
 								'post_type'   => 'page',
208
-								'numberposts' => - 1
209
-							) ),
208
+								'numberposts' => -1
209
+							)),
210 210
 						),
211 211
 						array(
212
-							'name'    => esc_html__( 'Base Country', 'give' ),
213
-							'desc'    => esc_html__( 'The country your site operates from.', 'give' ),
212
+							'name'    => esc_html__('Base Country', 'give'),
213
+							'desc'    => esc_html__('The country your site operates from.', 'give'),
214 214
 							'id'      => 'base_country',
215 215
 							'type'    => 'select',
216 216
 							'options' => give_get_country_list(),
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 			 * Filter the general settings.
228 228
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
229 229
 			 */
230
-			$settings = apply_filters( 'give_settings_general', $settings );
230
+			$settings = apply_filters('give_settings_general', $settings);
231 231
 
232 232
 			/**
233 233
 			 * Filter the settings.
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 			 *
237 237
 			 * @param  array $settings
238 238
 			 */
239
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
239
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
240 240
 
241 241
 			// Output.
242 242
 			return $settings;
@@ -250,12 +250,12 @@  discard block
 block discarded – undo
250 250
 		 */
251 251
 		public function get_sections() {
252 252
 			$sections = array(
253
-				'general-settings'  => esc_html__( 'General', 'give' ),
254
-				'currency-settings' => esc_html__( 'Currency', 'give' ),
255
-				'access-control'    => esc_html__( 'Access Control', 'give' )
253
+				'general-settings'  => esc_html__('General', 'give'),
254
+				'currency-settings' => esc_html__('Currency', 'give'),
255
+				'access-control'    => esc_html__('Access Control', 'give')
256 256
 			);
257 257
 
258
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
258
+			return apply_filters('give_get_sections_'.$this->id, $sections);
259 259
 		}
260 260
 	}
261 261
 
Please login to merge, or discard this patch.
includes/admin/settings/class-settings-gateways.php 1 patch
Spacing   +41 added lines, -41 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,37 +53,37 @@  discard block
 block discarded – undo
53 53
 							'id'   => 'give_title_gateway_settings_2',
54 54
 						),
55 55
 						array(
56
-							'name' => esc_html__( 'PayPal Email', 'give' ),
57
-							'desc' => esc_html__( 'Enter your PayPal account\'s email.', 'give' ),
56
+							'name' => esc_html__('PayPal Email', 'give'),
57
+							'desc' => esc_html__('Enter your PayPal account\'s email.', 'give'),
58 58
 							'id'   => 'paypal_email',
59 59
 							'type' => 'email',
60 60
 						),
61 61
 						array(
62
-							'name' => esc_html__( 'PayPal Page Style', 'give' ),
63
-							'desc' => esc_html__( 'Enter the name of the page style to use, or leave blank to use the default.', 'give' ),
62
+							'name' => esc_html__('PayPal Page Style', 'give'),
63
+							'desc' => esc_html__('Enter the name of the 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'    => esc_html__( 'PayPal Transaction Type', 'give' ),
69
-							'desc'    => esc_html__( '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'    => esc_html__('PayPal Transaction Type', 'give'),
69
+							'desc'    => esc_html__('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' => esc_html__( 'Donation', 'give' ),
74
-								'standard' => esc_html__( 'Standard Transaction', 'give' )
73
+								'donation' => esc_html__('Donation', 'give'),
74
+								'standard' => esc_html__('Standard Transaction', 'give')
75 75
 							),
76 76
 							'default' => 'donation',
77 77
 						),
78 78
 						array(
79
-							'name'    => esc_html__( 'PayPal IPN Verification', 'give' ),
80
-							'desc'    => esc_html__( 'If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give' ),
79
+							'name'    => esc_html__('PayPal IPN Verification', 'give'),
80
+							'desc'    => esc_html__('If donations are not getting marked as complete, use a slightly less secure method of verifying donations.', 'give'),
81 81
 							'id'      => 'paypal_verification',
82 82
 							'type'    => 'radio_inline',
83 83
 							'default' => 'enabled',
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(
@@ -101,19 +101,19 @@  discard block
 block discarded – undo
101 101
 							'id'   => 'give_title_gateway_settings_3',
102 102
 						),
103 103
 						array(
104
-							'name'    => esc_html__( 'Collect Billing Details', 'give' ),
105
-							'desc'    => esc_html__( 'Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give' ),
104
+							'name'    => esc_html__('Collect Billing Details', 'give'),
105
+							'desc'    => esc_html__('Enable to request billing details for offline donations. Will appear above offline donation instructions. Can be enabled/disabled per form.', 'give'),
106 106
 							'id'      => 'give_offline_donation_enable_billing_fields',
107 107
 							'type'    => 'radio_inline',
108 108
 							'default' => 'disabled',
109 109
 							'options' => array(
110
-								'enabled'  => __( 'Enabled', 'give' ),
111
-								'disabled' => __( 'Disabled', 'give' )
110
+								'enabled'  => __('Enabled', 'give'),
111
+								'disabled' => __('Disabled', 'give')
112 112
 							)
113 113
 						),
114 114
 						array(
115
-							'name'    => esc_html__( 'Offline Donation Instructions', 'give' ),
116
-							'desc'    => esc_html__( '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' ),
115
+							'name'    => esc_html__('Offline Donation Instructions', 'give'),
116
+							'desc'    => esc_html__('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'),
117 117
 							'id'      => 'global_offline_donation_content',
118 118
 							'default' => give_get_default_offline_donation_content(),
119 119
 							'type'    => 'wysiwyg',
@@ -122,15 +122,15 @@  discard block
 block discarded – undo
122 122
 							)
123 123
 						),
124 124
 						array(
125
-							'name'    => esc_html__( 'Offline Donation Email Instructions Subject', 'give' ),
126
-							'desc'    => esc_html__( 'Enter the subject line for the donation receipt email.', 'give' ),
125
+							'name'    => esc_html__('Offline Donation Email Instructions Subject', 'give'),
126
+							'desc'    => esc_html__('Enter the subject line for the donation receipt email.', 'give'),
127 127
 							'id'      => 'offline_donation_subject',
128
-							'default' => esc_attr__( '{donation} - Offline Donation Instructions', 'give' ),
128
+							'default' => esc_attr__('{donation} - Offline Donation Instructions', 'give'),
129 129
 							'type'    => 'text'
130 130
 						),
131 131
 						array(
132
-							'name'    => esc_html__( 'Offline Donation Email Instructions', 'give' ),
133
-							'desc'    => esc_html__( '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' ),
132
+							'name'    => esc_html__('Offline Donation Email Instructions', 'give'),
133
+							'desc'    => esc_html__('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'),
134 134
 							'id'      => 'global_offline_donation_email',
135 135
 							'default' => give_get_default_offline_donation_email_content(),
136 136
 							'type'    => 'wysiwyg',
@@ -153,25 +153,25 @@  discard block
 block discarded – undo
153 153
 							'type' => 'title'
154 154
 						),
155 155
 						array(
156
-							'name'    => esc_html__( 'Test Mode', 'give' ),
157
-							'desc'    => esc_html__( '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' ),
156
+							'name'    => esc_html__('Test Mode', 'give'),
157
+							'desc'    => esc_html__('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'),
158 158
 							'id'      => 'test_mode',
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' => esc_html__( 'Enabled Gateways', 'give' ),
168
-							'desc' => esc_html__( 'Enable your payment gateway. Can be ordered by dragging.', 'give' ),
167
+							'name' => esc_html__('Enabled Gateways', 'give'),
168
+							'desc' => esc_html__('Enable your payment gateway. Can be ordered by dragging.', 'give'),
169 169
 							'id'   => 'gateways',
170 170
 							'type' => 'enabled_gateways'
171 171
 						),
172 172
 						array(
173
-							'name' => esc_html__( 'Default Gateway', 'give' ),
174
-							'desc' => esc_html__( 'The gateway that will be selected by default.', 'give' ),
173
+							'name' => esc_html__('Default Gateway', 'give'),
174
+							'desc' => esc_html__('The gateway that will be selected by default.', 'give'),
175 175
 							'id'   => 'default_gateway',
176 176
 							'type' => 'default_gateway'
177 177
 						),
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 			 * Filter the payment gateways settings.
188 188
 			 * Backward compatibility: Please do not use this filter. This filter is deprecated in 1.8
189 189
 			 */
190
-			$settings = apply_filters( 'give_settings_gateways', $settings );
190
+			$settings = apply_filters('give_settings_gateways', $settings);
191 191
 
192 192
 			/**
193 193
 			 * Filter the settings.
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 			 *
197 197
 			 * @param  array $settings
198 198
 			 */
199
-			$settings = apply_filters( 'give_get_settings_' . $this->id, $settings );
199
+			$settings = apply_filters('give_get_settings_'.$this->id, $settings);
200 200
 
201 201
 			// Output.
202 202
 			return $settings;
@@ -210,12 +210,12 @@  discard block
 block discarded – undo
210 210
 		 */
211 211
 		public function get_sections() {
212 212
 			$sections = array(
213
-				'gateways-settings' => esc_html__( 'Gateways', 'give' ),
214
-				'paypal-standard'   => esc_html__( 'Paypal Standard', 'give' ),
215
-				'offline-donations' => esc_html__( 'Offline', 'give' )
213
+				'gateways-settings' => esc_html__('Gateways', 'give'),
214
+				'paypal-standard'   => esc_html__('Paypal Standard', 'give'),
215
+				'offline-donations' => esc_html__('Offline', 'give')
216 216
 			);
217 217
 
218
-			return apply_filters( 'give_get_sections_' . $this->id, $sections );
218
+			return apply_filters('give_get_sections_'.$this->id, $sections);
219 219
 		}
220 220
 	}
221 221
 
Please login to merge, or discard this patch.
includes/admin/class-addon-activation-banner.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 // Exit if accessed directly.
11
-if ( ! defined( 'ABSPATH' ) ) {
11
+if ( ! defined('ABSPATH')) {
12 12
 	exit;
13 13
 }
14 14
 
@@ -32,14 +32,14 @@  discard block
 block discarded – undo
32 32
 	 *                               'testing'           => false, // (required) Never leave as "true" in production!!!
33 33
 	 *                               }
34 34
 	 */
35
-	function __construct( $_banner_details ) {
35
+	function __construct($_banner_details) {
36 36
 		$current_user = wp_get_current_user();
37 37
 
38 38
 		$this->plugin_activate_by   = 0;
39 39
 		$this->banner_details       = $_banner_details;
40
-		$this->test_mode            = ( $this->banner_details['testing'] == 'true' ) ? true : false;
41
-		$this->nag_meta_key         = 'give_addon_activation_ignore_' . sanitize_title( $this->banner_details['name'] );
42
-		$this->activate_by_meta_key = 'give_addon_' . sanitize_title( $this->banner_details['name'] ) . '_active_by_user';
40
+		$this->test_mode            = ($this->banner_details['testing'] == 'true') ? true : false;
41
+		$this->nag_meta_key         = 'give_addon_activation_ignore_'.sanitize_title($this->banner_details['name']);
42
+		$this->activate_by_meta_key = 'give_addon_'.sanitize_title($this->banner_details['name']).'_active_by_user';
43 43
 
44 44
 		//Get current user
45 45
 		$this->user_id = $current_user->ID;
@@ -62,16 +62,16 @@  discard block
 block discarded – undo
62 62
 	public function init() {
63 63
 
64 64
 		//Testing?
65
-		if ( $this->test_mode ) {
66
-			delete_user_meta( $this->user_id, $this->nag_meta_key );
65
+		if ($this->test_mode) {
66
+			delete_user_meta($this->user_id, $this->nag_meta_key);
67 67
 		}
68 68
 
69 69
 		//Get the current page to add the notice to
70
-		add_action( 'current_screen', array( $this, 'give_addon_notice_ignore' ) );
71
-		add_action( 'admin_notices', array( $this, 'give_addon_activation_admin_notice' ) );
70
+		add_action('current_screen', array($this, 'give_addon_notice_ignore'));
71
+		add_action('admin_notices', array($this, 'give_addon_activation_admin_notice'));
72 72
 
73 73
 		// File path of addon must be included in banner detail other addon activate meta will not delete.
74
-		add_action( 'deactivate_' . $this->get_plugin_file_name(), array( $this, 'remove_addon_activate_meta' ) );
74
+		add_action('deactivate_'.$this->get_plugin_file_name(), array($this, 'remove_addon_activate_meta'));
75 75
 	}
76 76
 
77 77
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	private function is_plugin_page() {
86 86
 		$screen = get_current_screen();
87 87
 
88
-		return ( $screen->parent_file === 'plugins.php' );
88
+		return ($screen->parent_file === 'plugins.php');
89 89
 	}
90 90
 
91 91
 
@@ -98,12 +98,12 @@  discard block
 block discarded – undo
98 98
 	public function give_addon_activation_admin_notice() {
99 99
 
100 100
 		// Bailout.
101
-		if ( ! $this->is_plugin_page() || $this->user_id !== $this->plugin_activate_by ) {
101
+		if ( ! $this->is_plugin_page() || $this->user_id !== $this->plugin_activate_by) {
102 102
 			return;
103 103
 		}
104 104
 
105 105
 		// If the user hasn't already dismissed the alert, output activation banner.
106
-		if ( ! get_user_meta( $this->user_id, $this->nag_meta_key ) ) {
106
+		if ( ! get_user_meta($this->user_id, $this->nag_meta_key)) {
107 107
 
108 108
 			// Output inline styles here because there's no reason
109 109
 			// to enqueued them after the alert is dismissed.
@@ -185,44 +185,44 @@  discard block
 block discarded – undo
185 185
 					<h3><?php
186 186
 						printf(
187 187
 						/* translators: %s: Add-on name */
188
-							esc_html__( "Thank you for installing Give's %s Add-on!", 'give' ),
189
-							'<span>' . $this->banner_details['name'] . '</span>'
188
+							esc_html__("Thank you for installing Give's %s Add-on!", 'give'),
189
+							'<span>'.$this->banner_details['name'].'</span>'
190 190
 						);
191 191
 						?></h3>
192 192
 
193 193
 					<a href="<?php
194 194
 					//The Dismiss Button.
195
-					$nag_admin_dismiss_url = 'plugins.php?' . $this->nag_meta_key . '=0';
196
-					echo admin_url( $nag_admin_dismiss_url ); ?>" class="dismiss"><span
195
+					$nag_admin_dismiss_url = 'plugins.php?'.$this->nag_meta_key.'=0';
196
+					echo admin_url($nag_admin_dismiss_url); ?>" class="dismiss"><span
197 197
 							class="dashicons dashicons-dismiss"></span></a>
198 198
 
199 199
 					<div class="alert-actions">
200 200
 
201 201
 						<?php //Point them to your settings page.
202
-						if ( isset( $this->banner_details['settings_url'] ) ) { ?>
202
+						if (isset($this->banner_details['settings_url'])) { ?>
203 203
 							<a href="<?php echo $this->banner_details['settings_url']; ?>">
204
-								<span class="dashicons dashicons-admin-settings"></span><?php esc_html_e( 'Go to Settings', 'give' ); ?>
204
+								<span class="dashicons dashicons-admin-settings"></span><?php esc_html_e('Go to Settings', 'give'); ?>
205 205
 							</a>
206 206
 						<?php } ?>
207 207
 
208 208
 						<?php
209 209
 						// Show them how to configure the Addon.
210
-						if ( isset( $this->banner_details['documentation_url'] ) ) { ?>
210
+						if (isset($this->banner_details['documentation_url'])) { ?>
211 211
 							<a href="<?php echo $this->banner_details['documentation_url'] ?>" target="_blank">
212 212
 								<span class="dashicons dashicons-media-text"></span><?php
213 213
 								printf(
214 214
 								/* translators: %s: Add-on name */
215
-									esc_html__( 'Documentation: %s Add-on', 'give' ),
215
+									esc_html__('Documentation: %s Add-on', 'give'),
216 216
 									$this->banner_details['name']
217 217
 								);
218 218
 								?></a>
219 219
 						<?php } ?>
220 220
 						<?php
221 221
 						//Let them signup for plugin updates
222
-						if ( isset( $this->banner_details['support_url'] ) ) { ?>
222
+						if (isset($this->banner_details['support_url'])) { ?>
223 223
 
224 224
 							<a href="<?php echo $this->banner_details['support_url'] ?>" target="_blank">
225
-								<span class="dashicons dashicons-sos"></span><?php esc_html_e( 'Get Support', 'give' ); ?>
225
+								<span class="dashicons dashicons-sos"></span><?php esc_html_e('Get Support', 'give'); ?>
226 226
 							</a>
227 227
 
228 228
 						<?php } ?>
@@ -249,13 +249,13 @@  discard block
 block discarded – undo
249 249
 		 * If user clicks to ignore the notice, add that to their user meta the banner then checks whether this tag exists already or not.
250 250
 		 * See here: http://codex.wordpress.org/Function_Reference/add_user_meta
251 251
 		 */
252
-		if ( isset( $_GET[ $this->nag_meta_key ] ) && '0' == $_GET[ $this->nag_meta_key ] ) {
252
+		if (isset($_GET[$this->nag_meta_key]) && '0' == $_GET[$this->nag_meta_key]) {
253 253
 
254 254
 			//Get the global user
255 255
 			$current_user = wp_get_current_user();
256 256
 			$user_id      = $current_user->ID;
257 257
 
258
-			add_user_meta( $user_id, $this->nag_meta_key, 'true', true );
258
+			add_user_meta($user_id, $this->nag_meta_key, 'true', true);
259 259
 		}
260 260
 	}
261 261
 
@@ -266,11 +266,11 @@  discard block
 block discarded – undo
266 266
 	 * @access private
267 267
 	 */
268 268
 	private function add_addon_activate_meta() {
269
-		$user_id                  = get_option( $this->activate_by_meta_key );
269
+		$user_id                  = get_option($this->activate_by_meta_key);
270 270
 		$this->plugin_activate_by = (int) $user_id;
271 271
 
272
-		if ( ! $user_id ) {
273
-			add_option( $this->activate_by_meta_key, $this->user_id, '', 'no' );
272
+		if ( ! $user_id) {
273
+			add_option($this->activate_by_meta_key, $this->user_id, '', 'no');
274 274
 			$this->plugin_activate_by = (int) $this->user_id;
275 275
 		}
276 276
 	}
@@ -283,10 +283,10 @@  discard block
 block discarded – undo
283 283
 	 * @access public
284 284
 	 */
285 285
 	public function remove_addon_activate_meta() {
286
-		$user_id = get_option( $this->activate_by_meta_key );
286
+		$user_id = get_option($this->activate_by_meta_key);
287 287
 
288
-		if ( $user_id ) {
289
-			delete_option( $this->activate_by_meta_key );
288
+		if ($user_id) {
289
+			delete_option($this->activate_by_meta_key);
290 290
 		}
291 291
 	}
292 292
 
@@ -299,31 +299,31 @@  discard block
 block discarded – undo
299 299
 	 * @return mixed
300 300
 	 */
301 301
 	private function get_plugin_file_name() {
302
-		$active_plugins = get_option( 'active_plugins' );
302
+		$active_plugins = get_option('active_plugins');
303 303
 		$file_name      = '';
304 304
 
305 305
 		try {
306 306
 
307 307
 			// Check addon file path.
308
-			if ( ! empty( $this->banner_details['file'] ) ) {
309
-				$file_name = explode( '/', explode( '/plugins/', $this->banner_details['file'] )[1] )[0];
308
+			if ( ! empty($this->banner_details['file'])) {
309
+				$file_name = explode('/', explode('/plugins/', $this->banner_details['file'])[1])[0];
310 310
 
311
-				foreach ( $active_plugins as $plugin ) {
312
-					if ( false !== strpos( $plugin, $file_name ) ) {
311
+				foreach ($active_plugins as $plugin) {
312
+					if (false !== strpos($plugin, $file_name)) {
313 313
 						$file_name = $plugin;
314 314
 						break;
315 315
 					}
316 316
 				}
317 317
 			} else {
318
-				throw new Exception( __( "File path must be added of {$this->banner_details['name']} addon in banner details.", 'give' ) );
318
+				throw new Exception(__("File path must be added of {$this->banner_details['name']} addon in banner details.", 'give'));
319 319
 			}
320 320
 
321 321
 			// Check plugin path calculated by addon file path.
322
-			if ( empty( $file_name ) ) {
323
-				throw new Exception( __( "Empty Addon plugin path for {$this->banner_details['name']} addon.", 'give' ) );
322
+			if (empty($file_name)) {
323
+				throw new Exception(__("Empty Addon plugin path for {$this->banner_details['name']} addon.", 'give'));
324 324
 			}
325 325
 
326
-		} catch ( Exception $e ) {
326
+		} catch (Exception $e) {
327 327
 			echo $e->getMessage();
328 328
 		}
329 329
 
Please login to merge, or discard this patch.
includes/gateways/offline-donations.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -261,10 +261,10 @@
 block discarded – undo
261 261
 	$admin_message .= '<strong>' . esc_attr__( 'Amount:', 'give' ) . '</strong> {price}' . "\n\n";
262 262
 
263 263
 	$admin_message .= sprintf(
264
-		                  '<a href="%1$s">%2$s</a>',
265
-		                  admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id=' . $payment_id ),
266
-		                  esc_html__( 'Click Here to View and/or Update Donation Details', 'give' )
267
-	                  ) . "\n\n";
264
+						  '<a href="%1$s">%2$s</a>',
265
+						  admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id=' . $payment_id ),
266
+						  esc_html__( 'Click Here to View and/or Update Donation Details', 'give' )
267
+					  ) . "\n\n";
268 268
 
269 269
 	$admin_message = apply_filters( 'give_offline_admin_donation_notification', $admin_message, $payment_id );
270 270
 	$admin_message = give_do_email_tags( $admin_message, $payment_id );
Please login to merge, or discard this patch.
Spacing   +134 added lines, -134 removed lines patch added patch discarded remove patch
@@ -18,17 +18,17 @@  discard block
 block discarded – undo
18 18
  *
19 19
  * @return array
20 20
  */
21
-function give_offline_register_gateway( $gateways ) {
21
+function give_offline_register_gateway($gateways) {
22 22
 	// Format: ID => Name
23 23
 	$gateways['offline'] = array(
24
-		'admin_label'    => esc_attr__( 'Offline Donation', 'give' ),
25
-		'checkout_label' => esc_attr__( 'Offline Donation', 'give' )
24
+		'admin_label'    => esc_attr__('Offline Donation', 'give'),
25
+		'checkout_label' => esc_attr__('Offline Donation', 'give')
26 26
 	);
27 27
 
28 28
 	return $gateways;
29 29
 }
30 30
 
31
-add_filter( 'give_payment_gateways', 'give_offline_register_gateway', 1 );
31
+add_filter('give_payment_gateways', 'give_offline_register_gateway', 1);
32 32
 
33 33
 
34 34
 /**
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
  *
41 41
  * @return void
42 42
  */
43
-function give_offline_payment_cc_form( $form_id ) {
43
+function give_offline_payment_cc_form($form_id) {
44 44
 
45
-	$post_offline_customization_option = get_post_meta( $form_id, '_give_customize_offline_donations', true );
46
-	$post_offline_instructions         = get_post_meta( $form_id, '_give_offline_checkout_notes', true );
47
-	$global_offline_instruction        = give_get_option( 'global_offline_donation_content' );
45
+	$post_offline_customization_option = get_post_meta($form_id, '_give_customize_offline_donations', true);
46
+	$post_offline_instructions         = get_post_meta($form_id, '_give_offline_checkout_notes', true);
47
+	$global_offline_instruction        = give_get_option('global_offline_donation_content');
48 48
 	$offline_instructions              = $global_offline_instruction;
49 49
 
50
-	if ( give_is_setting_enabled( $post_offline_customization_option, 'enabled' ) ) {
50
+	if (give_is_setting_enabled($post_offline_customization_option, 'enabled')) {
51 51
 		$offline_instructions = $post_offline_instructions;
52 52
 	}
53 53
 
@@ -60,14 +60,14 @@  discard block
 block discarded – undo
60 60
 	 *
61 61
 	 * @param int $form_id Give form id.
62 62
 	 */
63
-	do_action( 'give_before_offline_info_fields', $form_id );
63
+	do_action('give_before_offline_info_fields', $form_id);
64 64
 	?>
65 65
 	<fieldset id="give_offline_payment_info">
66 66
 		<?php
67
-		$settings_url = admin_url( 'post.php?post=' . $form_id . '&action=edit&message=1' );
67
+		$settings_url = admin_url('post.php?post='.$form_id.'&action=edit&message=1');
68 68
 		/* translators: %s: form settings url */
69
-		$offline_instructions = ! empty( $offline_instructions ) ? $offline_instructions : sprintf( __( 'Please enter offline donation instructions in <a href="%s">this form\'s settings</a>.', 'give' ), $settings_url );
70
-		echo wpautop( stripslashes( $offline_instructions ) );
69
+		$offline_instructions = ! empty($offline_instructions) ? $offline_instructions : sprintf(__('Please enter offline donation instructions in <a href="%s">this form\'s settings</a>.', 'give'), $settings_url);
70
+		echo wpautop(stripslashes($offline_instructions));
71 71
 		?>
72 72
 	</fieldset>
73 73
 	<?php
@@ -78,35 +78,35 @@  discard block
 block discarded – undo
78 78
 	 *
79 79
 	 * @param int $form_id Give form id.
80 80
 	 */
81
-	do_action( 'give_after_offline_info_fields', $form_id );
81
+	do_action('give_after_offline_info_fields', $form_id);
82 82
 
83 83
 	echo ob_get_clean();
84 84
 }
85 85
 
86
-add_action( 'give_offline_cc_form', 'give_offline_payment_cc_form' );
86
+add_action('give_offline_cc_form', 'give_offline_payment_cc_form');
87 87
 
88 88
 /**
89 89
  * Give Offline Billing Field
90 90
  *
91 91
  * @param $form_id
92 92
  */
93
-function give_offline_billing_fields( $form_id ) {
93
+function give_offline_billing_fields($form_id) {
94 94
 	//Enable Default CC fields (billing info)
95
-	$post_offline_cc_fields        = get_post_meta( $form_id, '_give_offline_donation_enable_billing_fields_single', true );
96
-	$post_offline_customize_option = get_post_meta( $form_id, '_give_customize_offline_donations', true );
95
+	$post_offline_cc_fields        = get_post_meta($form_id, '_give_offline_donation_enable_billing_fields_single', true);
96
+	$post_offline_customize_option = get_post_meta($form_id, '_give_customize_offline_donations', true);
97 97
 
98
-	$global_offline_cc_fields = give_get_option( 'give_offline_donation_enable_billing_fields' );
98
+	$global_offline_cc_fields = give_get_option('give_offline_donation_enable_billing_fields');
99 99
 
100 100
 	//Output CC Address fields if global option is on and user hasn't elected to customize this form's offline donation options
101 101
 	if (
102
-		( give_is_setting_enabled( $post_offline_customize_option, 'global' ) && give_is_setting_enabled( $global_offline_cc_fields ) )
103
-		|| ( give_is_setting_enabled( $post_offline_customize_option, 'enabled' ) && give_is_setting_enabled( $post_offline_cc_fields ) )
102
+		(give_is_setting_enabled($post_offline_customize_option, 'global') && give_is_setting_enabled($global_offline_cc_fields))
103
+		|| (give_is_setting_enabled($post_offline_customize_option, 'enabled') && give_is_setting_enabled($post_offline_cc_fields))
104 104
 	) {
105
-		give_default_cc_address_fields( $form_id );
105
+		give_default_cc_address_fields($form_id);
106 106
 	}
107 107
 }
108 108
 
109
-add_action( 'give_before_offline_info_fields', 'give_offline_billing_fields', 10, 1 );
109
+add_action('give_before_offline_info_fields', 'give_offline_billing_fields', 10, 1);
110 110
 
111 111
 /**
112 112
  * Process the payment
@@ -117,16 +117,16 @@  discard block
 block discarded – undo
117 117
  *
118 118
  * @return void
119 119
  */
120
-function give_offline_process_payment( $purchase_data ) {
120
+function give_offline_process_payment($purchase_data) {
121 121
 
122
-	$purchase_summary = give_get_purchase_summary( $purchase_data );
122
+	$purchase_summary = give_get_purchase_summary($purchase_data);
123 123
 
124 124
 	// setup the payment details
125 125
 	$payment_data = array(
126 126
 		'price'           => $purchase_data['price'],
127 127
 		'give_form_title' => $purchase_data['post_data']['give-form-title'],
128
-		'give_form_id'    => intval( $purchase_data['post_data']['give-form-id'] ),
129
-		'give_price_id'   => isset( $purchase_data['post_data']['give-price-id'] ) ? $purchase_data['post_data']['give-price-id'] : '',
128
+		'give_form_id'    => intval($purchase_data['post_data']['give-form-id']),
129
+		'give_price_id'   => isset($purchase_data['post_data']['give-price-id']) ? $purchase_data['post_data']['give-price-id'] : '',
130 130
 		'date'            => $purchase_data['date'],
131 131
 		'user_email'      => $purchase_data['user_email'],
132 132
 		'purchase_key'    => $purchase_data['purchase_key'],
@@ -138,20 +138,20 @@  discard block
 block discarded – undo
138 138
 
139 139
 
140 140
 	// record the pending payment
141
-	$payment = give_insert_payment( $payment_data );
141
+	$payment = give_insert_payment($payment_data);
142 142
 
143
-	if ( $payment ) {
144
-		give_offline_send_admin_notice( $payment );
145
-		give_offline_send_donor_instructions( $payment );
143
+	if ($payment) {
144
+		give_offline_send_admin_notice($payment);
145
+		give_offline_send_donor_instructions($payment);
146 146
 		give_send_to_success_page();
147 147
 	} else {
148 148
 		// if errors are present, send the user back to the donation form so they can be corrected
149
-		give_send_back_to_checkout( '?payment-mode=' . $purchase_data['post_data']['give-gateway'] );
149
+		give_send_back_to_checkout('?payment-mode='.$purchase_data['post_data']['give-gateway']);
150 150
 	}
151 151
 
152 152
 }
153 153
 
154
-add_action( 'give_gateway_offline', 'give_offline_process_payment' );
154
+add_action('give_gateway_offline', 'give_offline_process_payment');
155 155
 
156 156
 
157 157
 /**
@@ -164,59 +164,59 @@  discard block
 block discarded – undo
164 164
  * @since       1.0
165 165
  * @return void
166 166
  */
167
-function give_offline_send_donor_instructions( $payment_id = 0 ) {
167
+function give_offline_send_donor_instructions($payment_id = 0) {
168 168
 
169
-	$payment_data                      = give_get_payment_meta( $payment_id );
170
-	$post_offline_customization_option = get_post_meta( $payment_data['form_id'], '_give_customize_offline_donations', true );
169
+	$payment_data                      = give_get_payment_meta($payment_id);
170
+	$post_offline_customization_option = get_post_meta($payment_data['form_id'], '_give_customize_offline_donations', true);
171 171
 
172 172
 	//Customize email content depending on whether the single form has been customized
173
-	$email_content = give_get_option( 'global_offline_donation_email' );
173
+	$email_content = give_get_option('global_offline_donation_email');
174 174
 
175
-	if ( give_is_setting_enabled( $post_offline_customization_option, 'enabled' ) ) {
176
-		$email_content = get_post_meta( $payment_data['form_id'], '_give_offline_donation_email', true );
175
+	if (give_is_setting_enabled($post_offline_customization_option, 'enabled')) {
176
+		$email_content = get_post_meta($payment_data['form_id'], '_give_offline_donation_email', true);
177 177
 	}
178 178
 
179
-	$from_name = give_get_option( 'from_name', wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ) );
179
+	$from_name = give_get_option('from_name', wp_specialchars_decode(get_bloginfo('name'), ENT_QUOTES));
180 180
 
181 181
 	/**
182 182
 	 * Filters the from name.
183 183
 	 *
184 184
 	 * @since 1.7
185 185
 	 */
186
-	$from_name = apply_filters( 'give_donation_from_name', $from_name, $payment_id, $payment_data );
186
+	$from_name = apply_filters('give_donation_from_name', $from_name, $payment_id, $payment_data);
187 187
 
188
-	$from_email = give_get_option( 'from_email', get_bloginfo( 'admin_email' ) );
188
+	$from_email = give_get_option('from_email', get_bloginfo('admin_email'));
189 189
 
190 190
 	/**
191 191
 	 * Filters the from email.
192 192
 	 *
193 193
 	 * @since 1.7
194 194
 	 */
195
-	$from_email = apply_filters( 'give_donation_from_address', $from_email, $payment_id, $payment_data );
195
+	$from_email = apply_filters('give_donation_from_address', $from_email, $payment_id, $payment_data);
196 196
 
197
-	$to_email = give_get_payment_user_email( $payment_id );
197
+	$to_email = give_get_payment_user_email($payment_id);
198 198
 
199
-	$subject = give_get_option( 'offline_donation_subject', esc_html__( 'Offline Donation Instructions', 'give' ) );
200
-	if ( give_is_setting_enabled( $post_offline_customization_option,  'enabled' ) ) {
201
-		$subject = get_post_meta( $payment_data['form_id'], '_give_offline_donation_subject', true );
199
+	$subject = give_get_option('offline_donation_subject', esc_html__('Offline Donation Instructions', 'give'));
200
+	if (give_is_setting_enabled($post_offline_customization_option, 'enabled')) {
201
+		$subject = get_post_meta($payment_data['form_id'], '_give_offline_donation_subject', true);
202 202
 	}
203 203
 
204
-	$subject = apply_filters( 'give_offline_donation_subject', wp_strip_all_tags( $subject ), $payment_id );
205
-	$subject = give_do_email_tags( $subject, $payment_id );
204
+	$subject = apply_filters('give_offline_donation_subject', wp_strip_all_tags($subject), $payment_id);
205
+	$subject = give_do_email_tags($subject, $payment_id);
206 206
 
207
-	$attachments = apply_filters( 'give_offline_donation_attachments', array(), $payment_id, $payment_data );
208
-	$message     = give_do_email_tags( $email_content, $payment_id );
207
+	$attachments = apply_filters('give_offline_donation_attachments', array(), $payment_id, $payment_data);
208
+	$message     = give_do_email_tags($email_content, $payment_id);
209 209
 
210 210
 	$emails = Give()->emails;
211 211
 
212
-	$emails->__set( 'from_name', $from_name );
213
-	$emails->__set( 'from_email', $from_email );
214
-	$emails->__set( 'heading', esc_html__( 'Offline Donation Instructions', 'give' ) );
212
+	$emails->__set('from_name', $from_name);
213
+	$emails->__set('from_email', $from_email);
214
+	$emails->__set('heading', esc_html__('Offline Donation Instructions', 'give'));
215 215
 
216
-	$headers = apply_filters( 'give_receipt_headers', $emails->get_headers(), $payment_id, $payment_data );
217
-	$emails->__set( 'headers', $headers );
216
+	$headers = apply_filters('give_receipt_headers', $emails->get_headers(), $payment_id, $payment_data);
217
+	$emails->__set('headers', $headers);
218 218
 
219
-	$emails->send( $to_email, $subject, $message, $attachments );
219
+	$emails->send($to_email, $subject, $message, $attachments);
220 220
 
221 221
 }
222 222
 
@@ -233,52 +233,52 @@  discard block
 block discarded – undo
233 233
  * @return void
234 234
  *
235 235
  */
236
-function give_offline_send_admin_notice( $payment_id = 0 ) {
236
+function give_offline_send_admin_notice($payment_id = 0) {
237 237
 
238 238
 	/* Send an email notification to the admin */
239 239
 	$admin_email = give_get_admin_notice_emails();
240
-	$user_info   = give_get_payment_meta_user_info( $payment_id );
240
+	$user_info   = give_get_payment_meta_user_info($payment_id);
241 241
 
242
-	if ( isset( $user_info['id'] ) && $user_info['id'] > 0 ) {
243
-		$user_data = get_userdata( $user_info['id'] );
242
+	if (isset($user_info['id']) && $user_info['id'] > 0) {
243
+		$user_data = get_userdata($user_info['id']);
244 244
 		$name      = $user_data->display_name;
245
-	} elseif ( isset( $user_info['first_name'] ) && isset( $user_info['last_name'] ) ) {
246
-		$name = $user_info['first_name'] . ' ' . $user_info['last_name'];
245
+	} elseif (isset($user_info['first_name']) && isset($user_info['last_name'])) {
246
+		$name = $user_info['first_name'].' '.$user_info['last_name'];
247 247
 	} else {
248 248
 		$name = $user_info['email'];
249 249
 	}
250 250
 
251
-	$amount = give_currency_filter( give_format_amount( give_get_payment_amount( $payment_id ) ) );
251
+	$amount = give_currency_filter(give_format_amount(give_get_payment_amount($payment_id)));
252 252
 
253
-	$admin_subject = apply_filters( 'give_offline_admin_donation_notification_subject', esc_attr__( 'New Pending Donation', 'give' ), $payment_id );
253
+	$admin_subject = apply_filters('give_offline_admin_donation_notification_subject', esc_attr__('New Pending Donation', 'give'), $payment_id);
254 254
 
255
-	$admin_message = esc_attr__( 'Dear Admin,', 'give' ) . "\n\n";
256
-	$admin_message .= esc_attr__( 'An offline donation has been made on your website:', 'give' ) . ' ' . get_bloginfo( 'name' ) . ' ';
257
-	$admin_message .= esc_attr__( 'Hooray! The donation is in a pending status and is awaiting payment. Donation instructions have been emailed to the donor. Once you receive payment, be sure to mark the donation as complete using the link below.', 'give' ) . "\n\n";
255
+	$admin_message = esc_attr__('Dear Admin,', 'give')."\n\n";
256
+	$admin_message .= esc_attr__('An offline donation has been made on your website:', 'give').' '.get_bloginfo('name').' ';
257
+	$admin_message .= esc_attr__('Hooray! The donation is in a pending status and is awaiting payment. Donation instructions have been emailed to the donor. Once you receive payment, be sure to mark the donation as complete using the link below.', 'give')."\n\n";
258 258
 
259 259
 
260
-	$admin_message .= '<strong>' . esc_attr__( 'Donor:', 'give' ) . '</strong> {fullname}' . "\n";
261
-	$admin_message .= '<strong>' . esc_attr__( 'Amount:', 'give' ) . '</strong> {price}' . "\n\n";
260
+	$admin_message .= '<strong>'.esc_attr__('Donor:', 'give').'</strong> {fullname}'."\n";
261
+	$admin_message .= '<strong>'.esc_attr__('Amount:', 'give').'</strong> {price}'."\n\n";
262 262
 
263 263
 	$admin_message .= sprintf(
264 264
 		                  '<a href="%1$s">%2$s</a>',
265
-		                  admin_url( 'edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id=' . $payment_id ),
266
-		                  esc_html__( 'Click Here to View and/or Update Donation Details', 'give' )
267
-	                  ) . "\n\n";
265
+		                  admin_url('edit.php?post_type=give_forms&page=give-payment-history&view=view-order-details&id='.$payment_id),
266
+		                  esc_html__('Click Here to View and/or Update Donation Details', 'give')
267
+	                  )."\n\n";
268 268
 
269
-	$admin_message = apply_filters( 'give_offline_admin_donation_notification', $admin_message, $payment_id );
270
-	$admin_message = give_do_email_tags( $admin_message, $payment_id );
269
+	$admin_message = apply_filters('give_offline_admin_donation_notification', $admin_message, $payment_id);
270
+	$admin_message = give_do_email_tags($admin_message, $payment_id);
271 271
 
272
-	$attachments   = apply_filters( 'give_offline_admin_donation_notification_attachments', array(), $payment_id );
273
-	$admin_headers = apply_filters( 'give_offline_admin_donation_notification_headers', array(), $payment_id );
272
+	$attachments   = apply_filters('give_offline_admin_donation_notification_attachments', array(), $payment_id);
273
+	$admin_headers = apply_filters('give_offline_admin_donation_notification_headers', array(), $payment_id);
274 274
 
275 275
 	//Send Email
276 276
 	$emails = Give()->emails;
277
-	if ( ! empty( $admin_headers ) ) {
278
-		$emails->__set( 'headers', $admin_headers );
277
+	if ( ! empty($admin_headers)) {
278
+		$emails->__set('headers', $admin_headers);
279 279
 	}
280 280
 
281
-	$emails->send( $admin_email, $admin_subject, $admin_message, $attachments );
281
+	$emails->send($admin_email, $admin_subject, $admin_message, $attachments);
282 282
 
283 283
 }
284 284
 
@@ -289,15 +289,15 @@  discard block
 block discarded – undo
289 289
  * @since  1.0
290 290
  * @return array
291 291
  */
292
-function give_offline_add_settings( $settings ) {
292
+function give_offline_add_settings($settings) {
293 293
 
294 294
 	//Vars
295 295
 	$prefix = '_give_';
296 296
 
297
-	$is_gateway_active = give_is_gateway_active( 'offline' );
297
+	$is_gateway_active = give_is_gateway_active('offline');
298 298
 
299 299
 	//this gateway isn't active
300
-	if ( ! $is_gateway_active ) {
300
+	if ( ! $is_gateway_active) {
301 301
 		//return settings and bounce
302 302
 		return $settings;
303 303
 	}
@@ -306,34 +306,34 @@  discard block
 block discarded – undo
306 306
 	$check_settings = array(
307 307
 
308 308
 		array(
309
-			'name'    => esc_attr__( 'Offline Donations', 'give' ),
310
-			'desc'    => esc_attr__( 'Do you want to customize the donation instructions for this form?', 'give' ),
311
-			'id'      => $prefix . 'customize_offline_donations',
309
+			'name'    => esc_attr__('Offline Donations', 'give'),
310
+			'desc'    => esc_attr__('Do you want to customize the donation instructions for this form?', 'give'),
311
+			'id'      => $prefix.'customize_offline_donations',
312 312
 			'type'    => 'radio_inline',
313 313
 			'default' => 'global',
314
-			'options' => apply_filters( 'give_forms_content_options_select', array(
315
-					'global'   => esc_html__( 'Global Options', 'give' ),
316
-					'enabled'  => esc_html__( 'Customize', 'give' ),
317
-					'disabled' => esc_html__( 'Disable', 'give' ),
314
+			'options' => apply_filters('give_forms_content_options_select', array(
315
+					'global'   => esc_html__('Global Options', 'give'),
316
+					'enabled'  => esc_html__('Customize', 'give'),
317
+					'disabled' => esc_html__('Disable', 'give'),
318 318
 				)
319 319
 			),
320 320
 		),
321 321
 		array(
322
-			'name'        => esc_attr__( 'Billing Fields', 'give' ),
323
-			'desc'        => esc_attr__( 'This option will enable the billing details section for this form\'s offline donation payment gateway. The fieldset will appear above the offline donation instructions.', 'give' ),
324
-			'id'          => $prefix . 'offline_donation_enable_billing_fields_single',
322
+			'name'        => esc_attr__('Billing Fields', 'give'),
323
+			'desc'        => esc_attr__('This option will enable the billing details section for this form\'s offline donation payment gateway. The fieldset will appear above the offline donation instructions.', 'give'),
324
+			'id'          => $prefix.'offline_donation_enable_billing_fields_single',
325 325
 			'row_classes' => 'give-subfield',
326 326
 			'type'        => 'radio_inline',
327 327
 			'default'     => 'disabled',
328 328
 			'options'     => array(
329
-				'enabled'  => esc_html__( 'Enabled', 'give' ),
330
-				'disabled' => esc_html__( 'Disabled', 'give' ),
329
+				'enabled'  => esc_html__('Enabled', 'give'),
330
+				'disabled' => esc_html__('Disabled', 'give'),
331 331
 			),
332 332
 		),
333 333
 		array(
334
-			'id'          => $prefix . 'offline_checkout_notes',
335
-			'name'        => esc_attr__( 'Donation Instructions', 'give' ),
336
-			'desc'        => esc_attr__( 'Enter the instructions you want to display to the donor during the donation process. Most likely this would include important information like mailing address and who to make the check out to.', 'give' ),
334
+			'id'          => $prefix.'offline_checkout_notes',
335
+			'name'        => esc_attr__('Donation Instructions', 'give'),
336
+			'desc'        => esc_attr__('Enter the instructions you want to display to the donor during the donation process. Most likely this would include important information like mailing address and who to make the check out to.', 'give'),
337 337
 			'default'     => give_get_default_offline_donation_content(),
338 338
 			'type'        => 'wysiwyg',
339 339
 			'row_classes' => 'give-subfield',
@@ -342,17 +342,17 @@  discard block
 block discarded – undo
342 342
 			)
343 343
 		),
344 344
 		array(
345
-			'id'          => $prefix . 'offline_donation_subject',
346
-			'name'        => esc_attr__( 'Email Subject', 'give' ),
347
-			'desc'        => esc_attr__( 'Enter the subject line for the donation receipt email.', 'give' ),
348
-			'default'     => esc_attr__( '{donation} - Offline Donation Instructions', 'give' ),
345
+			'id'          => $prefix.'offline_donation_subject',
346
+			'name'        => esc_attr__('Email Subject', 'give'),
347
+			'desc'        => esc_attr__('Enter the subject line for the donation receipt email.', 'give'),
348
+			'default'     => esc_attr__('{donation} - Offline Donation Instructions', 'give'),
349 349
 			'row_classes' => 'give-subfield',
350 350
 			'type'        => 'text'
351 351
 		),
352 352
 		array(
353
-			'id'          => $prefix . 'offline_donation_email',
354
-			'name'        => esc_attr__( 'Email Instructions', 'give' ),
355
-			'desc'        => esc_attr__( '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' ),
353
+			'id'          => $prefix.'offline_donation_email',
354
+			'name'        => esc_attr__('Email Instructions', 'give'),
355
+			'desc'        => esc_attr__('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'),
356 356
 			'default'     => give_get_default_offline_donation_email_content(),
357 357
 			'type'        => 'wysiwyg',
358 358
 			'row_classes' => 'give-subfield',
@@ -362,10 +362,10 @@  discard block
 block discarded – undo
362 362
 		)
363 363
 	);
364 364
 
365
-	return array_merge( $settings, $check_settings );
365
+	return array_merge($settings, $check_settings);
366 366
 }
367 367
 
368
-add_filter( 'give_forms_offline_donations_metabox_fields', 'give_offline_add_settings' );
368
+add_filter('give_forms_offline_donations_metabox_fields', 'give_offline_add_settings');
369 369
 
370 370
 
371 371
 /**
@@ -377,32 +377,32 @@  discard block
 block discarded – undo
377 377
  */
378 378
 function give_get_default_offline_donation_content() {
379 379
 
380
-	$sitename = get_bloginfo( 'sitename' );
380
+	$sitename = get_bloginfo('sitename');
381 381
 
382
-	$default_text = '<p>' . esc_attr__( 'In order to make an offline donation we ask that you please follow these instructions', 'give' ) . ': </p>';
382
+	$default_text = '<p>'.esc_attr__('In order to make an offline donation we ask that you please follow these instructions', 'give').': </p>';
383 383
 	$default_text .= '<ol>';
384 384
 	$default_text .= '<li>';
385 385
 	$default_text .= sprintf(
386 386
 	/* translators: %s: site name */
387
-		esc_html__( 'Make a check payable to "%s"', 'give' ),
387
+		esc_html__('Make a check payable to "%s"', 'give'),
388 388
 		$sitename
389 389
 	);
390 390
 	$default_text .= '</li>';
391 391
 	$default_text .= '<li>';
392 392
 	$default_text .= sprintf(
393 393
 	/* translators: %s: site name */
394
-		esc_html__( 'On the memo line of the check, please indicate that the donation is for "%s"', 'give' ),
394
+		esc_html__('On the memo line of the check, please indicate that the donation is for "%s"', 'give'),
395 395
 		$sitename
396 396
 	);
397 397
 	$default_text .= '</li>';
398
-	$default_text .= '<li>' . esc_html__( 'Please mail your check to:', 'give' ) . '</li>';
398
+	$default_text .= '<li>'.esc_html__('Please mail your check to:', 'give').'</li>';
399 399
 	$default_text .= '</ol>';
400
-	$default_text .= '&nbsp;&nbsp;&nbsp;&nbsp;<em>' . $sitename . '</em><br>';
400
+	$default_text .= '&nbsp;&nbsp;&nbsp;&nbsp;<em>'.$sitename.'</em><br>';
401 401
 	$default_text .= '&nbsp;&nbsp;&nbsp;&nbsp;<em>123 G Street </em><br>';
402 402
 	$default_text .= '&nbsp;&nbsp;&nbsp;&nbsp;<em>San Diego, CA 92101 </em><br>';
403
-	$default_text .= '<p>' . esc_attr__( 'All contributions will be gratefully acknowledged and are tax deductible.', 'give' ) . '</p>';
403
+	$default_text .= '<p>'.esc_attr__('All contributions will be gratefully acknowledged and are tax deductible.', 'give').'</p>';
404 404
 
405
-	return apply_filters( 'give_default_offline_donation_content', $default_text );
405
+	return apply_filters('give_default_offline_donation_content', $default_text);
406 406
 
407 407
 }
408 408
 
@@ -415,34 +415,34 @@  discard block
 block discarded – undo
415 415
  */
416 416
 function give_get_default_offline_donation_email_content() {
417 417
 
418
-	$sitename     = get_bloginfo( 'sitename' );
419
-	$default_text = '<p>' . esc_html__( 'Dear {name},', 'give' ) . '</p>';
420
-	$default_text .= '<p>' . esc_html__( 'Thank you for your offline donation request! Your generosity is greatly appreciated. In order to make an offline donation we ask that you please follow these instructions:', 'give' ) . '</p>';
418
+	$sitename     = get_bloginfo('sitename');
419
+	$default_text = '<p>'.esc_html__('Dear {name},', 'give').'</p>';
420
+	$default_text .= '<p>'.esc_html__('Thank you for your offline donation request! Your generosity is greatly appreciated. In order to make an offline donation we ask that you please follow these instructions:', 'give').'</p>';
421 421
 	$default_text .= '<ol>';
422 422
 	$default_text .= '<li>';
423 423
 	$default_text .= sprintf(
424 424
 	/* translators: %s: site name */
425
-		esc_html__( 'Make a check payable to "%s"', 'give' ),
425
+		esc_html__('Make a check payable to "%s"', 'give'),
426 426
 		$sitename
427 427
 	);
428 428
 	$default_text .= '</li>';
429 429
 	$default_text .= '<li>';
430 430
 	$default_text .= sprintf(
431 431
 	/* translators: %s: site name */
432
-		esc_html__( 'On the memo line of the check, please indicate that the donation is for "%s"', 'give' ),
432
+		esc_html__('On the memo line of the check, please indicate that the donation is for "%s"', 'give'),
433 433
 		$sitename
434 434
 	);
435 435
 	$default_text .= '</li>';
436
-	$default_text .= '<li>' . esc_html__( 'Please mail your check to:', 'give' ) . '</li>';
436
+	$default_text .= '<li>'.esc_html__('Please mail your check to:', 'give').'</li>';
437 437
 	$default_text .= '</ol>';
438
-	$default_text .= '&nbsp;&nbsp;&nbsp;&nbsp;<em>' . $sitename . '</em><br>';
438
+	$default_text .= '&nbsp;&nbsp;&nbsp;&nbsp;<em>'.$sitename.'</em><br>';
439 439
 	$default_text .= '&nbsp;&nbsp;&nbsp;&nbsp;<em>123 G Street </em><br>';
440 440
 	$default_text .= '&nbsp;&nbsp;&nbsp;&nbsp;<em>San Diego, CA 92101 </em><br>';
441
-	$default_text .= '<p>' . esc_html__( 'Once your donation has been received we will mark it as complete and you will receive an email receipt for your records. Please contact us with any questions you may have!', 'give' ) . '</p>';
442
-	$default_text .= '<p>' . esc_html__( 'Sincerely,', 'give' ) . '</p>';
443
-	$default_text .= '<p>' . $sitename . '</p>';
441
+	$default_text .= '<p>'.esc_html__('Once your donation has been received we will mark it as complete and you will receive an email receipt for your records. Please contact us with any questions you may have!', 'give').'</p>';
442
+	$default_text .= '<p>'.esc_html__('Sincerely,', 'give').'</p>';
443
+	$default_text .= '<p>'.$sitename.'</p>';
444 444
 
445
-	return apply_filters( 'give_default_offline_donation_content', $default_text );
445
+	return apply_filters('give_default_offline_donation_content', $default_text);
446 446
 
447 447
 }
448 448
 
@@ -457,16 +457,16 @@  discard block
 block discarded – undo
457 457
  *
458 458
  * @return array
459 459
  */
460
-function give_filter_offline_gateway( $gateway_list, $form_id ) {
461
-	if ( $form_id && ! give_is_setting_enabled( get_post_meta( $form_id, '_give_customize_offline_donations', true ), array( 'enabled', 'global' ) ) ) {
462
-		unset( $gateway_list['offline'] );
460
+function give_filter_offline_gateway($gateway_list, $form_id) {
461
+	if ($form_id && ! give_is_setting_enabled(get_post_meta($form_id, '_give_customize_offline_donations', true), array('enabled', 'global'))) {
462
+		unset($gateway_list['offline']);
463 463
 	}
464 464
 
465 465
 	// Output.
466 466
 	return $gateway_list;
467 467
 }
468 468
 
469
-add_filter( 'give_enabled_payment_gateways', 'give_filter_offline_gateway', 10, 2 );
469
+add_filter('give_enabled_payment_gateways', 'give_filter_offline_gateway', 10, 2);
470 470
 
471 471
 /**
472 472
  * Set default gateway to global default payment gateway
@@ -480,10 +480,10 @@  discard block
 block discarded – undo
480 480
  *
481 481
  * @return void
482 482
  */
483
-function _give_customize_offline_donations_on_save_callback( $meta_key, $meta_value, $postid ) {
484
-	if ( ( 'no' === $meta_value ) && ( 'offline' === get_post_meta( $postid, '_give_default_gateway', true ) ) ) {
485
-		update_post_meta( $postid, '_give_default_gateway', 'global' );
483
+function _give_customize_offline_donations_on_save_callback($meta_key, $meta_value, $postid) {
484
+	if (('no' === $meta_value) && ('offline' === get_post_meta($postid, '_give_default_gateway', true))) {
485
+		update_post_meta($postid, '_give_default_gateway', 'global');
486 486
 	}
487 487
 }
488 488
 
489
-add_filter( 'give_save__give_customize_offline_donations', '_give_customize_offline_donations_on_save_callback', 10, 3 );
489
+add_filter('give_save__give_customize_offline_donations', '_give_customize_offline_donations_on_save_callback', 10, 3);
Please login to merge, or discard this patch.
includes/filters.php 1 patch
Spacing   +11 added lines, -11 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
 
@@ -26,28 +26,28 @@  discard block
 block discarded – undo
26 26
  *
27 27
  * @return void
28 28
  */
29
-function give_set_settings_with_disable_prefix( $settings, $option_name ) {
29
+function give_set_settings_with_disable_prefix($settings, $option_name) {
30 30
 	// Get old setting names.
31 31
 	$old_settings   = give_v18_renamed_core_settings();
32 32
 	$update_setting = false;
33 33
 
34
-	foreach ( $settings as $key => $value ) {
34
+	foreach ($settings as $key => $value) {
35 35
 
36 36
 		// Check 1. Check if new option is really updated or not.
37 37
 		// Check 2. Continue if key is not renamed.
38 38
 		if (
39
-			! isset( $_POST[ $key ] )
40
-			|| false === ( $old_setting_name = array_search( $key, $old_settings ) )
39
+			! isset($_POST[$key])
40
+			|| false === ($old_setting_name = array_search($key, $old_settings))
41 41
 		) {
42 42
 			continue;
43 43
 		}
44 44
 
45 45
 		// Set old setting.
46
-		$settings[ $old_setting_name ] = 'on';
46
+		$settings[$old_setting_name] = 'on';
47 47
 
48 48
 		// Do not need to set old setting if new setting is not set.
49
-		if ( give_is_setting_enabled( $value ) ) {
50
-			unset( $settings[ $old_setting_name ] );
49
+		if (give_is_setting_enabled($value)) {
50
+			unset($settings[$old_setting_name]);
51 51
 		}
52 52
 
53 53
 		// Tell bot to update setting.
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
 	}
56 56
 
57 57
 	// Update setting if any old setting set.
58
-	if ( $update_setting ) {
59
-		update_option( $option_name, $settings );
58
+	if ($update_setting) {
59
+		update_option($option_name, $settings);
60 60
 	}
61 61
 }
62 62
 
63
-add_filter( 'give_save_settings_give_settings', 'give_set_settings_with_disable_prefix', 10, 2 );
63
+add_filter('give_save_settings_give_settings', 'give_set_settings_with_disable_prefix', 10, 2);
Please login to merge, or discard this patch.